vim插件打造ide

一直听说vim,emacs两大神器,于是选了一直在用的vim来体验一下
先放个最后的效果图
在这里插入图片描述
最初目的是打算搞出来写django的,于是很多插件配置用的官方文档推荐的
https://code.djangoproject.com/wiki/UsingVimWithDjango

1、首先需要插件管理 Vundle
这个方式只修改当前用户的vim
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
编辑vimrc
vim ~/.vimrc

set nocompatible
filetype on
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()
filetype plugin indent on 

安装插件:进入vim,输入 :PluginInstall
或者直接命令行执行 vim +PluginInstall +qall
卸载插件:在vimrc中删除相应行后
进入vim ,输入 :PluginClean
其它用法github上看吧。。。

2、自动补全插件 Plugin ‘Valloric/YouCompleteMe’
https://github.com/Valloric/YouCompleteMe
先用vundle安装,PluginInstall会报错需要单独安装,执行下面步骤即可
PluginInstall过程很慢而且没有进度条显示,可以进入~/.vim/bundle/YouCompleteMe/目录查看大小是否在增长,我的有307M
sudo apt install build-essential cmake python3-dev
cd ~/.vim/bundle/YouCompleteMe
python3 install.py
clang之类的暂时用不到,参数就全都没加

3、目录树显示插件 Plugin ‘scrooloose/nerdtree’
vimrc中配置如下

Plugin 'scrooloose/nerdtree'
let g:NERDTreeChDirMode=2    #将当前目录设置为nerdtree根目录
map <C-n> :NERDTreeToggle<CR>    #设置快捷键,ctrl+n打开nerdtree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif     #这两行是打开目录是自动打开nerdtree,比如vim . 时
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif  #只剩下nerdtree窗口时自动关闭vim

ctrl+w+w 切换窗口,vim和nerdtree之前切换
shift+c 将当前目录设为根节点
shift+r 刷新当前根目录
o

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值