VimL is full of features, but sometimes it is hard to find which function or command will do the job you want.
If you ever searched the web for vim script ex command output in a var
,
you surely have had results talking about :redir
. This is ok, but
there is a more elegant solution for this particular problem.
This (neo)vim help page collects vim script snippets, whose some were hard to find. You may already know some of them, and I hope you will gladly discover the others.
Straightforward :
:help vimscript-tricks
Don't forget to run :
:helptags doc
to be able to use the inline help.
Simply add this line after packager#init()
to your initialisation file :
call packager#add('chimay/vimscript-tricks', { 'type' : 'start' })
and run :PackagerInstall
(see the
vim-packager readme).
Simply add this line after minpac#init()
to your initialisation file :
call minpac#add('chimay/vimscript-tricks', { 'type' : 'start' })
and run :PackUpdate
(see the
minpac readme).
The syntax should be similar with other git oriented plugin managers :
Plug 'chimay/vimscript-tricks'
and run :PlugInstall
to install.
You can clone the repository somewhere in your runtime-search-path
. You
can get a minimal version by asking a shallow clone (depth 1) and
filtering out the screenshots blobs :
mkdir -p ~/.local/share/nvim/site/pack/foo/start
cd ~/.local/share/nvim/site/pack/foo/start
git clone --depth 1 --filter=blob:none https://github.com/chimay/vimscript-tricks