Update vim functions

master
Hektor Misplon 2022-05-11 00:56:13 +02:00
parent dd49fb4806
commit 4859fdb5a9
1 changed files with 11 additions and 2 deletions

13
.vimrc
View File

@ -30,14 +30,23 @@ set ar " Autoread
" Functions ____________________________ " Functions ____________________________
" Toggle line numbers " Toggle line numbers
fu! ToggleRnu() " toggle: no numbers - relative nummbers fu! ToggleLineNumbers()
if(&nu) | se nonu nornu | else | se nu rnu | endif set nu! rnu! " toggle: no numbers - relative nummbers
endfu endfu
" https://alok.github.io/2018/04/26/using-vim-s-conceal-to-make-languages-more-tolerable/ " https://alok.github.io/2018/04/26/using-vim-s-conceal-to-make-languages-more-tolerable/
fu! ToggleConceal() fu! ToggleConceal()
if (&cole == 0) | se cole =2 | else | set cole =0 | endif if (&cole == 0) | se cole =2 | else | set cole =0 | endif
endfu endfu
" Insert date
fu! Today()
:put =strftime('%d %b %Y')
endfu
" Add command line functions names
com! -nargs=0 Today :call Today()
com! -nargs=0 ToggleLineNumbers :call ToggleLineNumbers()
com! -nargs=0 ToggleConceal :call ToggleConceal() com! -nargs=0 ToggleConceal :call ToggleConceal()
" Keybindings " Keybindings