mac:
vi /usr/share/vim/vimrc
linux:
vi /etc/vimrc
or
~/.vimrc
windows:
C:\Program Files (x86)\Vim\_vimrc
cygwin:
vi /etc/vimrc
set ai
set ts=4 sw=4
set ruler
set nonu
set hls
set incsearch
set smartindent
set wildmenu
set showcmd
set formatoptions=tcq
set fileformats=unix,dos
set t_Co=256
syntax on
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
colorscheme molokai "good color, need install
colorscheme pablo "mac
colorscheme desert "linux or windows
"google style
set ts=2 sw=2
set expandtab
" 记录上次编辑的位置
" Only do this part when compiled with support for autocommands
if has("autocmd")
augroup redhat
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
" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
" start with spec file template
autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
augroup END
endif
gvim:
winpos 235 235
set lines=25 columns=108
colo peachpuff
set nobackup
第一行为设置启动位置;
第二行为设置窗口大小,行X列;
第三行为设置本色方案;
nobackup不生成~文件
关闭ctrl + a全选
Vim\vim74\mswin.vim
" 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
"onoremap <C-A> <C-C>gggH<C-O>G
"snoremap <C-A> <C-C>gggH<C-O>G
"xnoremap <C-A> <C-C>ggV
colorscheme molokai
/usr/share/vim/vim7x/colors/