Jump to main component vim
2025-12-15Vim/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 (
:action CopyFileName<CR>/const <c-r>+