Useful snippets

    Jump to main component vim

    2025-12-15

    Vim/Neovim

    yank filename without extension to 'f'-registry

    :let @f = expand('%:t:r')<CR>
    

    search for "const [contents in 'f'-registry]"

    :execute '/const ' . @f<CR>:nohlsearch<CR>
    

    added together

    :let @f = expand('%:t:r')<CR>:execute '/const ' . @f<CR>:nohlsearch<CR>
    

    Ideavim

    Copy file name to + register and search for it. Do not execute immediately () as CopyFileName also includes the file extension

    :action CopyFileName<CR>/const <c-r>+
    

    Neovim

    2026-06-10

    • nvim --help
    • nvim --clean
    • nvim --startuptime time.txt
      --clean               "Factory defaults" (skip user config and plugins, shada)
      --startuptime <file>  Write startup timing messages to <file>
    

    Slow?

    Ting som folk har rapportert at kan være årsaken

    • treesitter highlight
    • lsp
    • indent lines
    • colorschemes - lsp-zero
    • CursorMoved/CursorMovedI autocommands (tror ikke jeg har noe av det?)