Skip to content

aliilgimdemirel/Lcthw

Repository files navigation

Lcthw / LCTHW

Learn C the Hard way

VI Cheat sheet

In vim documentation CTRL is refered as ^, so will.

  • mapping a key for example;
     :map <C-A-PageUp> <C-W><C-W>
    
    If I were to add PageDn version aswell I'll put this to my vimrc !! Yaay.
  • zz Scrolls current line to the middle of your screen.
  • AUTO FILL !!! ^P or ^N. For more; this is quite nice
Tabs and Management
:split filename - split window horizontally and load filename
:vsplit file - vertical split and open file
^w up arrow - move cursor up a window
^w ^w - move cursor to another window (cycle)
^w _ - maximize current window vertically
^w | - maximize current window horizontally
^w = - make all equal size
^w H - resize cur Window to take all of the Left side
^w J - resize cur Window to take all of the Top side
^w K - resize cur Window to take all of the Bottom side
^w L - resize cur Window to take all of the Right side
^w ^7 - maximize cur Window in its current pane vertically
:sview file - same as split, but readonly
:close - close current window
TODO ADD tabs !! - TAAABS TODO
:tabdo {cmd} - does the **cmd** for all windows inside the current tab (e.g., s/join/merge/ge. e here is for ignoring errors if join is not found in a file perse.)
^W [N] - Decrease current window height by N (default 1)
^W [N] + Increase current window height by N (default 1)
^W [N] < Decrease current window width by N (default 1)
^W [N] > Increase current window width by N (default 1)
^W [N] > Increase current window width by N (default 1)
Session Save/Load
:mksession header-files-work.vim Saves the session
$ vim -S header-files-work.vim Loads it from terminal
:source header-files-work.vim Loads it from inside VI