我用的vimrc

" set expandtab                                               不然寫makefile時的tab有問題
" set nocompatible
set ts=4
syntax on                                                          開啓色彩
set cindent shiftwidth=4
set nu                                                                開啓行號
set nowrap                                                        不折疊
set ignorecase                                                   搜索不區分大小寫
map <silent> <C-k> <C-b>                                向上翻頁我的快捷鍵
map <silent> <C-j> <C-f>                                  向下
map <silent> <S-w> <C-w>                                
nmap <silent> <S-N> :silent noh<CR>              取消搜索結果高亮顯示  
set gcr=a:block-blinkon0
set hls
set virtualedit=all                                               光標到處可以走
set scrolloff=5
set report=0
set novisualbell
" set bg=dark
set bg=light                                                        設置背景淺色系方案
set cino=g0t0                                                     自動縮進時用的
" hi clear
hi LineNr ctermfg=grey                                       行號灰色
" hi PreProc ctermfg=white
set noeb
set mouse=a                                                      可以使用鼠標
""""""""""""""""""""""""""""""
" Tag list (ctags)
""""""""""""""""""""""""""""""
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_Right_Window = 1
map <silent> <S-L> <esc> :Tlist <CR>
let Tlist_Exit_OnlyWindow=1
let Tlist_File_Fold_Auto_Close=0
let Tlist_Show_Menu=1
let Tlist_Use_Right_Window = 1 " split to the right side of the screen
let Tlist_Compact_Format = 1
let Tlist_WinWidth = 30
let Tlist_Auto_Open=0 " let the tag list open automagically
let Tlist_Compact_Format = 1 " show small menu
let Tlist_Ctags_Cmd = 'ctags' " location of ctags
let Tlist_Enable_Fold_Column = 1 " do show folding tree
let Tlist_Sort_Type = "name"
"set WinManager
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>
nmap tl :Tlist<cr>

set list
" set listchars=tab:>-,trail:-
" set listchars=tab:/./ ,nbsp:%,trail:-
" set listchars=tab:/ / ,nbsp:%,trail:-
set listchars=tab:/|/ ,nbsp:%,trail:-

" set foldenable
" set foldmethod=syntax
set foldmethod=manual
set foldcolumn=0
setlocal foldlevel=1

set modifiable
set write
set path+=/usr/include/**

 

 

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

以前的

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '/<cmd'
let cmd = '""' . $VIMRUNTIME . '/diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '/diff"'
endif
else
let cmd = $VIMRUNTIME . '/diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction

set expandtab
set ts=4
set cindent shiftwidth=4
set nu " 顯示行號
set nowrap " 自動換行
set ignorecase " 忽略大小寫
set guioptions-=m " menu
set guioptions-=T " tools bar
map <silent> <F4> <esc> :colorscheme grey <CR>
map <silent> <F7> <esc> :colorscheme white <CR>
map <silent> <C-k> <C-b>
map <silent> <C-j> <C-f>
map <silent> <S-w> <C-w>
map <silent> <S-L> <esc> :Tlist <CR>
map <silent> <F2> :if &guioptions =~# 'T' <Bar>
/set guioptions-=T <Bar>
/set guioptions-=m <bar>
/else <Bar>
/set guioptions+=T <Bar>
/set guioptions+=m <Bar>
/endif<CR>
set gcr=a:block-blinkon0
set guioptions-=r
set hls
nmap <silent> <C-N> :silent noh<CR>
au GUIEnter * simalt ~x " full screen
set cursorcolumn " highlight the current column
set cursorline " highlight current line
set list " we do what to show tabs, to ensure we get them out of my files
set listchars=tab:>-,trail:- " show tabs and trailin
set virtualedit=all " cursor everywhere
set scrolloff=5 "
set report=0 " tell us when anything is changed via :...
set novisualbell " don't blink
set background=dark
set guioptions-=r
set backup " make backup files
colorscheme white
"hi cursorline guibg=#333333
"hi CursorColumn guibg=#333333
hi cursorline guibg=#200000
hi CursorColumn guibg=#200000
map <silent> <C-k> <C-b>
map <silent> <C-j> <C-f>
map <silent> <S-w> <C-w>
nmap <silent> <C-N> :silent noh<CR> " cancel search color
map <silent> <S-L> <esc> :Tlist <CR>
set path+=C:/Program/// Files/// (x86)/Microsoft/// Visual/// Studio/// 9.0/VC/include/**
set cino=g0t0
let Tlist_Exit_OnlyWindow=1
let Tlist_File_Fold_Auto_Close=1
let Tlist_Show_Menu=1
let Tlist_Use_Right_Window = 1 " split to the right side of the screen
let Tlist_Compact_Format = 1
let Tlist_WinWidth = 40
set guioptions-=L
" TagList Settings {
let Tlist_Auto_Open=0 " let the tag list open automagically
let Tlist_Compact_Format = 1 " show small menu
let Tlist_Ctags_Cmd = 'ctags' " location of ctags
let Tlist_Enable_Fold_Column = 0 " do show folding tree
let Tlist_Exist_OnlyWindow = 1 " if you are the last, kill
" yourself
let Tlist_File_Fold_Auto_Close = 0 " fold closed other trees
let Tlist_Sort_Type = "name" " order by
let Tlist_Use_Right_Window = 1 " split to the right side
" of the screen
let Tlist_WinWidth = 30 " 40 cols wide, so i can (almost always)
" read my functions
" Language Specifics {
" just functions and classes please
let tlist_aspjscript_settings = 'asp;f:function;c:class'
" just functions and subs please
let tlist_aspvbs_settings = 'asp;f:function;s:sub'
" don't show variables in freaking php
let tlist_php_settings = 'php;c:class;d:constant;f:function'
" just functions and classes please
let tlist_vb_settings = 'asp;f:function;c:class'
" }
" }
"Automatically remove trailing spaces when saving a file.
autocmd BufRead,BufWrite * if ! &bin | silent! %s//s/+$//ge | endif

"Remove indenting on empty line
map <F12> :w<CR>:call CleanupBuffer(1)<CR>:noh<CR>
function! CleanupBuffer(keep)
" Skip binary files
if (&bin > 0)
return
endif

" Remove spaces and tabs from end of every line, if possible
silent! %s//s/+$//ge

" Save current line number
let lnum = line(".")

" number of last line
let lastline = line("tiny_XXquot;)
let n = lastline

" while loop
while (1)
" content of last line
let line = getline(n)

" remove spaces and tab
if (!empty(line))
break
endif

let n = n - 1
endwhile

" Delete all empty lines at the end of file
let start = n+1+a:keep
if (start < lastline)
execute n+1+a:keep . "," . lastline . "d"
endif

" after clean spaces and tabs, jump back
exec "normal " . lnum . "G"
endfunction

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章