ale插件 vim_简单几步,打造你的私人vim!

d15c9402e43cf2788dc028599db0190a.png

习惯了IDE,vim编写需要一些插件才能更高效。

安装插件管理Vundle

  • 克隆项目到本地
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  • 配置vimrc文件
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()

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

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

如果想下载某个插件,需要将Plugin 'xxxx'置于call vundle#begin()call vundle#end()之间,保存配置后在vim中执行 - 下载插件执行

:PluginInstall
  • 删除插件执行
:PluginClean

高效的插件和设置

  1. 自动补全括号和引号等
Plugin 'jiangmiao/auto-pairs'
  1. molokai主题 网上下载”monokai.vim”并放在~/.vim下的colors文件夹下(没有的话新建一个colors文件夹); 下载链接:https://github.com/tomasr/molokai/blob/master/colors/molokai.vim 然后在~/.vimrc 文件中添加如下代码:
syntax enable
set background=dark
:colorscheme molokai

ee10d71de76de59ea17e9969316d285c.png

3. 设置自动缩进、行号等:终端打开vim ~/.vimrc添加

set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set cindent
set cinoptions={
    0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
set nu
set ruler
set hlsearch
set backspace=2

下面是我的vimrc的完整配置,可以直接粘贴复制

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()

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'w0rp/ale' 
Plugin 'scrooloose/nerdtree'          " File tree manager
Plugin 'jiangmiao/auto-pairs'
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set cursorline
set cindent
set cinoptions={
    0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
set nu
set ruler
syntax enable
set background=dark
:colorscheme molokai
set hlsearch
set backspace=2
"-----------------------------------------------------------------------------
" plugin - ale.vim
"-----------------------------------------------------------------------------
"keep the sign gutter open
let g:ale_sign_column_always = 1
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--'

" show errors or warnings in my statusline
let g:airline#extensions#ale#enabled = 1

" self-define statusline
"function! LinterStatus() abort
"    let l:counts = ale#statusline#Count(bufnr(''))
"
"    let l:all_errors = l:counts.error + l:counts.style_error
"    let l:all_non_errors = l:counts.total - l:all_errors
"
"    return l:counts.total 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值