vim mappings – easy way to do things.
2014-01-22
142 words
1 min read
You can use vim mappings to make some of your editor tasks very simple. Here I am giving you just a example, but you could always let your imagination run wild.
:nmap ,b Oj0c$**hP
And what do we do here.
O – Add a new line
– Go to normal mode
j – go to newly added line
0 – Go to begining of line
c$ – Change till end of line
****
– Enter four stars h – go back one character.
P – Paste the last deleted line, which is what we deleted with c$.
This is just to show you how powerful, mappings can be. So, GO WILD with imagination.
Related articles
Related Articles:
- 2010/08/02 when you press f9 ‘paste’ is on , press f9 again and ‘paste’ is off, and so forth (works in insert-mode and command-mode)
- 2010/04/11 In (any) vi, add a keystroke to format the current paragraph.
- 2013/08/28 vim maps – simple commands to do stuff.
- 2013/05/15 Vim – Why and where am I getting these errors from?
- 2012/08/06 vim mappings for multiple files.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.