New answers tagged

3

This is due to an upgrade to 'incsearch'. Turning it off should do the trick. P.S.: you could map the key stroke instead: nnoremap <leader>cw :%s/<cword>/ But I prefer nnoremap <leader>cw :let @/=expand('<cword>')<CR>cgn which sets the search pattern, but doesn't highlight, and then uses the .-repeatable cgn command.


0

Note: I have tested the above process in vim(not it vscode extension). It didn't worked so the answer is for general vim. Using Regular expressions The solution to the first problem is to use "very magic" mode of regex. In very magic mode the characters except a-zA-Z0-9 and _ have a special meaning. You can enable very magic mode by putting \v in start ...


4

You can add a line break by using the atom \r in the replacement part of the :s command (while in the pattern part, you would need to use \n to match a line break). That allows to split your string using the following command: :s/,\ze \d\+=/&\r/g That is search for a comma (and end the match there), followed by a space, at least one number and a = and ...


2

You don't need %, as you already have another range ('<,'>) for your command s. So it must be simply '<,'>s/SomeStuff/stuff/gI.


0

No need for a plugin, just apply the substitution command: :%s/(\(\([^()]\|\n\)*\))/[\1]/g Notes Supports multiple matches per line: (aa) (bb) -> [aa] [bb] Supports multi-line content: (aa \n bb) -> [aa \n bb] Supports nested parenthesis: ((aa)) -> ([aa]) Doesn't change unmatched characters: a) (b) -> a) [b] However it needs to be applied ...


Top 50 recent answers are included