vim编辑代码自动补全设置
2017-05-05 14:34
411 查看
1.安装vundle插件
执行:git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 从git下面下载vundle.vim文件
将如下文本设置到/etc/vimrc中
参考:
https://github.com/VundleVim/Vundle.vim http://www.jianshu.com/p/0e85e7c9e543#
2.设置/etc/vimrc内容
添加如下设置:
syn on
filetype on
set number
set ruler
set hls
set history=500
"set cursorline
"set laststatus=2
"set cmdheight=1
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set smarttab
set autoindent
set smartindent
set cindent
"set showcmd
set showmatch
3.自动对齐设置命令
进入vim,先选择行数,再按下“=”号两次,即可自动对齐
如:按下300,再按下“=”两次,可以将文本的光标以下300行自动对齐。
执行:git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 从git下面下载vundle.vim文件
将如下文本设置到/etc/vimrc中
set nocompatible " be iMproved, required "filetype off " required 这个需要设置为on,用来识别自动文本类型 " 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) 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/'} " 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
参考:
https://github.com/VundleVim/Vundle.vim http://www.jianshu.com/p/0e85e7c9e543#
2.设置/etc/vimrc内容
添加如下设置:
syn on
filetype on
set number
set ruler
set hls
set history=500
"set cursorline
"set laststatus=2
"set cmdheight=1
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set smarttab
set autoindent
set smartindent
set cindent
"set showcmd
set showmatch
3.自动对齐设置命令
进入vim,先选择行数,再按下“=”号两次,即可自动对齐
如:按下300,再按下“=”两次,可以将文本的光标以下300行自动对齐。
相关文章推荐
- 设置Vim代码自动补全
- vim安装后的设置,括号补全,自动缩进、代码补全等
- 重新安装了Vim并设置了代码自动补全neocomplcache-6.1
- vim代码自动补全函数提示设置
- vim代码自动补全函数提示设置
- vim代码自动补全函数提示设置
- Eclipse代码自动补全设置
- windows下用vim实现qt代码的自动补全功能(zz)
- Vim下的代码自动补全和代码跳转阅读
- vim代码自动补全功能
- vim设置括号自动补全
- vim设置新建文件自动填入的文件头,以及设置编辑时间
- Vim下的代码自动补全 使用ctags和OmniCppComplete taglist + cscope + global
- VS 编辑HTML 标签,自动补全属性引号设置
- Eclipse 代码自动补全功能设置
- Eclipse 代码自动补全功能设置
- 在VS.NET中使用QT的代码自动补全设置
- 让vim支持c++代码自动补全功能。
- Linux设置命令行vim编辑自动显示行号
- QT Creator 代码自动补全快捷键设置