How do I register custom filetype detection rules in Neovim using Lua without editing filetype.vim?
vim.filetype.add()
vim.
vim.filetype.add()
vim.
:set scroll=10
The scroll option determines how many lines (scroll up) and (scroll down) move the viewport.
:set digraph
With :set digraph enabled, you can enter special characters in insert mode by typing the two-character digraph code followed by (backspace).
config #insert-mode #digraphs #unicode #special-characters #config
vim --startuptime /tmp/vim-startup.log +qall && sort -k2 -rn /tmp/vim-startup.log | head -20
When Vim starts slowly, the --startuptime flag writes a timestamped log of every script and plugin loaded during initialization.
json_encode()
Vim 8.
glob()
The glob() built-in function expands a wildcard pattern into a list of matching filesystem paths, entirely within Vimscript.
<SID>
(Script ID) is a Vimscript token that expands to a unique, per-script prefix at runtime.
:<C-u>MyCommand<CR>
When writing nnoremap or vnoremap mappings that call Ex commands, Vim may silently prepend a count or a visual range (') to your command before it runs.
matchadd('Group', 'pattern', priority)
matchadd() accepts an optional third argument: a priority integer that controls which match wins when two patterns cover the same text.
:echo synIDattr(synID(line('.'),col('.'),1),'name')
When customizing a colorscheme or debugging unexpected colors, you need to know exactly which highlight group is coloring the text under your cursor.
vim.opt
Neovim's vim.
:set verbosefile=/tmp/vim.log verbose=9
Vim's verbosefile option redirects all verbose tracing output to a file on disk instead of printing it to the screen.
:set signcolumn=number
Setting signcolumn=number tells Neovim to display signs (diagnostics, git hunks, breakpoints) inside the line number column instead of adding a dedicated extra
vim.iter()
vim.
<Cmd>
The pseudo-key in Neovim allows a mapping to execute an Ex command directly, without going through command-line mode.
:set nomore
When a Vim command produces output that exceeds the terminal height, Vim pauses and displays a -- More -- prompt, requiring you to press a key to continue.
v:event
The v:event dictionary is populated inside certain autocommand callbacks with data specific to that event.
b: w: t: s:
Vimscript variables are prefixed with a one-letter scope identifier followed by a colon.
pumvisible()
The pumvisible() function returns 1 when the insert-mode completion popup menu (pum) is visible, and 0 otherwise.
:set diffopt+=algorithm:patience
Vim's default diff algorithm (Myers) can produce noisy diffs when working with code — it sometimes matches unrelated lines containing common tokens like {, },