How do I transform register contents using Vimscript functions?
:put =map(getreg('a', 1, 1), 'toupper(v:val)')
By using getreg() with the list flag and applying map(), you can transform register contents with any Vimscript function before pasting.
Search Vim Tricks
Searching...:put =map(getreg('a', 1, 1), 'toupper(v:val)')
By using getreg() with the list flag and applying map(), you can transform register contents with any Vimscript function before pasting.
<C-r><C-r>a
In insert mode, a pastes register a but processes the text as if typed, which can trigger abbreviations and mappings.
:Trouble diagnostics
trouble.
:WhichKey
which-key.
:let @a = ''
Registers persist their contents throughout your Vim session and even across sessions if viminfo or shada is enabled.
:call setreg('a', @a, 'l')
Registers in Vim have a type — characterwise, linewise, or blockwise — that affects how their contents are pasted.
:Gitsigns preview_hunk
gitsigns.
:lua require('harpoon.ui').toggle_quick_menu()
Harpoon by ThePrimeagen lets you mark a small set of files (typically 4-6) and instantly switch between them with dedicated keybindings.
:Lazy
lazy.
:lua require('mini.surround').setup()
mini.
:TSTextobjectSelect @function.outer
The nvim-treesitter-textobjects plugin provides syntax-aware text objects powered by Treesitter's AST parsing.
:call matchadd('Search', 'pattern')
The matchadd() function lets you add persistent highlights to patterns without affecting the search register.
:lua require('conform').format()
conform.
:lua require'dap'.toggle_breakpoint()
The nvim-dap plugin implements the Debug Adapter Protocol in Neovim, providing a full debugging experience with breakpoints, step-through execution, variable in
:Git log --oneline --graph
Tim Pope's vim-fugitive provides a complete Git interface inside Vim.
zz / zt / zb
Vim's z scroll commands reposition the screen relative to the cursor without moving the cursor itself.
navigation #navigation #scrolling #viewport #cursor-position
( ) { } [[ ]]
Vim provides structural navigation motions that move by sentences, paragraphs, and sections.
:pop or <C-t>
When you jump to a tag definition with , Vim pushes your location onto a tag stack.
w vs W, b vs B, e vs E
Vim distinguishes between "words" (sequences of keyword characters) and "WORDS" (sequences of non-blank characters).
gj and gk
When wrap is enabled, long lines wrap across multiple screen lines.