@@ -13,7 +13,7 @@
13 <a href="#installation">Установка</a> •
13 <a href="#installation">Установка</a> •
14 <a href="#customization">Кастомизация</a> •
14 <a href="#customization">Кастомизация</a> •
15 <a href="#project-goals-and-alternatives">Цели проекта и его альтернативы </a> •
15 <a href="#project-goals-and-alternatives">Цели проекта и его альтернативы </a> •
16− Translation [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="doc/README-ja.md">日本語</a>][<a href="doc/README-ko.md">한국어</a>][<a href="doc/README-ru.md">日本語</a>][<a href="doc/README-ko.md">Русский</a>]
16+ Translation [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="doc/README-ja.md">日本語</a>][<a href="doc/README-ko.md">한국어</a>][<a href="doc/README-ru.md">Русский</a>]
19### Выделение синтаксиса
19### Выделение синтаксиса
@@ -271,7 +271,7 @@ brew install bat
271port install bat
271port install bat
274−### On Windows
274+### Windows
276Есть несколько способов установить `bat`. Как только вы установили его, посмотрите на секцию ["Using `bat` on Windows"](#using-bat-on-windows).
276Есть несколько способов установить `bat`. Как только вы установили его, посмотрите на секцию ["Using `bat` on Windows"](#using-bat-on-windows).
@@ -282,7 +282,7 @@ port install bat
282choco install bat
282choco install bat
285−#### With Scoop
285+#### С помощью Scoop
287Вы можете установить `bat` с помощью [scoop](https://scoop.sh/):
287Вы можете установить `bat` с помощью [scoop](https://scoop.sh/):
@@ -346,122 +346,103 @@ ansible-galaxy install aeimer.install_bat
346cargo install --locked bat
346cargo install --locked bat
349−## Customization
349+## Кастомизация
351−### Highlighting theme
351+### Темы для выделения текста
353−Use `bat --list-themes` to get a list of all available themes for syntax
353+Используйте `bat --list-themes` чтобы вывести список всех доступных тем. Для выбора темы `TwoDark`, используйте `bat` с флагом
354−highlighting. To select the `TwoDark` theme, call `bat` with the
354+`--theme=TwoDark` или поставьте переменную окружения `BAT_THEME` равной `TwoDark`. Используйте `export BAT_THEME="TwoDark"` в стартап файле вашей оболочки, чтобы изменить ее навсегда. Или же, используйте [конфиг файл](https://github.com/sharkdp/bat#configuration-file) `bat`.
355−`--theme=TwoDark` option or set the `BAT_THEME` environment variable to
356−`TwoDark`. Use `export BAT_THEME="TwoDark"` in your shell's startup file to
357−make the change permanent. Alternatively, use `bat`s
358−[configuration file](https://github.com/sharkdp/bat#configuration-file).
360−If you want to preview the different themes on a custom file, you can use
356+Если вы хотите просто просмотреть темы, используйте следующую команду (вам понадобится [`fzf`](https://github.com/junegunn/fzf) для этого):
361−the following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):
363−bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
358+bat --list-themes | fzf --preview="bat --theme={} --color=always /путь/к/файлу"
366−`bat` looks good on a dark background by default. However, if your terminal uses a
361+`bat` отлично смотрится на темном фоне. Однако, если ваш терминал использует светлую тему, такие темы как `GitHub` или `OneHalfLight` будут смотрется куда лучше!
367−light background, some themes like `GitHub` or `OneHalfLight` will work better for you.
362+Вы так-же можете использовать новую тему, для этого перейдите [в раздел добавления тем](https://github.com/sharkdp/bat#adding-new-themes).
368−You can also use a custom theme by following the
369−['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
371−### Output style
364+### Изменение внешнего вывода
373−You can use the `--style` option to control the appearance of `bat`s output.
366+Вы можете использовать флаг `--style` чтобы изменять внешний вид вывода в `bat`.
374−You can use `--style=numbers,changes`, for example, to show only Git changes
367+Например, вы можете использовать `--style=numbers,changes`, чтобы показать только количество строк и изменений в Git. Установите переменную окружения `BAT_STYLE` чтобы изменить это навсегда, или используйте [конфиг файл](https://github.com/sharkdp/bat#configuration-file) `bat`.
375−and line numbers but no grid and no file header. Set the `BAT_STYLE` environment
376−variable to make these changes permanent or use `bat`s
377−[configuration file](https://github.com/sharkdp/bat#configuration-file).
379−### Adding new syntaxes / language definitions
369+### Добавление новых синтаксисов
381−`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
371+`bat` использует [`syntect`](https://github.com/trishume/syntect/) для выделения синтаксиса. `syntect` может читать
382−library for syntax highlighting. `syntect` can read any
383−[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
372+[файл `.sublime-syntax`](https://www.sublimetext.com/docs/3/syntax.html)
384−and theme. To add new syntax definitions, do the following.
373+и темы. Чтобы добавить новый синтаксис, сделайте следующее:
386−Create a folder with syntax definition files:
375+Создайте каталог с синтаксисом:
389mkdir -p "$(bat --config-dir)/syntaxes"
378mkdir -p "$(bat --config-dir)/syntaxes"
390cd "$(bat --config-dir)/syntaxes"
379cd "$(bat --config-dir)/syntaxes"
392−# Put new '.sublime-syntax' language definition files
381+# Разместите файлы '.sublime-syntax'
393−# in this folder (or its subdirectories), for example:
382+# в каталоге (или субкаталогах), например:
394git clone https://github.com/tellnobody1/sublime-purescript-syntax
383git clone https://github.com/tellnobody1/sublime-purescript-syntax
397−Now use the following command to parse these files into a binary cache:
386+Теперь, используйте следующую команду, чтобы превратить эти файлы в бинарный кеш:
400bat cache --build
389bat cache --build
403−Finally, use `bat --list-languages` to check if the new languages are available.
392+Наконец, используйте `bat --list-languages` чтобы проверить, доступны ли новые языки.
405−If you ever want to go back to the default settings, call:
394+Если когда-нибудь вы заходите вернутся к настройкам по умолчанию, введите
408bat cache --clear
397bat cache --clear
411−### Adding new themes
400+### Добавление новых тем
413−This works very similar to how we add new syntax definitions.
402+Это работает похожим образом, так-же как и добавление новых тем выделения синтаксиса
415−First, create a folder with the new syntax highlighting themes:
404+Во-первых, создайте каталог с новыми темами для синтаксиса:
417mkdir -p "$(bat --config-dir)/themes"
406mkdir -p "$(bat --config-dir)/themes"
418cd "$(bat --config-dir)/themes"
407cd "$(bat --config-dir)/themes"
420−# Download a theme in '.tmTheme' format, for example:
409+# Загрузите тему в формате '.tmTheme':
421git clone https://github.com/greggb/sublime-snazzy
410git clone https://github.com/greggb/sublime-snazzy
423−# Update the binary cache
412+# Обновите кеш
424bat cache --build
413bat cache --build
427−Finally, use `bat --list-themes` to check if the new themes are available.
416+Теперь, используйте `bat --list-themes` чтобы проверить доступность новых тем.
429−### Using a different pager
418+### Использование другого пейджера.
431−`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
420+`bat` использует пейджер, указанный в переменной окружения `PAGER`. Если она не задана, то используется `less`.
432−set, `less` is used by default. If you want to use a different pager, you can either modify the
421+Если вы желаете использовать другой пейджер, вы можете либо изменить переменную `PAGER`, либо `BAT_PAGER` чтобы перезаписать то, что указано в `PAGER`.
433−`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
436−If you want to pass command-line arguments to the pager, you can also set them via the
423+Чтобы передать какие-то аргументы в ваш пейджер, вы так-же можете их поставить в этих переменных:
437−`PAGER`/`BAT_PAGER` variables:
440export BAT_PAGER="less -RF"
426export BAT_PAGER="less -RF"
443−Instead of using environment variables, you can also use `bat`s [configuration file](https://github.com/sharkdp/bat#configuration-file) to configure the pager (`--pager` option).
429+Так-же вы можете использовать [файл конфигурации](https://github.com/sharkdp/bat#configuration-file) `bat` для изменения. (флаг `--pager`).
445−**Note**: By default, if the pager is set to `less` (and no command-line options are specified),
431+**Внимание**: По умолчанию, `less` является пейджером (без каких либо аргументов),
446−`bat` will pass the following command line options to the pager: `-R`/`--RAW-CONTROL-CHARS`,
432+`bat` задаст следующие флаги для пейджера:
447−`-F`/`--quit-if-one-screen` and `-X`/`--no-init`. The last option (`-X`) is only used for `less`
433+ `-R`/`--RAW-CONTROL-CHARS`,
448−versions older than 530.
434+`-F`/`--quit-if-one-screen` и `-X`/`--no-init`. Последний флаг(`-X`) используется только для `less`, чья версия раньше 530.
450−The `-R` option is needed to interpret ANSI colors correctly. The second option (`-F`) instructs
436+Флаг `-R` нужен чтобы корректно воспроизвести ANSI цвета. Второй флаг (`-F`) говорит
451−less to exit immediately if the output size is smaller than the vertical size of the terminal.
437+`less` чтобы тот сразу-же завершился, если размер вывода меньше чем вертикальный размер терминала.
452−This is convenient for small files because you do not have to press `q` to quit the pager. The
438+Это удобно для небольших файлов, т.к вам не надо каждый раз нажимать `q` чтобы выйти из пейджера. Третий флаг (`-X`) нужен чтобы исправить баг с `--quit-if-one-screen` в старых версиях `less`. К сожалению, это так-же блокирует возможность использования там колеса мышки.
453−third option (`-X`) is needed to fix a bug with the `--quit-if-one-screen` feature in old versions
454−of `less`. Unfortunately, it also breaks mouse-wheel support in `less`.
456−If you want to enable mouse-wheel scrolling on older versions of `less`, you can pass just `-R` (as
440+Если вы хотите все же его включить, вы можете добавить флаг `-R`.
457−in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer,
441+Для `less` новее чем 530, оно должно работать из коробки.
458−it should work out of the box.
460−### Dark mode
443+### Темная тема
462−If you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different
445+Если вы используете темный режим в macOS, возможно вы захотите чтобы `bat` использовал другую тему, основанную на теме вашей ОС. Следующий сниппет использует тему `default`, когда у вас включен темный режим, и тему `GitHub`, когда включен светлый.
463−theme based on the OS theme. The following snippet uses the `default` theme when in the _dark mode_
464−and the `GitHub` theme when in the _light mode_.
467alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
448alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"