custom placeholders solution - 01-12-20

This little bit of magic I believe I picked up from watching a Luke Smith video. The point is to leave placeholders in the form of the text “<++>” in your code/writing then quickly snap to and fill them in later.

" placeholder magic
nnoremap <Space><Space> <Esc>/<++<CR>"_c4l
nnoremap <Space>n <Esc>l/<++><CR>h
" always fill p reg with <++>
:autocmd VimEnter * :call setreg('p', '<++>')
  1. Thanks to the vim enter hook the magic placeholder text is always in my p register so its easy to put with <"><p>
  2. Then to jump to the next placeholder and immediately start editing it with a simple <Space><Space>
asciicast

placeholders demo

source:

\- [ vim ]