追求最强的vim(未完待续)

入门就是vi,现在还是个低级vim使用者,默哀!今天想起了配置个强大的vim。暂时把已做的工作记录下来,后面继续攻坚,感觉中文的vim配置远远不够,插件啊!哪里去了?

一个牛叉的vim配置文件网站:https://github.com/spf13/spf13-vim打开他网页上有一处高亮显示“automatic installer"点击他会出现一页的命令,将这些命令拷贝下来放在一个shellscript里,然后shell执行该脚本,则会配置一个强大的vim,但是我感觉这我还要更强,结合下面几篇文章:

http://blog.csdn.net/tge7618291/article/details/4216977

http://linux-wiki.cn/wiki/zh-hans/%E7%94%A8Vim%E7%BC%96%E7%A8%8B%E2%80%94%E2%80%94%E9%85%8D%E7%BD%AE%E4%B8%8E%E6%8A%80%E5%B7%A7

http://www.cnblogs.com/keepHack/archive/2012/04/09/2439361.html

自动编译程序文件

"make 运行
:set makeprg=g++\ -Wall\ \ %

改善下颜色效果:

set t_Co=256

下面是我的/usr/share/vim/vimrc


" 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.
if has("syntax")
  syntax on
endif

" 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("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
if has("autocmd")
  filetype plugin indent on
endif

" 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)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif
set number
set cindent
set autoindent
set smartindent
set showmatch
set ruler
set tabstop=4
set shiftwidth=4
set autochdir
set cursorline
"make the /home/lxj/test directory the default directory
"cd /home/lxj/test
set tags=tags
filetype on
set nocompatible
set history=1000
set guioptions-=T
set incsearch
if has("vms")
	set nobackup
else
	set backup
endif
"split two.c
set cscopequickfix=s-,c-,d-,i-,t-,e-
if has("cscope")
	set csprg=/usr/bin/cscope
	set csto=1
	set cst
	set nocsverb
	"add my database in current directory
	if filereadable("cscope.out")
		cs add cscope.out
	endif
	set csverb
	endif
set clipboard+=unnamed
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-\>d :cs find d <C-R>=expand("<cword>")<CR><CR> 
set guifont=Courier\ New:h10
""set lines=50 columns=180
set nocompatible
filetype off
set rtp+=/usr/share/vim/bundle/vundle
"call vundle#rc()
"Bundle 'gmarik/vundle'
"Bundle 'tpope/vim-fugitive'
"Bundle 'Lokaltog/vim-easymotion'
"Bundle 'rstacruz/sparkup',{'rtp': 'vim/'}
"Bundle 'tpope/vim-rails.git'
"Bundle 'L9'
"Bundle 'FuzzyFinder'
"Bundle 'git://git.wincent.com/command-t.git'
"Bundle 'file:///Users/gmarik/path/to/plugin'
filetype plugin indent on
set completeopt+=longest
autocmd InsertLeave * if pumvisible()==0|pclose|endif
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr> <Up>	pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <PageDown> pimvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
""execute pathogen#infect()
autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd QuickFixCmdPost    l* nested lwindow
set foldmethod=syntax
set foldlevel=99
map <F3> za
"DoMatchParen
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>
set modeline



代码的折叠与打开za


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值