Introduction
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.
Usage
Straightforward :
:help vimscript-tricksDon't forget to run :
:helptags docto be able to use the inline help.
Installation
Using vim-packager
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).
Using minpac
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).
Using vim-plug
The syntax should be similar with other git oriented plugin managers :
Plug 'chimay/vimscript-tricks'and run :PlugInstall to install.
Cloning the repo in a pack-start directory
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
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
