vimrc

来源:互联网 发布:python 读excel 编辑:程序博客网 时间:2024/05/21 10:51
"pathogenexecute pathogen#infect()syntax onfiletype plugin indent on"pathogen endsyntax on"color darkbluefiletype indent onfiletype plugin onfiletype plugin indent onset autoindentset nobackupset nowbset noswapfileset showmatchset fileencodings=utf-8,gbk,gb2312,gb18030set encoding=utf-8set termencoding=utf-8set numberset rulerset noerrorbellsset nocompatibleset cindentset smartindentset tabstop=4set softtabstop=4set shiftwidth=4set incsearchset hlsearchset autoreadset hidden  "you can have unwritten changes to a file and open a new file using :e, without being forced to write or undo your changes firstset scs   "cscopeset lbrset laststatus=2set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%cfunction! CurDir()  let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")  return curdirendfunctionfunction! HasPaste()  if &paste    return 'PASTE MODE  '  else    return ''  endifendfunctionset statusline+=\ \ [set statusline+=%{strlen(&ft)?&ft:'none'}, " filetypeset statusline+=%{&fileformat}] " file formatset statusline+=%= " right alignset statusline+=0x%-8B " current charset statusline+=%-14.(%l,%c%V%)\ %<%P " offset"Delete trailing white space, useful for Python ;)func! DeleteTrailingWS()  exe "normal mz"  %s/\s\+$//ge  exe "normal `z"endfuncautocmd BufWrite *.py :call DeleteTrailingWS()autocmd BufRead * silent! %s/[\r \t]\+$//autocmd FileType c,cpp setlocal cinoptions=:0,g0,(0,w1 shiftwidth=4 tabstop=4autocmd FileType html,xhtml,haml setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2 autoindentautocmd FileType python setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtabautocmd FileType css setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtabautocmd FileType java,jsp, setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2 autoindentset nuset ignorecaseset nowrapscanset mouse=anmap <F8> :TagbarToggle<CR>



set nocompatibleif has('mouse')  set mouse=aendifif &t_Co > 2 || has("gui_running")  syntax on  set hlsearchendif" Only do this part when compiled with support for autocommands.if has("autocmd")  " Enable file type detection.  " Use the default filetype settings, so that mail gets 'tw' set to 72,  " 'cindent' is on in C files, etc.  " Also load indent files, to automatically do language-dependent indenting.  filetype plugin indent on  " Put these in an autocmd group, so that we can delete them easily.  augroup vimrcEx  au!  " For all text files set 'textwidth' to 78 characters.  autocmd FileType text setlocal textwidth=78  " When editing a file, always jump to the last known cursor position.  " Don't do it when the position is invalid or when inside an event handler  " (happens when dropping a file on gvim).  " Also don't do it when the mark is in the first line, that is the default  " position when opening a file.  autocmd BufReadPost *    \ if line("'\"") > 1 && line("'\"") <= line("$") |    \   exe "normal! g`\"" |    \ endif  augroup ENDelse  set autoindent" always set autoindenting onendif " has("autocmd")set numberset nowrapset mousemodel=popupset guioptions+=b set expandtab         set sw=4         set tabstop=4  " 怕檔案裡頭仍有 \t         set softtabstop=4"plugin syntaxset statusline+=%#warningmsg#set statusline+=%{SyntasticStatuslineFlag()}set statusline+=%*let g:syntastic_always_populate_loc_list = 1let g:syntastic_auto_loc_list = 1let g:syntastic_check_on_open = 1let g:syntastic_check_on_wq = 0"end plugin syntaxnmap <leader>s :TagbarToggle<CR>execute pathogen#infect() syntax onfiletype plugin indent onset smartindentset incsearch"let mapleader=",""nerdtree settingsnmap <leader><F7> :NERDTree<CR>"close vim if the only window left open is a NERDTreeautocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif"end nerdtree settings


0 0