vim 配置文件

原创 2016年05月31日 17:06:21

vim 配置


"set autoindent
"set cindent

set encoding=utf-8
setglobal fileencodings=utf-8,gb18030
set termencoding=utf-8
set ambiwidth=double

" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below.  If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed.  It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
"runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax enable
syntax on

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif

" Uncomment the following to have Vim load indentation rules according to the
" detected filetype. Per default Debian Vim only load filetype specific
" plugins.
if has("autocmd")
filetype indent on

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd             " Show (partial) command in status line.
set showmatch           " Show matching brackets.
"set ignorecase          " Do case insensitive matching
set smartcase           " Do smart case matching
set incsearch           " Incremental search
set autowrite           " Automatically save before commands like :next and :make
set hidden             " Hide buffers when they are abandoned
""set mouse=a            " Enable mouse usage (all modes) in terminals
"set mouse=            " Enable mouse usage (all modes) in terminals

" Source a global configuration file if available
" XXX Deprecated, please move your changes here in /etc/vim/vimrc
"if filereadable("/etc/vim/vimrc.local")
"source /etc/vim/vimrc.local

"set color scheme ,as you like
"color darkblue
color desert
"replace tab with spaces
set et
"line will wrap when len>78
"set tw=250
"tab space is 4
set ts=4
"when you type < or >, shift width is 4
set sw=4
"set format options, (more info: type help fo-table)
set fo+=tcroq
"line number
set nu
"a horizontal line under current cursor
"set cursorline 

let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1

let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>

:set cscopequickfix=s-,c-,d-,i-,t-,e-

nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
"nmap <C-_>i :cs find i <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
vmap <F5> :s=^\(//\)*=//=g<cr>:noh<cr>
nmap <F5> :s=^\(//\)*=//=g<cr>:noh<cr>
nmap <F6> :s=^\(//\)*==g<cr>:noh<cr>
vmap <F6> :s=^\(//\)*==g<cr>:noh<cr>

"set makeprg=/root/qfang/bin/scons/\ -u\ \.

"miniBuf is sooooo sucks
"noremap <Tab> <C-W>w:cd%:p:h<CR>:<CR>
"let g:miniBufExplMapCTabSwitchBufs = 1
"let g:miniBufExplMapWindowNavVim = 1
"let g:miniBufExplMapWindowNavArrows = 1

set completeopt=longest,menu
set nocp
filetype plugin on

map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>

"set tags+=/usr/include/tags
set tags+=/home/admin/qiang.fangq/main_richtext_extractor/tags
set tags+=/home/admin/qiang.fangq/awrapper/tags
set tags+=/home/admin/qiang.fangq/usr_tags

set backspace=indent,eol,start
set hlsearch

" vimgdb setting
"run macros/gdb_mappings.vim 

"pydiction 1.2 python auto complete
let g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'
let g:pydiction_menu_height = 20

let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType="<C-X><C-N>"

map<F5> <ESC><F5>
map<f5> :call AddComment()<cr>
func AddComment()
    if matchstr(getline('.'), '[^ ]') == '/' 
        normal ^xx 
        normal ^i//
imap <F6> <ESC><F6>
noremap <f6> =a{ 
imap <F7> <ESC><F7>
map<F7> :w<cr>:A<cr>
imap <cr> <cr><left><right>
map o o<left><right>
map wm :NERDTree<cr>
map <tab> gt
autocmd BufNewFile,BufRead *.json set ft=javascript






  • 2017年11月20日 22:03
  • 622KB
  • 下载

Vim 配置文件

  • 2017年11月19日 13:21
  • 4.17MB
  • 下载


1.vim中的指令 (1)添加行序号 指令    shift+:后   输入  set nu                     (2)取消行序号 指令   shift+:后   输入  set...


  • 2017年11月09日 17:00
  • 2KB
  • 下载


  • 2015年10月25日 17:11
  • 827KB
  • 下载

史上最强的Vim 配置文件(修正版)

史上最强的vimrc文件,据说有800行,还是作者精简后的结果. 我在尽可能保留原作者的创意的前提下做了些小的修正,主要的修改如下:   增加了对win32系统的兼容,原来的...


  • 2014年09月28日 22:27
  • 4KB
  • 下载


  • 2017年07月06日 19:18
  • 28.88MB
  • 下载

一个好用的 vim 配置文件

原文请见 强大的vim配置文件,让编程更随意该配置文件的特点:我的vim配置主要有以下优点: 1.按F5可以直接编译并执行C、C++、java代码以及执行shell脚本,按“F8”可进行C、C++代码...

linux 下vim 插件及配置文件

  • 2016年08月01日 15:53
  • 4.89MB
  • 下载
您举报文章:vim 配置文件