Используйте `bat --list-themes` чтобы вывести список всех доступных тем. Для выбора темы `TwoDark`, используйте `bat`с флагом
`--theme=TwoDark` или поставьте переменную окружения `BAT_THEME` равной `TwoDark`. Используйте `export BAT_THEME="TwoDark"` в стартап файле вашей оболочки, чтобы изменить ее навсегда. Или же, используйте [конфиг файл](https://github.com/sharkdp/bat#configuration-file) `bat`.
If you want to preview the different themes on a custom file, you can use
the following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):
Если вы хотите просто просмотреть темы, используйте следующую команду (вам понадобится [`fzf`](https://github.com/junegunn/fzf) для этого):
```bash
bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
bat --list-themes | fzf --preview="bat --theme={} --color=always /путь/к/файлу"
```
`bat` looks good on a dark background by default. However, if your terminal uses a
light background, some themes like `GitHub` or `OneHalfLight` will work better for you.
You can also use a custom theme by following the
['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
`bat` отлично смотрится на темном фоне. Однако, если ваш терминал использует светлую тему, такие темы как `GitHub` или `OneHalfLight` будут смотрется куда лучше!
Вы так-же можете использовать новую тему, для этого перейдите [в раздел добавления тем](https://github.com/sharkdp/bat#adding-new-themes).
### Output style
### Изменение внешнего вывода
You can use the `--style` option to control the appearance of `bat`s output.
You can use `--style=numbers,changes`, for example, to show only Git changes
and line numbers but no grid and no file header. Set the `BAT_STYLE` environment
variable to make these changes permanent or use `bat`s
Вы можете использовать флаг `--style` чтобы изменять внешний вид вывода в `bat`.
Например, вы можете использовать `--style=numbers,changes`, чтобы показать только количество строк и изменений в Git. Установите переменную окружения `BAT_STYLE` чтобы изменить это навсегда, или используйте [конфиг файл](https://github.com/sharkdp/bat#configuration-file) `bat`.
### Adding new syntaxes / language definitions
### Добавление новых синтаксисов
`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
library for syntax highlighting. `syntect` can read any
[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
and theme. To add new syntax definitions, do the following.
`bat` использует [`syntect`](https://github.com/trishume/syntect/) для выделения синтаксиса. `syntect` может читать
Finally, use `bat --list-themes` to check if the new themes are available.
Теперь, используйте `bat --list-themes` чтобы проверить доступность новых тем.
### Using a different pager
### Использование другого пейджера.
`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
set, `less` is used by default. If you want to use a different pager, you can either modify the
`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
`PAGER`.
`bat` использует пейджер, указанный в переменной окружения `PAGER`. Если она не задана, то используется `less`.
Если вы желаете использовать другой пейджер, вы можете либо изменить переменную `PAGER`, либо `BAT_PAGER` чтобы перезаписать то, что указано в `PAGER`.
If you want to pass command-line arguments to the pager, you can also set them via the
`PAGER`/`BAT_PAGER` variables:
Чтобы передать какие-то аргументы в ваш пейджер, вы так-же можете их поставить в этих переменных:
```bash
export BAT_PAGER="less -RF"
```
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).
Так-же вы можете использовать [файл конфигурации](https://github.com/sharkdp/bat#configuration-file) `bat` для изменения. (флаг `--pager`).
**Note**: By default, if the pager is set to `less` (and no command-line options are specified),
`bat`will pass the following command line options to the pager: `-R`/`--RAW-CONTROL-CHARS`,
`-F`/`--quit-if-one-screen` and `-X`/`--no-init`. The last option (`-X`) is only used for `less`
versions older than 530.
**Внимание**: По умолчанию, `less` является пейджером (без каких либо аргументов),
`bat`задаст следующие флаги для пейджера:
`-R`/`--RAW-CONTROL-CHARS`,
`-F`/`--quit-if-one-screen` и `-X`/`--no-init`. Последний флаг(`-X`) используется только для `less`, чья версия раньше 530.
The `-R` option is needed to interpret ANSI colors correctly. The second option (`-F`) instructs
less to exit immediately if the output size is smaller than the vertical size of the terminal.
This is convenient for small files because you do not have to press `q` to quit the pager. The
third option (`-X`) is needed to fix a bug with the `--quit-if-one-screen` feature in old versions
of `less`. Unfortunately, it also breaks mouse-wheel support in `less`.
Флаг `-R` нужен чтобы корректно воспроизвести ANSI цвета. Второй флаг (`-F`) говорит
`less` чтобы тот сразу-же завершился, если размер вывода меньше чем вертикальный размер терминала.
Это удобно для небольших файлов, т.к вам не надо каждый раз нажимать `q` чтобы выйти из пейджера. Третий флаг (`-X`) нужен чтобы исправить багс`--quit-if-one-screen` в старых версиях `less`. К сожалению, это так-же блокирует возможность использования там колеса мышки.
If you want to enable mouse-wheel scrolling on older versions of `less`, you can pass just `-R` (as
in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer,
it should work out of the box.
Если вы хотите все же его включить, вы можете добавить флаг `-R`.
Для `less` новее чем 530, оно должно работать из коробки.
### Dark mode
### Темная тема
If you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different
theme based on the OS theme. The following snippet uses the `default` theme when in the _dark mode_
and the `GitHub` theme when in the _light mode_.
Если вы используете темный режим в macOS, возможно вы захотите чтобы `bat` использовал другую тему, основанную на теме вашей ОС. Следующий сниппет использует тему `default`, когда у вас включен темный режим, и тему `GitHub`, когда включен светлый.