Skip to content

Instantly share code, notes, and snippets.

@PaulGuo
Last active September 27, 2015 07:57
Show Gist options
  • Save PaulGuo/1237244 to your computer and use it in GitHub Desktop.
Save PaulGuo/1237244 to your computer and use it in GitHub Desktop.
My Vimrc Details
""" MacVim Style For Gvim
if has("win32")
" Use CTRL-S for saving, also in Insert mode
noremap <C-S> :update<CR>
vnoremap <C-S> <C-C>:update<CR>
inoremap <C-S> <C-O>:update<CR>
" CTRL-Z is Undo
noremap <C-Z> u
inoremap <C-Z> <C-O>u
cnoremap <C-Z> <C-C>u
" CTRL-SHIFT-Z is Redo
noremap <C-S-Z> <C-R>
inoremap <C-S-Z> <C-O><C-R>
cnoremap <C-S-Z> <C-C><C-R>
" CTRL-A is Select all
noremap <C-A> gggH<C-O>G
inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
cnoremap <C-A> <C-C>gggH<C-O>G
" backspace in Visual mode deletes selection
vnoremap <BS> d
" CTRL-X and SHIFT-Del are Cut
vnoremap <C-X> "+x
vnoremap <S-Del> "+x
" CTRL-C and CTRL-Insert are Copy
vnoremap <C-C> "+y
vnoremap <C-Insert> "+y
" CTRL-V and SHIFT-Insert are Paste
map <C-V> "+gP
map <S-Insert> "+gP
cmap <C-V> <C-R>+
cmap <S-Insert> <C-R>+
endif
""" 语法提示
autocmd FileType css set dictionary=$VIM/vimfiles/dict/css.dict
autocmd FileType javascript set dictionary=$VIM/vimfiles/dict/javascript.dict
""" 界面
set guifont=Monaco:h11
set guioptions-=T
set ruler
set wildmenu
set guioptions+=b
if has("win32")
let $LANG='en_US'
set guifont=Courier_New:h10:cANSI
endif
""" 全局
set history=100
set backspace=eol,start,indent
set nowrap
set autoread
set hlsearch
""" 配色
""" colorscheme darkblue
colorscheme github
syntax enable
""" set background=dark
""" colorscheme solarized
""" 编码
set encoding=utf-8
set fileencodings=utf-8,latin-1,chinese
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
if has("win32")
set encoding=chinese
endif
""" 代码
syntax on
set number
set showmatch
set matchtime=2
set iskeyword+=_,$,@,%,#,-
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
set autoindent
set smartindent
set expandtab
set relativenumber
set cursorcolumn
set cursorline
""" highlight cursorcolumn guibg=#000065
""" highlight cursorline guibg=#000050
""" 插件
""" NERDTree
map <F4> :NERDTree
map <F5> :NERDTreeToggle<CR>
let mapleader=","
nmap t :NERDTreeToggle<CR>
""" Zen-Coding
let g:user_zen_expandabbr_key='<D-e>'
""" Snippets
filetype plugin on
ino <tab> <c-r>=TriggerSnippet()<cr>
snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
""" CtrlP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
""" 废弃
""" set expandtab
""" 代码高亮
nnoremap <F3> :set hlsearch!<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment