Browse Source

add vimrc

huangchengwu 4 years ago
parent
commit
cde312dcf1
2 changed files with 77 additions and 1 deletions
  1. 1 1
      install.sh
  2. 76 0
      vimrc

+ 1 - 1
install.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 yum -y install gcc gcc-c++ python-devel lua-devel
-wget https://www.gitinn.com/u188404/vim/raw/master/v8.1.1835
+cp -rf vimrc ~/.vimrc
 tar xvf ./v8.1.1835
 cd vim-8.1.1835/
 ./configure          --enable-pythoninterp=yes                       --enable-python3interp=yes              --enable-luainterp=yes       --enable-pythoninterp=yes --with-python-config-dir=/usr/lib64/python2.7/config --prefix=/usr

+ 76 - 0
vimrc

@@ -0,0 +1,76 @@
+""--------------基础配置-------------------
+""不要使用vi的键盘模式,而是vim自己的
+set nocompatible 
+
+"" 使用 utf-8 编码
+set encoding=utf-8  
+""启用256色
+set t_Co=256
+
+"" 按下tab 空格两次
+set tabstop=2
+""显示行号
+set number
+""自动对齐
+set autoindent
+
+""启动256色 和molokai插件颜色
+set t_Co=256
+syntax on
+set background=dark
+color molokai
+let g:molokai_original=1
+let g:rehash256=1
+set backspace=indent,eol,start 
+
+""光标所在行高亮
+set cursorline
+
+""python自动补齐
+let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
+let g:pydiction_menu_height = 20
+let g:neocomplete#enable_at_startup = 1
+
+""搜索时高亮
+set hlsearch
+""搜索会跳过去
+set incsearch
+
+""-----------------------------------x
+"" 开启文件类型检查,并且载入与该类型对应的缩进规则。比如,如果编辑的是.py文件,Vim
+"" 就是会找 Python 的缩进规则~/.vim/indent/python.vim。
+filetype off
+
+
+""引入外置
+set rtp+=~/.vim/bundle/Vundle.vim
+""ctrl v竖屏  x横屏  w横批切换  p文件搜索   t打开文件  
+set rtp+=~/.vim/bundle/ctrlp.vim
+"" F7打开目录结构 desc返回上一个目录
+set rtp+=~/.vim/bundle/nerdtree
+set rtp+=~/.vim/bundle/self_vim/srech.vim
+set rtp+=~/.vim/bundle/neocomplete/plugin/neocomplete.vim 
+
+
+""下载常用插件
+call vundle#begin()
+Plugin 'VundleVim/Vundle.vim'
+call vundle#end()
+filetype plugin indent on
+
+"根据文件类型启动
+map <F5> :call  Run() <CR>
+func! Run()
+		if &filetype == "sh"
+						:!time bash %
+		elseif &filetype ==  "python"
+						exec "!time python %"
+		elseif &filetype == "go"
+						exec "!go build %<"
+						exec "!time go run %"
+
+		endif
+endfunc
+
+map <F7> :NERDTreeToggle<CR>
+