Durga Swaroop
  • Member for 6 years, 2 months
  • Last seen more than a month ago
How to map a shortcut for saving the file
Accepted answer
14 votes

First of all stop using :w to save. Use :update instead. :update writes the file to disk only when there are changes. So, it could be really helpful especially if the file is huge. Now to map <C-S&...

View answer
Swap two shortcuts
Accepted answer
9 votes

Yes. You can change just about anything you want to change in Vim. Just do nnoremap <C-f> <C-b> nnoremap <C-b> <C-f> Add those two mappings in your vimrc file and you've ...

View answer
What does <Shift-v><Shift-j> do in Vim
Accepted answer
8 votes

I am guessing you were holding the Shift key even while pressing j. Because V + j alone would not have concatenated the lines. V is for selecting the entire line. j moves the selection down. So, ...

View answer
Substitute second occurence on line
6 votes

You can use a macro as @Meshpi already suggested. But, this is another way you can accomplish the same thing. 02/temp^Mdwx+ 0 - Go to the starting of a line 2/temp - Search for temp and go to ...

View answer
How do I search google from vim?
2 votes

As others have pointed out, Searching from Vim is not something one would want to do every time, but I do understand that there are some situations where you just want to search for a particular word ...

View answer
Vim wrap only current line
1 votes

I don't think setting the line-wrapping for just a single line is possible. But, there is a small work around that you can use to see the entire content of the current line. First set the text width ...

View answer
Is there some way to echo from terminal into new vim buffer
1 votes

If you want to just get the input from a terminal command, then just do the following ls | vim - Same for any other command output you want to pipe to Vim. If you want to read the output you can use ...

View answer
Re-indenting badly indented code
1 votes

There are already a lot of things covered in the existing answers. I just like to add one mapping that I use very often for indentation. nnoremap <Leader>i mzgg=G`z I have seen some vimrc ...

View answer
vim delete parenthesis
0 votes

A few solutions have already been mentioned and I would like to add one more that might help. If there is a blank line after };, which I am assuming is not rare considering that its the end of a ...

View answer
How can I copy text to the system clipboard from Vim?
-1 votes

Every other answer has covered all the important things about the registers. I would like to add one more thing that I use. There is a way in Vim to directly copy the visually selected text in to the ...

View answer