vimrc

13
.Vimrc Ted

Upload: ted-shiu

Post on 11-May-2015

64 views

Category:

Software


1 download

DESCRIPTION

linux vimrc setting

TRANSCRIPT

Page 1: Vimrc

.VimrcTed

Page 2: Vimrc

Introduction• Linux user 必學

• 開發效率快

• 練打字速度

• plug in 不好裝

• 看起來⽐比較專業

Page 3: Vimrc

Topic

簡介⼀一下 vimrc 的⼀一些基本設定

Page 4: Vimrc

Encodeset encoding=utf-8!

set fileencodings=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936,utf-16,big5,euc-jp,latin1

Page 5: Vimrc

Highlightsyntax on!

set cursorline!

set colorcolumn=80!

set hlsearch!

set incsearch!

set showmatch

Page 6: Vimrc

Colorschemeset background=dark!

colorscheme torte!

How to use it?!

Find colorscheme.vim!

Put it in ~/.vim/colors/!

http://cocopon.me/app/vim-color-gallery/

Page 7: Vimrc

Indentset softtabstop=4!

set shiftwidth=4!

set expandtab!

set smartindent!

set autoindent!

set foldmethod=indent!

set foldnestmax=3

Page 8: Vimrc

Status lineset cmdheight=1!

set ruler!

set laststatus=2!

set statusline=%<[%F]\ %m%=\ %h%r\ %-19([%p%%]\ %3l,%02c%03V%)%y!

highlight StatusLine term=bold,reverse cterm=bold,reverse ctermfg=8

Page 9: Vimrc

Otherset number!

set paste!

set nowrap!

set history=50!

set ic!

set autoread

Page 10: Vimrc

Keyboard Number Areaimap <Esc>Oq 1!

imap <Esc>Or 2!

imap <Esc>Os 3!

imap <Esc>Ot 4!

imap <Esc>Ou 5!

imap <Esc>Ov 6!

imap <Esc>Ow 7!

imap <Esc>Ox 8!

imap <Esc>Oy 9!

imap <Esc>Op 0!

imap <Esc>On .!

imap <Esc>OQ /!

imap <Esc>OR *!

imap <Esc>Ol +!

imap <Esc>OS -

Page 11: Vimrc

open file show last positionif has("autocmd")!

autocmd BufRead *.txt set tw=78!

autocmd BufReadPost *!

\ if line("'\"") > 0 && line ("'\"") <= line("$") |!

\ exe "normal g'\"" |!

\ endif!

endif

Page 12: Vimrc

Mapping Commandcom! -bang W :w!

com! -bang Wq :wq!

com! -bang Wqa :wqa!

com! -bang WQ :wq!

com! -bang WQa :wqa!

com! -bang WQA :wqa!

com! -bang Q :q!

com! -bang Qa :qa

Page 13: Vimrc

Refer

• http://tedshd.logdown.com/posts/192578-vim-colorscheme

• https://github.com/tedshd/vimrc