Deleting HTML tags with vim
Text objects are your friends… dat : “delete around tag” dit : “delete inside tag” There are also similar operations for changing the text (cat and cit) and selecting it visually (vat and vit). Have fun!
Text objects are your friends… dat : “delete around tag” dit : “delete inside tag” There are also similar operations for changing the text (cat and cit) and selecting it visually (vat and vit). Have fun!
Vim includes a man page viewer, :Man, in its runtime files. Put this line in your vimrc: runtime! ftplugin/man.vim Now you can read syntax-highlighted man pages inside Vim by running :Man. For example: :Man 3 printf Even better, you can just place your cursor on a word in the buffer and press <Leader>K (\K) to … Read more
Use /^.\{,25}$/ to find lines shorter than 25 characters.
I completed @escrafford mapping with insert mode’s ones: ” shift+arrow selection nmap <S-Up> v<Up> nmap <S-Down> v<Down> nmap <S-Left> v<Left> nmap <S-Right> v<Right> vmap <S-Up> <Up> vmap <S-Down> <Down> vmap <S-Left> <Left> vmap <S-Right> <Right> imap <S-Up> <Esc>v<Up> imap <S-Down> <Esc>v<Down> imap <S-Left> <Esc>v<Left> imap <S-Right> <Esc>v<Right> Also mapping usual copy/cut/paste like this you can … Read more
Next file: :n Previous file: :p, :N or :prev depending on which vi implementation you’re using. Here’s a typical cheat sheet which has a section “Files” on this topic. http://www.lagmonster.org/docs/vi2.html
I’d use :%s/^/ / You could also specify a range of lines :10,15s/^/ / Or a relative range :.,+5s/^/ / Or use regular expressions for the locations :/A/,/D/>. For copying code to paste on SO, I usually use sed from the terminal sed ‘s/^/ /’ filename Shortcut I just learned a new trick for this. … Read more
After @joe’s answer, Jared Parsons created the great VsVim. It’s been featured on Visual Studio Gallery. It’s a ready extension package. I downloaded it, ran the file and it worked out of the box. It’s free, too.
vi supports having multiple files available for editing. :n goes to the next file, :N goes to the previous. Use :h arglist for more information.
I was finding the same answer, try :set paste this may help
You don’t need a global command for this. The substitute command in by itself will suffice by adding a wildcard and adding an end-of-line. example %s/.*text.*\n//gc