on master help sign in
customization is translated
commit4ea70f84095443a5e5b4ffb1f6582d79f67d2fa5 authorSergey Duck <sergeypechnikov326@gmail.com> dateWed 3 Jun 2020, 19:42 (6 years ago) parent0d2ef02
1 file changed+46−65
doc/README-ru.md+46−65
doc/README-ru.md+46−65
@@ -13,7 +13,7 @@
1313 <a href="#installation">Установка</a> •
1414 <a href="#customization">Кастомизация</a> •
1515 <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>]
1717</p>
1818
1919### Выделение синтаксиса
@@ -271,7 +271,7 @@ brew install bat
271271port install bat
272272```
273273
274−### On Windows
274+### Windows
275275
276276Есть несколько способов установить `bat`. Как только вы установили его, посмотрите на секцию ["Using `bat` on Windows"](#using-bat-on-windows).
277277
@@ -282,7 +282,7 @@ port install bat
282282choco install bat
283283```
284284
285−#### With Scoop
285+#### С помощью Scoop
286286
287287Вы можете установить `bat` с помощью [scoop](https://scoop.sh/):
288288```bash
@@ -346,122 +346,103 @@ ansible-galaxy install aeimer.install_bat
346346cargo install --locked bat
347347```
348348
349−## Customization
349+## Кастомизация
350350
351−### Highlighting theme
351+### Темы для выделения текста
352352
353−Use `bat --list-themes` to get a list of all available themes for syntax
354−highlighting. To select the `TwoDark` theme, call `bat` with the
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).
353+Используйте `bat --list-themes` чтобы вывести список всех доступных тем. Для выбора темы `TwoDark`, используйте `bat` с флагом
354+`--theme=TwoDark` или поставьте переменную окружения `BAT_THEME` равной `TwoDark`. Используйте `export BAT_THEME="TwoDark"` в стартап файле вашей оболочки, чтобы изменить ее навсегда. Или же, используйте [конфиг файл](https://github.com/sharkdp/bat#configuration-file) `bat`.
359355
360−If you want to preview the different themes on a custom file, you can use
361−the following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):
356+Если вы хотите просто просмотреть темы, используйте следующую команду (вам понадобится [`fzf`](https://github.com/junegunn/fzf) для этого):
362357```bash
363−bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
358+bat --list-themes | fzf --preview="bat --theme={} --color=always /путь/к/файлу"
364359```
365360
366−`bat` looks good on a dark background by default. However, if your terminal uses a
367−light background, some themes like `GitHub` or `OneHalfLight` will work better for you.
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).
361+`bat` отлично смотрится на темном фоне. Однако, если ваш терминал использует светлую тему, такие темы как `GitHub` или `OneHalfLight` будут смотрется куда лучше!
362+Вы так-же можете использовать новую тему, для этого перейдите [в раздел добавления тем](https://github.com/sharkdp/bat#adding-new-themes).
370363
371−### Output style
364+### Изменение внешнего вывода
372365
373−You can use the `--style` option to control the appearance of `bat`s output.
374−You can use `--style=numbers,changes`, for example, to show only Git changes
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).
366+Вы можете использовать флаг `--style` чтобы изменять внешний вид вывода в `bat`.
367+Например, вы можете использовать `--style=numbers,changes`, чтобы показать только количество строк и изменений в Git. Установите переменную окружения `BAT_STYLE` чтобы изменить это навсегда, или используйте [конфиг файл](https://github.com/sharkdp/bat#configuration-file) `bat`.
378368
379−### Adding new syntaxes / language definitions
369+### Добавление новых синтаксисов
380370
381−`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
382−library for syntax highlighting. `syntect` can read any
383−[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
384−and theme. To add new syntax definitions, do the following.
371+`bat` использует [`syntect`](https://github.com/trishume/syntect/) для выделения синтаксиса. `syntect` может читать
372+[файл `.sublime-syntax`](https://www.sublimetext.com/docs/3/syntax.html)
373+и темы. Чтобы добавить новый синтаксис, сделайте следующее:
385374
386−Create a folder with syntax definition files:
375+Создайте каталог с синтаксисом:
387376
388377```bash
389378mkdir -p "$(bat --config-dir)/syntaxes"
390379cd "$(bat --config-dir)/syntaxes"
391380
392−# Put new '.sublime-syntax' language definition files
393−# in this folder (or its subdirectories), for example:
381+# Разместите файлы '.sublime-syntax'
382+# в каталоге (или субкаталогах), например:
394383git clone https://github.com/tellnobody1/sublime-purescript-syntax
395384```
396385
397−Now use the following command to parse these files into a binary cache:
386+Теперь, используйте следующую команду, чтобы превратить эти файлы в бинарный кеш:
398387
399388```bash
400389bat cache --build
401390```
402391
403−Finally, use `bat --list-languages` to check if the new languages are available.
392+Наконец, используйте `bat --list-languages` чтобы проверить, доступны ли новые языки.
404393
405−If you ever want to go back to the default settings, call:
394+Если когда-нибудь вы заходите вернутся к настройкам по умолчанию, введите
406395
407396```bash
408397bat cache --clear
409398```
410399
411−### Adding new themes
400+### Добавление новых тем
412401
413−This works very similar to how we add new syntax definitions.
402+Это работает похожим образом, так-же как и добавление новых тем выделения синтаксиса
414403
415−First, create a folder with the new syntax highlighting themes:
404+Во-первых, создайте каталог с новыми темами для синтаксиса:
416405```bash
417406mkdir -p "$(bat --config-dir)/themes"
418407cd "$(bat --config-dir)/themes"
419408
420−# Download a theme in '.tmTheme' format, for example:
409+# Загрузите тему в формате '.tmTheme':
421410git clone https://github.com/greggb/sublime-snazzy
422411
423−# Update the binary cache
412+# Обновите кеш
424413bat cache --build
425414```
426415
427−Finally, use `bat --list-themes` to check if the new themes are available.
416+Теперь, используйте `bat --list-themes` чтобы проверить доступность новых тем.
428417
429−### Using a different pager
418+### Использование другого пейджера.
430419
431−`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
432−set, `less` is used by default. If you want to use a different pager, you can either modify the
433−`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
434−`PAGER`.
420+`bat` использует пейджер, указанный в переменной окружения `PAGER`. Если она не задана, то используется `less`.
421+Если вы желаете использовать другой пейджер, вы можете либо изменить переменную `PAGER`, либо `BAT_PAGER` чтобы перезаписать то, что указано в `PAGER`.
435422
436−If you want to pass command-line arguments to the pager, you can also set them via the
437−`PAGER`/`BAT_PAGER` variables:
423+Чтобы передать какие-то аргументы в ваш пейджер, вы так-же можете их поставить в этих переменных:
438424
439425```bash
440426export BAT_PAGER="less -RF"
441427```
442428
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`).
444430
445−**Note**: By default, if the pager is set to `less` (and no command-line options are specified),
446−`bat` will pass the following command line options to the pager: `-R`/`--RAW-CONTROL-CHARS`,
447−`-F`/`--quit-if-one-screen` and `-X`/`--no-init`. The last option (`-X`) is only used for `less`
448−versions older than 530.
431+**Внимание**: По умолчанию, `less` является пейджером (без каких либо аргументов),
432+`bat` задаст следующие флаги для пейджера:
433+ `-R`/`--RAW-CONTROL-CHARS`,
434+`-F`/`--quit-if-one-screen` и `-X`/`--no-init`. Последний флаг(`-X`) используется только для `less`, чья версия раньше 530.
449435
450−The `-R` option is needed to interpret ANSI colors correctly. The second option (`-F`) instructs
451−less to exit immediately if the output size is smaller than the vertical size of the terminal.
452−This is convenient for small files because you do not have to press `q` to quit the pager. The
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`.
436+Флаг `-R` нужен чтобы корректно воспроизвести ANSI цвета. Второй флаг (`-F`) говорит
437+`less` чтобы тот сразу-же завершился, если размер вывода меньше чем вертикальный размер терминала.
438+Это удобно для небольших файлов, т.к вам не надо каждый раз нажимать `q` чтобы выйти из пейджера. Третий флаг (`-X`) нужен чтобы исправить баг с `--quit-if-one-screen` в старых версиях `less`. К сожалению, это так-же блокирует возможность использования там колеса мышки.
455439
456−If you want to enable mouse-wheel scrolling on older versions of `less`, you can pass just `-R` (as
457−in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer,
458−it should work out of the box.
440+Если вы хотите все же его включить, вы можете добавить флаг `-R`.
441+Для `less` новее чем 530, оно должно работать из коробки.
459442
460−### Dark mode
443+### Темная тема
461444
462−If you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different
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_.
445+Если вы используете темный режим в macOS, возможно вы захотите чтобы `bat` использовал другую тему, основанную на теме вашей ОС. Следующий сниппет использует тему `default`, когда у вас включен темный режим, и тему `GitHub`, когда включен светлый.
465446
466447```bash
467448alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"