- 论坛徽章:
- 0
|
我的,比较简单,个人觉得很好用,注释都加上了
- if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
- set fileencodings=utf-8,latin1
- endif
- set nocompatible " Use Vim defaults (much better!)
- set bs=2 " allow backspacing over everything in insert mode
- set ai " always set autoindenting on
- "set backup " keep a backup file
- set viminfo='20,\"50 " read/write a .viminfo file, don't store more
- " than 50 lines of registers
- set history=50 " keep 50 lines of command line history
- set ruler " show the cursor position all the time
- set number " show the number of lines
- set showcmd " show the cmd
- set whichwrap=b,s,<,> " can use Backspace Space <Left> <Right> wrap
- "set mouse=a " use mouse in terminal
- set helplang=cn " set the vim helpdoc language
- set noignorecase " set case not sensitivity
- vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc> " can paste in the VISUAL mode
- filetype plugin indent off
- " Only do this part when compiled with support for autocommands
- if has("autocmd")
- " In text files, always limit the width of text to 78 characters
- autocmd BufRead *.txt set tw=78
- " When editing a file, always jump to the last cursor position
- autocmd BufReadPost *
- \ if line("'\"") > 0 && line ("'\"") <= line("$") |
- \ exe "normal g'\"" |
- \ endif
- endif
- " Switch syntax highlighting on, when the terminal has colors
- " Also switch on highlighting the last used search pattern.
- if &t_Co > 2 || has("gui_running")
- syntax on
- set hlsearch
- endif
- if &term=="xterm"
- set t_Co=8
- set t_Sb=^[4%dm
- set t_Sf=^[3%dm
- endif
- " Open a file managers
- map <F7> <ESC>:vsplit<ENTER>:edit `pwd`<ENTER>i
- " Open Tlist
- map <F8> <ESC>:Tlist<ENTER>
- " Close Tlist width resize
- let Tlist_Inc_Winwidth=0
- " use Alt+; to add comment,like emacs
- autocmd filetype cpp,java map <Esc>; $a<tab><tab>//
- autocmd filetype cpp,java imap <Esc>; <End><tab><tab>//
- autocmd filetype c map <Esc>; $a<tab><tab>/* */<Esc>3hi
- autocmd filetype c imap <Esc>; <End><tab><tab>/* */<Left><Left><Left><Left>
- autocmd filetype sh map <Esc>; O#
复制代码 |
|