最简单的配置vim

Hello, 大家好,我是爱吃香蕉的猴子,之前总是将Vim配置的很idea, 结果 出现延迟 还有莫名的异常;最后 选择最简单的配置;


"" :Ack! TODO
"" git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
"" https://github.com/airblade/vim-gitgutter


""""""""""""" 
"" mkdir -p ~/.vim/pack/airblade/start
"" cd ~/.vim/pack/airblade/start
"" git clone https://github.com/airblade/vim-gitgutter.git
"" vim -u NONE -c "helptags vim-gitgutter/doc" -c q

"" git@github.com:tpope/vim-fugitive.git
"" https://github.com/tpope/vim-fugitive
""""""""""""""""""""""""""""""
" mkdir -p ~/.vim/pack/tpope/start
" cd ~/.vim/pack/tpope/start
" git clone https://tpope.io/vim/fugitive.git
" vim -u NONE -c "helptags fugitive/doc" -c q
"""""""""""""""""""""""""""""

""""""""""""""""""""""""""""""""
" install 
" sudo apt install silversearcher-ag
" sudo apt install universal-ctags
" sudo apt-get install cscope
" 
""""""""""""""""""""""""""""""""
syntax on " 自动语法高亮
set ts=4 " 设置 Tab为4空格
set sw=4
set tabstop=4
set expandtab
set autoindent " 设置智能换行好像
set nu " 设置行号
set laststatus=2
set hlsearch
set incsearch " 输入搜索内容时就显示搜索结果
set cursorline " 突出显示当前行
hi CursorLine cterm=underline ctermfg=yellow
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\
set ruler " 打开状态栏标尺

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" cscope setting
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("cscope")
    set csprg=/usr/bin/cscope
    set csto=1
    set cst
    set nocsverb
    " add any database in current directory
    if filereadable("cscope.out")
        cs add cscope.out
    endif
    set csverb
endif

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 rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'mileszs/ack.vim'
Plugin 'majutsushi/tagbar'

call vundle#end()
" filetype plugin indent on

" NerdTree才插件的配置信息
""将F2设置为开关NERDTree的快捷键
map <f2> :NERDTreeToggle<cr>
""修改树的显示图标
let g:NERDTreeDirArrowExpandable = '+'
let g:NERDTreeDirArrowCollapsible = '-'
""窗口位置
let g:NERDTreeWinPos='left'
""窗口尺寸
let g:NERDTreeSize=30
""窗口是否显示行号
let g:NERDTreeShowLineNumbers=1
""不显示隐藏文件
let g:NERDTreeHidden=0
                                                     ""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
" TODO
if executable('ag')
 let g:ackprg = 'ag --vimgrep'
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap ]t <Plug>(GitGutterNextHunk)
nmap [t <Plug>(GitGutterPrevHunk)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set cursor shape and color ; style 0-6
" if &term =~ "xterm"
" INSERT mode
" let &t_SI =<Esc>[6 q” .<Esc>]12;blue\x7”
" REPLACE mode
" let &t_SR =<Esc>[3 q” .<Esc>]12;black\x7”
" NORMAL mode
" let &t_EI =<Esc>[2 q” .<Esc>]12;green\x7”
" let &t_EI = "<Esc>[6 q" . "<Esc>]12;red\x7"
" endif
"""""""""""""""""""""""""""""""""""""""""""""""""'
"""" 设置每行max字符数
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%120v.*/
"""""""""""""""""""""""""""
" tagbar
nmap <F9> :TagbarToggle<CR>
let g:tagbar_ctags_bin='/home/user/doc/softer/temp/bin/ctags'
let g:tagbar_width=30
" let g:tagbar_autopreview = 1
changes”以显示发生更改的行。 用“g;”和“g”,跳转到更改的行

cscope -Rbkq

cs find c 函数


技巧vim工具开发中常用技巧

                                 Code的搬运工V1.0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值