VIM-1.6 More VIM Shortcuts and Tips


Support fuzicast.com by clicking on youtube ads and make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.

facebook: facebook.com/fuzicast
twitter: @fuzicast
youtube: youtube.com/yuejdesigner85

:v/^Binary/d – delete all lines that does not start with Binary
ctrl+w gf with cursor on a filename will open that file in a new tab
gf with cursor on a filename will close current file and open that file
press * with cursor on a word will search for that word in file
vim -p file1 file2 file3 file4 # opens these files in tabs
:tabonly – closes all other tabs except current one
vimdiff – when you press ‘do’, obtain any differences from the other window. ‘dp’ will put any differences to the other window
:sort u – sort unique in vim
:sort – regular sort in vim
vim scp://username@host/PATH – open remote files
ctrl+p – autocomplete
:’t,. !awk ‘{print $3 ” ” $2 ” ” $1}’ – execute awk on current opening file
:Explore – execute, delete, rename file system easily with vim
:earlier 2h – undo up to 2hours
:later 2h – redo up to 2hours
:set spell – turn on spell check for strings within quotes
:set nospell
shift + k – with cursor on a command, press that and see man page
!% – will execute current script

VIM-1.5 VIM Plugin Samples and Installation


Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: http://www.facebook.com/fuzicast
twitter: @fuzicast

Perl-Support – http://www.vim.org/scripts/script.php?script_id=556
\isu – inserts a subroutine
\cfu – inserts subroutine header
\cfr – comment frame
\rr – save and quit and run
\cc – toggles comment current line

SnipMate – http://www.vim.org/scripts/script.php?script_id=2540
snipmate cannot use set paste, comment it out

tComment – http://www.vim.org/scripts/script.php?script_id=1173
highlight + gc – toggles multiple lines
gcc – toggles single line

MRU – http://www.vim.org/scripts/script.php?script_id=521
:MRU – to see most recently used files

FuzzyFinder – http://www.vim.org/scripts/script.php?script_id=1984
Pre-req: L9 vim plugin – http://www.vim.org/scripts/script.php?script_id=3252
:FufFile – quickly find the file you want

NERDTree – http://www.vim.org/scripts/script.php?script_id=1658
:NERDTree – opens up file tree
enable mouse=a to be able to click around
? for more shortcuts, ? again to return
t – open in new tab, go to new tab
T – open in new tab
i – open in split screen
enter or o to expand directory
:Bookmark bookmarkName
B toggles list of bookmarks
q – to quit NERDTree

Matrix – http://www.vim.org/scripts/script.php?script_id=1189
:Matrix

Useful Resources:
http://net.tutsplus.com/sessions/vim-essential-plugins/
http://lug.fh-swf.de/vim/vim-perl/screenshots-en.html

https://vimeo.com/3535418

VIM-1.4 VIM Configuration and Color Scheme


Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: http://www.facebook.com/fuzicast
twitter: @fuzicast

You can download VIM-1.4.tar from http://www.2shared.com/file/ma0cGnZx/vim-14.html

filetype plugin on
set t_Co=256
colorscheme mustang
syntax on
set hlsearch
set incsearch
set mouse=a
set wildmenu
set list
set unlist
set number
set autoindent
set ts=4
set ignorecase
set title
set nowrap
set scrolloff=5
set paste
set cursorline
set shiftwidth=4
map :tabnew
map gt
map :PREVCOLOR
map :NEXTCOLOR

VIM-1.3 More VIM Editor Commands Tutorial


Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: http://www.facebook.com/fuzicast
twitter: @fuzicast

:tabdo %s/pattern/replacement/g – execute commands on all open tabs
:command1 | command2 – run multiple commands
:help
vim file1 file2 file3 – open multiple files
:n – go to next file
:only – when in split screen, close all other screens and keep current screen
. – repeats last action
:g/pattern/ – returns you all the lines that contains the pattern
:g/pattern/d – delete all lines that contains this pattern
:v/pattern/ – return all lines that don’t contain this pattern
:v/pattern/d – delete all lines that don’t contain this pattern
ctrl + o – the same as ‘.
: + up/down key – view history of : commands
/ + up/down key – view history of / searches
ctrl + w + (hyphen) – maximize the windows
ctrl + w + = – restore original windows
== – aligns line to same position as previous line
select block; :fold – compress lines, zo to expand, zc to compress again
:%s/pattern/replacement/gc – search and replace
ctrl + v ctrl + m – get special characters
:%d
:diffget – sync current screen with the other screen
]c – get to next diff

Collection of Color Schemes for VIM Editor (256-color compatible)


Awesome colors, Awesome schemes

http://hcalves.deviantart.com/art/Mustang-Vim-Colorscheme-98974484

http://www.vim.org/scripts/script.php?script_id=2140

http://www.vim.org/scripts/script.php?script_id=3520

http://gergap.wordpress.com/2009/06/01/new-vim-color-scheme-wombat256/

http://www.h3rald.com/articles/herald-vim-color-scheme/

http://juan.boxfi.com/vim-color-schemes/

http://noahfrederick.com/vim-color-scheme-hemisu/

Planned Videos In Production


VIM-1.3 More VIM Commands
I will introduce the rest of VIM commands, vimdiff commands and we will be done with VIM commands. There are a lot more commands out there, but I only want to go through the most practical ones. 

VIM-1.4 VIM Configurations and Color Schemes
Learn how to configure VIM to use it like a charm, such as autoindent, tab size, search highlight and etc. Then we will move on to color schemes where you can customize your VIM editor to have your favorite theme and specific language syntax highlights. 

VIM-1.5 Installing VIM Plugins
I will demonstrate how to install Java plugins and Perl plugins. You will find it enjoyable to code with all the plugins available. Make sure to try out more plugins yourself.

And that concludes VIM series. Next I will continue on UNIX videos, covering hundreds of commands and shell script syntax. So stay tuned! :)

VIM-1.2 VIM Commands


Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: http://www.facebook.com/fuzicast
twitter: @fuzicast

:x – save and quit
ctrl + z – bring editor to background
fg – bring back editor
~ – change character case
U – undo all the changes to that line
vi” – select content between quotes for that line
ctrl+v, select multiple “print” statements on multiple rows, press s, then type “say” statement, press esc and enter
shift + v – highlight whole line, move up and down to select multiple lines
y – copy highlighted lines
p – paste whatever copied from y
yy – copy whole line
select multiple lines and search replace
>> – shift right
<< – shift left
V + – shift multiple lines
V + d – delete multiple lines
:sav filename – save as another file
A – append at the end of line
:r filename – reads in another file and appended to the cursor
‘. – go back to the last edit position
view – read-only mode
:!command – execute unix command inside vim
:r! command – read in output from command
w – go to next word
b – go to previous word
w filename – writes highlighted lines to a file
:set nu – view line numbers
dw – delete characters up to empty space
cw – same as dw, but enters insert mode
:e! filename.txt – discard current file and changes, start editing new file
vimdiff file1 file2 – check differences between 2 files
ctrl +w twice – get to next split screen
:sp filename – split screen on filename
:vsp filename – vertical split screen on filename
:tabnew – open new tab
:tabm3 – rearranging your tab
gt – go to next tab