Upgrade to Pro — share decks privately, control downloads, hide ads and more …

vim

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for jiangbo jiangbo
August 17, 2012

 vim

Avatar for jiangbo

jiangbo

August 17, 2012
Tweet

More Decks by jiangbo

Other Decks in Programming

Transcript

  1. Open • vim /path/to/file • :e /path/to/file • :tabe /path/to/file

    (open file in new tab) • :vsplit /path/to/file • :split /path/to/file Friday, August 17, 12
  2. Edit • <i> <I> == insert • <a> <A> ==

    append • <d> <dd> <D> == delete • <o> <O> == insert new line • <y> <yy> <Y> == copy • <p> == paste Friday, August 17, 12
  3. Move <h>,<j>,<k>,<l> == ←,↓,↑,➞ <w>== jump to next word <^>

    == first character <$> == last character <NG> == jump to N line <gg> <G> == jump last line <gt> <gT> == switch to next tab Friday, August 17, 12
  4. Quit • :q • :q! • :wq • :wq! •

    :qa Friday, August 17, 12
  5. More <C-n> == auto complete(current doc) <C-x><C-o> == auto complete(syntax)

    <C-=> == auto indent <C-v> == block operate <j> == join :read == read cmd input Friday, August 17, 12
  6. Macro <qa> == record a macro with name ‘a’ <@a>

    == replay macro with name ‘a’ Friday, August 17, 12
  7. .vimrc set nocompatible set shiftwidth=4 set softtabstop=4 set number syntax

    on filetype plugin on filetype plugin indent on set autoread set showcmd set ruler set incsearch set hlsearch :map <F5> i{<Esc>ea}<Esc> :map \p i(<Esc>ea)<Esc> :map <C-f> :%s/ set fileencodings=ucs-bom,utf-8,gbk,cp936,gb18030,big5,euc-jp,euc-kr,latin1 set cursorline highlight Cursorline guibg=lightblue ctermbg=lightgray set cursorcolumn set guifont=Menlo\ Regular:h12 set guioptions-=T autocmd FileType javascript set ai sw=4 sts=4 autocmd FileType javascript set syntax=jquery autocmd FileType javascript set fileencoding=GBK Friday, August 17, 12
  8. Something else • screen/tmux • multitail • ttyrec • $

    python -m SimpleHTTPServer • time Friday, August 17, 12