dsp-site/wiki/Vim/Нумерация строк.adoc

34 lines
930 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

= Vim: нумерация строк
:category: Vim
:tags: Vim, команды Vim,
Для переключения режимов отображения слева столбца нумерации строк можно
добавить в `$HOME/.vimrc` следующий код:
[source,vim]
----
" Нумерация строк включена
set number
" Нумерация строк абсолютная
set nornu
function! ChangeNumbering()
if &number
if &rnu
set nornu
else
set nonumber
endif
else
set number
set rnu
endif
endfunc
map <LocalLeader># <Esc>:call ChangeNumbering()<CR>
----
В результате по команде `<LocalLeader>#` будет осуществляться
циклическое переключение между абсолютной, относительной нумерацией
строк и отключением нумерации.