Vim is Vi(Improve) editor. The learning curve is insane. Newly installed Vim is useless and you have to install and configure plugins. it is because its flexibility. My personal choice to vim is It got almost everything I need out of the box.

Here are the vim command I learn over the weeks and I believe this list will keep growing.

Certain commands are prefixed with a key, which maps to \ by default. You can, for example, use let mapleader = “,” to change this to a comma. If you want this to be in effect for uses of in the .vimrc file, make sure to define this in ~/.vimrc.before

Install additional plugin

mkdir -p ~/.janus && cd ~/.janus && git clone URL

search and replace everything in an open file


Turn on/off line number

:set nonumber or :set number

Show hidden files/folders in vim


Show/Hide Nerdtree


Refresh Nerdtree


Create a new file in Vim/NerdTree, navigate to NerdTree


Change root directory


To navigate to different window


Quick file search with live search

  • Press <c-f> and <c-b> to cycle between modes.
  • Press fn+f5 to purge the cache

Linux command line without leaving vim

:!Command line

List file buffer


Next buffer

:bn or :b#buffernumber

Next buffer


previous buffer


Resizing Vim split panel


Split a vertical panel


Split a horizonal panel


Make current window panel full screen


Fix whiteSpace in vim


In normal mode, type i and it will open a vertical split new panel


Automatically adding php namespacing(

You have to install ctags

brew install ctags

Run the command below in laravel directory

ctags -R ./*

To use the autonamespace


Commenting code using NerdCommenter

c #multiple line in Virtual mode
cc #one line

Snippet can be found here

Aligning text

:tab /=

Go to line