快速配置好一个好用的vim
来源:互联网 发布:会c语言在哪里开发软件 编辑:程序博客网 时间:2024/05/07 23:20
一.安装vim
sudo apt-get install vim
二.vim基础配置
在/etc/vim/vimrc中添加
set fileencodings=utf-8,gbk set ambiwidth=double“支持中文set smartindent set smarttab set expandtab set tabstop=4 set softtabstop=4 set shiftwidth=4 set backspace=2set textwidth=79"允许退格键删除和tab操作 " 启用鼠标 set mouse=a " 启用行号 set nu
三.设置代码补全功能
1.利用omni-completion补全函数:在vimrc中插入:
filetype plugin on autocmd FileType python set omnifunc=pythoncomplete#Complete
需要补全函数时,ctrl+x crtl+o
2.使用pydiction进一步补全代码
下载pydiction
#wget http://www.pythonclub.org/_media/python-basic/pydiction-1.2.zip#unzip pydiction-1.2.zip“ ~/.vim/after/ftplugin和~/.vim/tools/pydiction/目录默认不存在,需要自行创建#cp pydiction-1.2/python_pydiction.vim ~/.vim/after/ftplugin#cp pydiction-1.2/complete-dict ~/.vim/tools/pydiction/complete-dict
注意:是~/.vim目录
然后修改vimrc文件,加入一行
filetype plugin on autocmd FileType python set omnifunc=pythoncomplete#Complete let g:pydiction_location='~/.vim/tools/pydiction/complete-dict'
这时,按Tab键就可以补全代码
四.源代码查看功能
1.安装ctags
apt-get install ctags
安装完成后,把光标移动到某个元素上,CTRL+],就会跳转到对应的定义啦。CTRL+o可以回退到原来的地方。
2.安装taglist
#apt-get install vim-scripts#apt-get install vim-addon-manager # vim-addons install taglist
修改vimrc文件
let Tlist_Auto_Highlight_Tag=1 let Tlist_Auto_Open=1 let Tlist_Auto_Update=1 let Tlist_Display_Tag_Scope=1 let Tlist_Exit_OnlyWindow=1 let Tlist_Enable_Dold_Column=1 let Tlist_File_Fold_Auto_Close=1 let Tlist_Show_One_File=1 let Tlist_Use_Right_Window=1 let Tlist_Use_SingleClick=1 nnoremap <silent> <F8> :TlistToggle<CR> “设定F8为taglist开关
安装完成后,会在右边出现文件目录,使用Ctrl+w,再按w可以在code窗口和taglist窗口间切换。
3。安装NERD_TREE 目录树
NERDTree插件的官方地址如下,可以从这里获取最新的版本
http://www.vim.org/scripts/script.php?script_id=1658
自己用最新版好像不行。。
安装方法很简单,先把压缩文件下载下来,解压后将plugin目录下的NERD_tree.vim拷贝~/.vim/plugin以及doc目录下的NERD_tree.txt拷贝到~/.vim/doc.
wget http://www.vim.org/scripts/download_script.php?src_id=17123 -O nerdtree.zipunzip nerdtree.zipmkdir -p ~/.vim/{plugin,doc}cp plugin/NERD_tree.vim ~/.vim/plugin/cp doc/NERD_tree.txt ~/.vim/doc/
安装好后,命令行中输入vim,打开vim后,在vim中输入:NERDTree,你就可以看到NERDTree的效果了。
为了方便起见,我们设置一下快捷键,在~/.vimrc 文件中添加下面内容
" NERDTreemap <F10> :NERDTreeToggle<CR>
这样打开vim后,只要按键盘上的F10就可以显示和隐藏NERDTree的文件浏览了。
0 0
- 快速配置好一个好用的vim
- 一个比较好用的 vim 配置
- 好用的vim配置
- 好用的vim 配置
- 一个好用的 vim 配置文件
- 超级好用的vim配置记录
- 一个快速配置使用wxWidgets的好东西 - wxPack
- vim配置好文
- 配置一个好用的Android模拟器
- 配置一个好用的ubuntu16.04
- 一个好用的vim+go开发环境
- vim好用的快捷键
- vim好用的命令
- 好用的vim指令
- Vim好用的插件
- 简洁又好用的vim配置 支持 python 中文
- 将vim配置为好用的IDE
- vim 好用指令& 配置 收集
- AJAXdemo.html
- NotifyIcon控件 托盘控件
- Linux内核分析:实验一
- java中Overload(重载)和Override(重写、覆盖)
- 第一章 Java EE框架概述
- 快速配置好一个好用的vim
- 让使用了SQLite的.NET应用自适应32位/64位系统
- 使用POI读取xls和xlsx
- 主主+ lvs keepalived 配置文件
- 金蝶二次开发
- [数据结构]One-Dimensional Life Game
- AJAXdemo_sync.html Async = false
- 微信企业号开发:UserAgent
- ICPCCamp 2016 Day 6 - Spb SU and Spb AU Contest(Colored path-dp)