In $VIMRUNTIME/ftplugin/vim.vim, some mappings are installed to move the cursor to the previous/next comment: Move around commentsnnoremap <silent><buffer> ] :call search('^\(\s*.*\n\)\@<!\(\s*\)', W)<CR>vnoremap <silent><buffer> ] :<C-U>exe normal! gv<Bar>call search('^\(\s*.*\n\)\@<!\(\s*\)', W)<CR>nnoremap <silent><buffer> [ :call search('\%(^\s*.*\n\)\%(^\s*\)\@!', bW)<CR>vnoremap <silent><buffer> [ :<C-U>exe normal! gv<Bar>call search('\%(^\s*.*\n\)\%(^\s*\)\@!', bW)<CR>They use the key sequences [ and ].Are there similar mappings for other filetypes, or can we modify these mappings so that they work not only in Vim files but in other filetypes (shell, python, )?
How to move around comments in any type of file?
key bindings;vimscript;cursor movement