:set encoding=utf-8
:scriptencoding 'utf-8'
" filename: ~/.config/nvim/init.vim
" pip3 install pynvim jedi yapf pylint
" from https://jdhao.github.io/2018/09/05/centos_nvim_install_use_guide/
call plug#begin('~/.local/share/nvim/plugged')
" 代码转跳插件(go-to)
Plug 'davidhalter/jedi-vim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-jedi'
" 目录树
Plug 'preservim/nerdtree'
" 状态栏插件
Plug 'vim-airline/vim-airline'
" 自动引号&括号补全
Plug 'jiangmiao/auto-pairs'
" 自动format 命令:Neoformat
Plug 'sbdchd/neoformat'
" 注释插件 <leader>cc,<leader>cu
" neovim 默认leader是反斜杠
Plug 'scrooloose/nerdcommenter'
" 代码检查工具
Plug 'neomake/neomake'
" 多点编辑 Ctrl+n选择, Ctrl+x取消, c修改
Plug 'terryma/vim-multiple-cursors'
" 复制内容高亮
Plug 'machakann/vim-highlightedyank'
" 代码折叠 zo,zO, zc, zC
Plug 'tmhedberg/SimpylFold'
call plug#end()
let g:deoplete#enable_at_stratup = 1
augroup noname
autocmd!
" Deoplete 自动补全,nvim上半部分出现很小的窗口,切不会自动消失
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose |endif
augroup END
" 设置neoformet只做简单的format
" enbale alignment
let g:neoformat_basic_format_align=1
" enbale tab to spaces conversion
let g:neoformat_basic_format_retab = 1
" enable trimming of trailing whitespace
let g:neoformat_basic_format_trim = 1
" jedi-vim配置 关闭自动补全
" disable autocompletion, cause we use deoplete for comletion
let g:jedi#completions_enabled = 0
" open the go-to function in split, no another buffer
let g:jedi#use_splits_not_buffers = 'right'
" 使用pylint作为Python代码检查器
let g:neomake_python_enabled_markers = ['pylint']
call neomake#configure#automake('nrwi', 500)
set number