Some of the cool vim tricks and tips
Some of the cool vim tricks and tips I use vim everyday. So much that even to write notes I use vim! Here are some of the awesome tricks I have come across: 1. Suppose you have opened a file for which you dont have permission. While saving it will say " E212: Cant open file for writing ". Now instead of saving this temporarily in another file and then saving in this file, you can do this: :w !sudo tee % 2. You can edit binary files like in hexedit :%!xxd 3. Easy diff between two files. Say there are two files a and b. To find the diff of a with respect to b :vert diffs b 4. See command history q: 5. Execute command while still in vim. :! <command> Here I am compiling and running cpp file without closing it. 6. Autocomplete whatever you are typing in insert mode based on the words you have typed before: Ctrl+n 7. Directory Listing without NERDTree :vsp %:h 8. Indenting code =<next position> For example,...