One of the common problems when working with plain text is duplicate lines. They are bad and in most of the cases we would like to get rid of them. Here I present to you the simple solution(s) to address this problem
Yes, you read it correctly. 5 minutes
The first thing that may come to your mind when I say language of vim is Vim Script.No that's not what I am talking about.I am talking about the patterns of keystrokes that recur over and over through your use of vim. Construct A, Single alphabets These are most common and most basic of all constructs ,It serves as main building block in vocabulary of language you are about to learn.
01 Leader Vim's default mapping for leader is /. Most peoples remap it to , ,which I personally think is not a good choice. Remap it to either CAPSLOCK or <SPACE> key, and find out which works better for you.For me CAPSLOCK didn't workout well. let mapleader=" " # or noremap <Space> <Leader> 02 ESCAPE In modal editor like VIM, we constantly need to switch modes.
Unnamed " Vim uses unnamed register as the default register. It is often used for all delete, change, copy or cut operations. It also points to the last used register unless last used register is Black hole register. Whenever you use y/Y or p/P commands , you are using unnamed register.It is still surprising to see name for an unnamed register.It can be explicitly accessed using "" in normal mode or " in insert mode Numbered 0 to 9 Vim gradually fills up these registers as you keep using delete and copy(yank) commands.