如何打造老师那帅帅的VIM编辑器

来源:

慕码人8061349

2016-12-22

老师你好,我的VIM和你的差不多,但是我的vim在xshell里尽然会出现无法用退格键删除,你的VIM是怎么配置的?可以分享你的配置文件吗??

写回答

1回答

慕瓜瓜

2017-05-07

if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"

   set fileencodings=ucs-bom,utf-8,latin1

endif


set nu

set tabstop=4

set softtabstop=4 

set shiftwidth=4

set noexpandtab 

set nocompatible " Use Vim defaults (much better!)

set bs=indent,eol,start " allow backspacing over everything in insert mode

"set ai " always set autoindenting on

"set backup " keep a backup file

set viminfo='20,\"50 " read/write a .viminfo file, don't store more

" than 50 lines of registers

set history=50 " keep 50 lines of command line history

set ruler " show the cursor position all the time


" Only do this part when compiled with support for autocommands

if has("autocmd")

  augroup redhat

  autocmd!

  " In text files, always limit the width of text to 78 characters

  " autocmd BufRead *.txt set tw=78

  " When editing a file, always jump to the last cursor position

  autocmd BufReadPost *

  \ if line("'\"") > 0 && line ("'\"") <= line("$") |

  \   exe "normal! g'\"" |

  \ endif

  " don't write swapfile on most commonly used directories for NFS mounts or USB sticks

  autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp

  " start with spec file template

  autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec

  augroup END

endif


if has("cscope") && filereadable("/usr/bin/cscope")

   set csprg=/usr/bin/cscope

   set csto=0

   set cst

   set nocsverb

   " add any database in current directory

   if filereadable("cscope.out")

      cs add $PWD/cscope.out

   " else add database pointed to by environment

   elseif $CSCOPE_DB != ""

      cs add $CSCOPE_DB

   endif

   set csverb

endif


" Switch syntax highlighting on, when the terminal has colors

" Also switch on highlighting the last used search pattern.

if &t_Co > 2 || has("gui_running")

  syntax on

  set hlsearch

endif


filetype plugin on


if &term=="xterm"

     set t_Co=8

     set t_Sb=[4%dm

     set t_Sf=[3%dm

endif


" Don't wake up system with blinking cursor:

" http://www.linuxpowertop.org/known.php

let &guicursor = &guicursor . ",a:blinkon0"


set nocompatible              " be iMproved, required

filetype off 

set rtp+=~/.vim/bundle/Vundle.vim/

call vundle#begin()

Plugin 'gmarik/vundle' "Plugin同行可以增加注释Bundle同行不能加注释

Plugin 'ctags.vim'

Plugin 'The-NERD-tree'

Plugin 'taglist.vim'

Plugin 'winmanager'

Plugin 'bufexplorer.zip'

Plugin 'AutoComplPop'

Plugin 'ZendCoding'


call vundle#end()

filetype plugin indent on


"Taglist"

"let Tlist_Ctags_Cmd='/root/.vim/bundle/ctags.vim/plugin/ctags.vim'

let Tlist_Ctags_Cmd='/usr/bin/ctags'

let Tlist_Inc_Winwidth=0

let Tlist_Auto_Open = 0

let Tlist_Show_One_File = 1

let Tlist_Exit_OnlyWindow = 1

let Tlist_Use_Right_Window =1

let Tlist_WinWidth = 30

noremap <F8> :TlistToggle<CR>

"noremap <F6> :!ctags -R<CR>


"++++++++++++++++++++++++++++++++

"NERDTree配置"

nmap <F2> :NERDTreeToggle  <CR>

autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif

"打开vim时自动打开NERDTree

autocmd vimenter * NERDTree


let g:NERDTreeWinPos="left"

let g:NERDTreeWinSize=25

let g:NERDTreeShowLineNumbers=1

let g:neocomplcache_enable_at_startup = 1 



"++++++++++++++++++++++++++++++++

"添加PHP函数提示功能

au FileType php call PHPFunList()

function PHPFunList()

set dictionary-=/etc/vim/php_funclist.txt dictionary+=/etc/vim/php_funclist.txt

set complete-=k complete+=k

endfunction


0
0

Yii2.0开发一个仿京东商城平台

【毕设】购物、下单、支付、收货...各功能模块开发,打造京东式电商平台

1543 学习 · 655 问题

查看课程