vimrc配置

之前因为电脑重装了,只备份了之前vimrc的配置文件,今天在使用的时候就是tagbar和NERDTree一直不生效,下列是解决方法,或将我已打包好的.vim文件夹和.vimrc拷贝进去,即可使用。
若需要安装NERDTree插件,方法如下:

wget http://www.vim.org/scripts/download_script.php?src_id=17123 -O nerdtree.zip 
unzip nerdtree.zip

mkdir -p ~/.vim/{plugin,doc}

cp plugin/NERD_tree.vim ~/.vim/plugin/
cp doc/NERD_tree.txt ~/.vim/doc/

安装tagbar插件如下:
a. http://www.vim.org/scripts/script.php?script_id=3465
该网站为下载地址,下载 tagbar.vmb
b. 用vim打开: vim tagbar.vmb
c. 底行模式输入:so %

下列为个人习惯.vimrc的配置文件,若安装vim完毕后无.vimrc,可自己创建

syntax on
filetype on
au BufRead,BufNewFile *.sv set filetype=systemverilog
au BufRead,BufNewFile *.v  set filetype=verilog

set nu
set mouse=a
set hlsearch
set ff=unix
" 记住上次位置
set viminfo='10,\"100,:20,%,n~/.viminfo 
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif

nmap <silent> <F4> :TagbarToggle<CR>  
let g:tagbar_ctags_bin = '/usr/bin/ctags'  
let g:tagbar_width = 50
let g:tagbar_left=1

" NERD tree
let NERDChristmasTree=0
let NERDTreeWinSize=35
let NERDTreeChDirMode=2
let NERDTreeIgnore=['\~$', '\.pyc$', '\.swp$']
let NERDTreeShowBookmarks=1
let NERDTreeWinPos="right"
" Automatically open a NERDTree if no files where specified
autocmd vimenter * if !argc() | NERDTree | endif
" Close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" Open a NERDTree
nmap <F8> :NERDTreeToggle<cr>

" cscope setting
if has("cscope")
    if has("cscope")
        set csprg=/usr/bin/cscope
        set csto=0
        set cst
        set nocsverb
        if filereadable("cscope.out")
            cs add cscope.out
        elseif $CSCOPE_DB != ""
            cs add $CSCOPE_DB
	endif
	set csverb
    endif
endif
map <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
map <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
map <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
map <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
map <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
map <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
map <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
map <C-\>i :cs find i <C-R>=expand("<cfile>")<CR><CR>
map <F6> :cs find d<space>

" TABLE == 4 SPACE
set ts=4

" hanzi support
set fencs=utf-8,GB18030,ucs-bom,default,latin1

" 状态栏
set laststatus=2      " 总是显示状态栏
highlight StatusLine cterm=bold ctermfg=yellow ctermbg=blue
" 获取当前路径,将$HOME转化为~
function! CurDir()
        let curdir = substitute(getcwd(), $HOME, "~", "g")
        return curdir
endfunction
set statusline=[%n]\ %f%m%r%h\ \|\ \ pwd:\ %{CurDir()}\ \ \|%=\|\ %l,%c\ %p%%\ \|\ ascii=%b,hex=%b%{((&fenc==\"\")?\"\":\"\ \|\ \".&fenc)}\ \|\ %{$USER}\ @\ %{hostname()}\

set list
set listchars=tab:>-,trail:-
  • 8
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

落淼喵_G

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值