VIM v19-02-02
homepage documentation manual reference faq wiki
Image source: Willi Glenz - Screenshot vim
| lfd | activity | commands |
|---|---|---|
| 01 | learning vim | $ firefox vim-adventures.com & |
| 02 | learning vim | $ vimtutor |
| 03 | documentation | $ firefox file:///usr/share/doc/vim-doc/html/index.html & |
| 04 | documentation | $ man vim |
| 05 | documentation | :help user-manual |
| 06 | files | $ vim -O ~/.vimrc ~/.bashrc ^ww ^wr ^wc ^wq |
| 07 | files | $ vim ~/.bashrc ~/.bashrc :args :ls :next :previous :n :N :bn :bp |
| 08 | cursor | j ^n • k h l |
| 09 | cursor | zz z<enter> z- |
| 10 | window | :set nu nonu • relativenumber norelativenumber • hls nohls * • ruler noruler • linebreak nolinebreak |
| 11 | window | ^ws ^wv ^wr ^wc ^wq |
| 12 | window | gg G • ^g 50% • ^e ^y ^n • ^u ^d ^f ^b |
| 13 | editing | [InsertMode] ^n |
| 14 | abbreviate | :ab :abc :unab |
| 15 | folding | zf5j zo zc zd |
| 16 | undelete | u U ^r |
| 17 | visual | ^v |
| 99 | file | :wq |
:ab psvm public static void main(String[] args) {<CR>}<Esc>ko
:ab sysout System.out.println("");<Esc>2hi
EDITOR=/usr/bin/vim
VISUAL=$EDITOR
export EDITOR VISUAL
" GENERAL
syntax on
set number
set relativenumber
set ruler
set mouse=a
set hls
set background=dark
set encoding=utf8
" INDENT
set autoindent
" TABs
set tabstop=3
set softtabstop=3
set shiftwidth=3
set expandtab
" MAPs
nmap <leader>w :w!<cr>
map <F2> :echo 'Current time is ' . strftime('%c')<CR>
" ABBREVIATIONS
:ab psvm public static void main(String[] args) {<CR>}<Esc>ko
:ab sysout System.out.println("");<Esc>2hi
# apt-get install vim vim-doc vim-scripts
$ dpkg -L vim-doc
# update-alternatives --config editor
$ vim --version | less