记录下vim 的一些经常使用配置。每当换到一台新电脑的时候,使用vim的时候,缩进等各类方式都不友好。每次都要到互联网上去找,还要找半天,这篇博客,记录下我经常使用的vim配置,以及扩展,可以快速的配置开发环境。提升工做效率,省下的时间用来玩耍或者陪家人朋友。html
set nu if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif set number "显示行号 set nowrap "不换行 set shiftwidth=4 "默认缩进4个空格 set softtabstop=4 "使用tab时 tab空格数 set tabstop=4 "tab表明4个空格 set laststatus=2 "老是显示状态行 "backspace键 " indent 删除自动缩进的值 " eol 删除上一行行末尾的回车,两行合并 " start 除了刚输入的,还删除原来的字符 set backspace=indent,eol,start set expandtab "使用空格替换tab set autoindent " 自动缩进 colorscheme evening "颜色模式 syn on "语法高亮 filetype on "文件类型 set encoding=utf-8 "编码为utf8
Vundle是一款Vim的插件管理软件(Linux),用起来很方便的缘由有几点:git
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
添加以下配置文件github
set nocompatible " be iMproved, required filetype off " required " 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 'VundleVim/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) " 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/'} " Install L9 and avoid a Naming conflict if you've already installed a " different version somewhere else. " Plugin 'ascenator/L9', {'name': 'newL9'} " All of your Plugins must 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 " " Brief help " :PluginList - lists configured plugins " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate " :PluginSearch foo - searches for foo; append `!` to refresh local cache " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal " " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line