vim简单配置

安装主题

使用molokai主题:在目录~/.vim下执行命令
git clone https://github.com/mrtazz/molokai.vim.git

安装Vundle插件管理工具

在~/.vim下新建目录bundle,在该目录下执行命令
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

配置Vundle及vim的简单设置

在~目录下新建.vimrc文件,简单记录下我的该文件的内容:

set nocompatible
filetype off

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}

Plugin 'scrooloose/nerdtree'

" All of your Plugins mu:t be added before the following line
 call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on


" Put your non-Plugin stuff after this line

"语法高亮
syntax on
colorscheme molokai
"显示行号
set number
"显示光标所在位置的行号和列号
set ruler
set ai                              "自动缩进
set bs=2                        "insert模式下用退格键删除
set showmatch                    "代码匹配
set laststatus=2                 "总是显示状态行
set expandtab               "以下三个配置配合使用,设置tab和缩进的空格数
set shiftwidth=4           
set tabstop=4
set cursorline              "为光标所在行加下划线
set autoread                "文件在vim之外修改过,自动重新读入
set autowriteall            "切换文件时自动保存
set autoindent            "自动缩进
set cursorline             "高亮当前行
set so=8                  "光标在窗口上下边界时距离边界8行即开始滚屏

set ignorecase             "检索时忽略大小写
set fileencodings=utf-8,gbk   "使用utf-8或gbk打开文件
set hls                 "检索时高亮显示匹配项
set helplang=cn         "将帮助系统设置为中文
set foldmethod=syntax           "代码折叠

"conf for tabs,为标签页进行的配置,通过ctrl+h/l切换标签等
let mapleader = ','
nnoremap  gt
nnoremap  gT
nnoremap t : table

"conf for plugins 状态栏配置
set guifont=PowerlineSymbols\ for\ Powerline
set nocompatible
set t_Co=256
let g:Powerline_symbols = 'fancy'

Vundle常用命令

:PluginInstall        //安装.vimrc中配置的插件 
:PluginInstall <plugin-name> 
:PluginClean         //清理闲置的插件
:PluginSearch <text-list>     //搜索插件

[参考]
Vundle:你必须了解的Linux Vim插件管理工具

你可能感兴趣的:(Tool)