New answers tagged


There is no straightforward way to tell vim to land the cursor at a particular place in the cmdline during a map, but there are a number of workarounds. Direct positioning autocmd FileType cpp nnoremap <F4> :RunWithFile ~/Downloads/ > output.txt && cat output.txt<c-r>=setcmdpos(getcmdpos()-31)[1]<cr> You can use setcmdpos() to ...


Normally prefer :h ftplugin over autocmd FileType. If still want autocmd, at least, put it into augroup. Use :h map-<buffer> to define a local mapping. Otherwise it will affect all other buffers/windows too. Typing foo[cursor]bar is as simple as bar<C-B>foo.


Yes, although sentence detection is occasionally not correct (for me): see the motions ( and ).

Top 50 recent answers are included