New answers tagged

4

To find aid separated from country by at most 3 words, choose one: /aid\(\W\+\w\+\)\{,3}\W\+country /\vaid(\W+\w+){,3}\W+country If words may be separated only by single space characters, it can be further simplified to /\vaid( \w+){,3} country Try it on this minimal, reproducible example: Now is to the aid of their country. Now aid of come their the ...


2

Unlike Maxin's answer, I'd recommend to use a ftplugin. They're really made to store the definition of filetype related mappings, commands, abbreviations, options, variables... While we shall use <buffer> with mappings and abbreviations, it's -b with commands. Now the problem is that you want to implement is quite complex. Vim main tool is regex. And ...


1

You cannot have a command started with lowercase letter, use :Stripdbg or :StripDbg To define a command available only in specific filetype you can define it in autocommand event with -buffer parameter: augroup cpp_group | au! au FileType cpp command! -buffer StripDbg call StripDbg() augroup end You have to implement StripDbg() function to do actual ...


Top 50 recent answers are included