Setup:
$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
plugin | |
naming convention: name_of_plugin.vim | |
these files are sourced for all file types | |
doc | |
naming convention: name_of_plugin.txt | |
these files document the functionality of a plugin | |
color | |
naming convention: name_of_colorscheme.vim |
In patch 8.0.1206, Vim has added 2 new events: CmdlineEnter
and CmdlineLeave
. They are fired every time you enter or leave a command line.
There are 7 types of command lines, including one for normal Ex commands, debug mode commands, search commands
(with a distinction between forward and backward), expressions, and inputs (more info at :h cmdwin-char
).
Each of them is associated with a symbol among this set : > / ? = @ -
.
You can limit the effect of an autocmd listening to CmdlineEnter
/ CmdlineLeave
to one or several types of command lines by:
As a Vim user, you might prefer the new vim9script over the legacy script, and wish to use it in the command line. While there's no direct option to switch the command line to parse vim9script, you can execute vim9script commands by simply prepending each command with vim9
.
However, remember that execution occurs in the global context, not the script-local context. This means you need to declare variables with the g:
prefix, like g:foo = 'bar'
.
Common commands such as visual mode select ('<,'>
), shell commands (!
), substitution (s//
), and global (g//
) work as expected, even with vim9
prepended.
" Adapted from https://github.com/drmikehenry/vimfiles/blob/e5c369dadde340ead7438b0c4937c3f470acf524/vimrc#L3239 | |
" | |
" With --extra=+f in ~/.ctags respectively --extras=+f in | |
" ~/.config/ctags/default.ctags, filenames are tags, too, so | |
" the following mappings will work when a file isn't in the path. | |
" | |
" For automatic (C)tags generation, see either | |
" https://tbaggery.com or https://bolt80.com/gutentags/ | |
nnoremap <silent> gf :<c-u>call <sid>gf("gf")<cr> |