Skip to content

Instantly share code, notes, and snippets.

@FrankFang
Forked from Hyvi/.vimrc
Created September 19, 2012 04:12
Show Gist options
  • Save FrankFang/3747651 to your computer and use it in GitHub Desktop.
Save FrankFang/3747651 to your computer and use it in GitHub Desktop.
vim配置
nmap <F2> a<C-R>=strftime("%c")<CR><Esc>
"http://stackoverflow.com/questions/69998/tabs-and-spaces-in-vim
set tabstop=4
set shiftwidth=4
set expandtab
call pathogen#infect()
syntax on
filetype plugin indent on
set nu
let g:JSLintHighlightErrorLine = 0
" system clipboard http://vim.wikia.com/wiki/Accessing_the_system_clipboard
"copy
vmap <F7> "+ygv"zy`>
"paste (Shift-F7 to paste after normal cursor, Ctrl-F7 to paste over visual selection)
nmap <F7> "zgP
nmap <S-F7> "zgp
imap <F7> <C-r><C-o>z
vmap <C-F7> "zp`]
cmap <F7> <C-r><C-o>z
"copy register
autocmd FocusGained * let @z=@+
" 备份文件路径 http://stackoverflow.com/questions/607435/why-does-vim-save-files-with-a-extension
set backupdir=F:/vimtmp
set directory=F:/vimtm
let g:NERDTreeHighlightCursorline = 0
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
" http://vim.wikia.com/wiki/Switch_between_Vim_window_splits_easily
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
" http://vim.wikia.com/wiki/Alternative_tab_navigation
" tab navigation like firefox
nmap th :tabfirst<CR>
nmap tj :tabnext<CR>
"map tk :tabprevious<CR>
nmap tl :tablast<CR>
nmap tk <Esc>:tabprevious<CR>
"imap tj <Esc>:tabnext<CR>i
nmap <C-t> :tabnew<CR>
imap <C-t> <Esc>:tabnew<CR>
nmap ff :s/>\s*</>\r</g<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment