从昨天开始,又折腾了一下neovim的配置,这次尝试了一下SpaceVim。用下来以后感觉SpaceVim确实是一个很不错的vim配置框架,但是由于一些问题,我最终还是放弃了它。在此记录一下。
pros
整合了很多插件,需要什么新功能的时候在SpaceVim里找一下,启用就可以了。不需要自己再去找插件、对比插件、看文档、调设置。
快捷键设置统一,有规律。而且有快捷键提示,记不住快捷键的时候不需要再到其它地方查看。
一些功能很好用。比如statusline里显示windownumber,按空格+数字就可以方便的在窗口间切换;按
q
可以快速关闭窗口,等等。
cons
使用安装脚本安装时,会自动clone github上的repo,但是如果因为网络等问题,clone失败,脚本还是会提示clone成功并继续下去。
配置方法变了,但是vim里的帮助文档还没有及时更新(2018-07-25)。
快捷键用起来有些别扭,个人不喜欢用空格。
默认的插件有些不合心意,比如
dein
。见上一条,虽然可以切换一些插件,或者把默认的插件禁用再加载自己指定的,但SpaceVim很多地方是和默认插件绑定的,换了插件以后会出问题。
把
dein
换成vim-plug
以后,:SPUpdate
不能用了把
neomake
换成ale
,SPC + t + s
开关语法检查不能用了禁用
indentLine
,总是会提示indentLine
未安装用
vim-indentguides
,会把换行符也显示出来。这是因为在~/.SpaceVim/autoload/SpaceVim/default.vim
中更改了listchars
,把设置listchars
的代码注释掉就可以了。
statusline似乎无法和
gitgutter
集成一些小bug,例如在autocomplete layer中设置
auto-completion-return-key-behavior = "smart"
和auto-completion-tab-key-behavior = "cycle"
后,python文件中的ifmain
snip无法expand。似乎没有一个相当于
:wq
的快捷键。
总之,最后的感觉是,要想让vim完全符合自己的心意,还是得自己从头配置。
config
虽然放弃了SpaceVim,但是把它作为一个查找优秀插件的来源也不错。把config文件贴在下面做个记录。
~/.SpaceVim.d/init.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140#=============================================================================
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
# All SpaceVim option below [option] section
[options]
# set spacevim theme. by default colorscheme layer is not loaded,
# if you want to use more colorscheme, please load the colorscheme
# layer
colorscheme = "one"
colorscheme_bg = "dark"
# background = "dark"
# Disable guicolors in basic mode, many terminal do not support 24bit
# true colors
enable_guicolors = true
# set intent to 4
default_indent = 4
# disable relative line number
relativenumber = false
# statusline setting
statusline_separator = "arrow"
statusline_inactive_separator = "arrow"
statusline_left_sections = [
'winnr',
'filename',
'version control info'
]
statusline_right_sections = [
'major mode',
'minor mode lighters'
'fileformat',
'cursorpos',
'percentage'
]
enable_statusline_display_mode = false
# buffer line, tab line
buffer_index_type = 1
enable_os_fileformat_icon = 1
enable_tabline_filetype_icon = true
# plugin manager
#plugin_manager = 'vim-plug'
# linter setting
enable_neomake = false
enable_ale = true
lint_on_the_fly = true
error_symbol = '∙'
warning_symbol = '∙'
info_symbol = '∙'
# snippet setting
snippet_engine = 'ultisnips'
# other SpaveVim setting
vim_help_language = "cn"
automatic_update = 0
max_column = 81
disabled_plugins = [
'indentLine'
]
# custom setting
bootstrap_before = "myspacevim#before"
# Enable autocomplete layer
[[layers]]
name = 'autocomplete'
auto-completion-return-key-behavior = "complete"
# auto-completion-tab-key-behavior = "cycle"
[[layers]]
name = 'shell'
default_position = 'top'
default_height = 30
[[layers]]
name = "VersionControl"
[[layers]]
name = "checkers"
show_cursor_error = false
[[layers]]
name = "chinese"
[[layers]]
name = "colorscheme"
[[layers]]
name = "debug"
[[layers]]
name = "default"
[[layers]]
name = "lang#markdown"
[[layers]]
name = "lang#python"
[[layers]]
name = "lsp"
filetypes = [
"python",
]
[[layers]]
name = "tools"
[[custom_plugins]]
name = "sheerun/vim-polyglot"
merged = 0
[[custom_plugins]]
name = "tmhedberg/SimpylFold"
merged = 0
[[custom_plugins]]
name = "Konfekt/FastFold"
merged = 0
[[custom_plugins]]
name = 'vim-pandoc/vim-pandoc'
merged = 0
[[custom_plugins]]
name = 'vim-pandoc/vim-pandoc-syntax'
merged = 0
[[custom_plugins]]
name = 'jalvesaq/Nvim-R'
merged = 0
[[custom_plugins]]
name = 'airblade/vim-gitgutter'
merged = 0
[[custom_plugins]]
name = 'thaerkh/vim-indentguides'
merged = 0~/.SpaceVim.d/autoload/myspacevim.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60func! myspacevim#before() abort
"key mapping
inoremap jj <esc>
set clipboard+=unnamedplus
"逗号后空格
inoremap , ,<Space>
"等号左右空格
inoremap = <Space>=<Space>
nmap <silent> <A-k> :wincmd k<CR>
nmap <silent> <A-j> :wincmd j<CR>
nmap <silent> <A-h> :wincmd h<CR>
nmap <silent> <A-l> :wincmd l<CR>
" SimpylFold
let g:SimpylFold_docstring_preview = 1
"ale
let g:ale_linters = {
\ 'python': ['pyls'],
\}
let g:ale_fixers = {
\ 'python': ['yapf'],
\ 'r': ['trim_whitespace', 'remove_trailing_lines'],
\}
let g:ale_sign_column_always = 1
"let g:ale_r_lintr_options = 'lintr::with_defaults(line_length_linter = lintr::line_length_linter(100))'
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
nmap <F9> <Plug>(ale_fix)
"Nvim-R config
if $DISPLAY != ""
let R_openpdf = 1
endif
let r_syntax_folding = 1
let rrst_syn_hl_chunk = 1
let rmd_syn_hl_chunk = 1
"let R_objbr_place = 'console,top'
let R_objbr_h = 15
let R_hi_fun_paren = 1
let Rout_more_colors = 1
au TermOpen * setlocal nonu
"indentguides
let g:indentguides_firstlevel = 1
let g:indentguides_ignorelist = ['text', 'rmd', 'markdown', 'tex', 'rmarkdown', 'pandoc', 'nerdtree']
let g:indentguides_spacechar = '¦'
let g:indentguides_tabchar = '¦'
" let g:indentguides_conceal_color = 'ctermfg=238 ctermbg=234 guifg=#4e4e4e guibg=NONE'
"pandoc
let g:pandoc#folding#fold_yaml = 1
"ultisnips
let g:snips_author = "Fei Qi"
let g:snips_email = "qifei9@gmail.com"
let g:snips_github = "https://github.com/qifei9"
endfInstalled plugin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94[custom plugin] [thaerkh/vim-indentguides] [lazy loaded] [{'name': 'thaerkh/vim-indentguides', 'merged': 0}]
[custom plugin] [airblade/vim-gitgutter] [lazy loaded] [{'name': 'airblade/vim-gitgutter', 'merged': 0}]
[custom plugin] [jalvesaq/Nvim-R] [lazy loaded] [{'name': 'jalvesaq/Nvim-R', 'merged': 0}]
[custom plugin] [vim-pandoc/vim-pandoc-syntax] [lazy loaded] [{'name': 'vim-pandoc/vim-pandoc-syntax', 'merged': 0}]
[custom plugin] [vim-pandoc/vim-pandoc] [lazy loaded] [{'name': 'vim-pandoc/vim-pandoc', 'merged': 0}]
[custom plugin] [Konfekt/FastFold] [lazy loaded] [{'name': 'Konfekt/FastFold', 'merged': 0}]
[custom plugin] [tmhedberg/SimpylFold] [lazy loaded] [{'name': 'tmhedberg/SimpylFold', 'merged': 0}]
[custom plugin] [sheerun/vim-polyglot] [lazy loaded] [{'name': 'sheerun/vim-polyglot', 'merged': 0}]
[tools] [gregsexton/VimCalc] [lazy loaded] [{'on_cmd': 'Calc'}]
[tools] [MattesGroeger/vim-bookmarks] [lazy loaded] [{'on_map': '<Plug>Bookmark', 'loadconf_before': 1, 'on_cmd': 'BookmarkShowAll'}]
[tools] [junegunn/goyo.vim] [lazy loaded] [{'loadconf': 1, 'on_cmd': 'Goyo'}]
[tools] [junegunn/limelight.vim] [lazy loaded] [{'on_cmd': 'Limelight'}]
[tools] [itchyny/calendar.vim] [lazy loaded] [{'on_cmd': 'Calendar'}]
[tools] [wsdjeg/SourceCounter.vim] [lazy loaded] [{'on_cmd': 'SourceCounter'}]
[tools] [wsdjeg/Mysql.vim] [lazy loaded] [{'on_cmd': 'SQLGetConnection'}]
[tools] [wsdjeg/vim-cheat] [lazy loaded] [{'on_cmd': 'Cheat'}]
[tools] [simnalamburt/vim-mundo] [lazy loaded] [{'on_cmd': 'MundoToggle'}]
[tools] [mbbill/fencview] [lazy loaded] [{'on_cmd': 'FencAutoDetect'}]
[tools] [junegunn/rainbow_parentheses.vim] [lazy loaded] [{'on_cmd': 'RainbowParentheses'}]
[tools] [lymslive/vnote] [lazy loaded] [{'depends..': ['NoteBook', 'NoteNew', 'NoteEdit', 'NoteList', 'NoteConfig', 'NoteIndex', 'NoteImport']}]
[tools] [lymslive/vimloo] [lazy loaded] [{'merged': 0}]
[tools] [tpope/vim-scriptease] [lazy loaded] [{'merged': 0}]
[lsp] [autozimu/LanguageClient-neovim] [lazy loaded] [{'if': 1, 'merged': 0}]
[lang#python] [tell-k/vim-autoflake] [lazy loaded] [{'merged': 0}]
[lang#python] [Vimjas/vim-python-pep8-indent] [lazy loaded] [{'on_ft': 'python'}]
[lang#python] [heavenshell/vim-pydocstring] [lazy loaded] [{'on_cmd': 'Pydocstring'}]
[lang#markdown] [lvht/tagbar-markdown] [lazy loaded] [{'merged': 0}]
[lang#markdown] [iamcco/markdown-preview.vim] [lazy loaded] [{'depends': 'open-browser.vim', 'on_ft': 'markdown'}]
[lang#markdown] [iamcco/mathjax-support-for-mkdp] [lazy loaded] [{'on_ft': 'markdown'}]
[lang#markdown] [mzlogin/vim-markdown-toc] [lazy loaded] [{'on_ft': 'markdown'}]
[lang#markdown] [joker1007/vim-markdown-quote-syntax] [lazy loaded] [{'on_ft': 'markdown'}]
[lang#markdown] [SpaceVim/vim-markdown] [lazy loaded] [{'on_ft': 'markdown'}]
[debug] [idanarye/vim-vebugger] [lazy loaded] [{'merged': 0}]
[colorscheme] [SpaceVim/vim-material] [lazy loaded] [{'merged': 0}]
[colorscheme] [w0ng/vim-hybrid] [lazy loaded] [{'merged': 0}]
[colorscheme] [icymind/NeoSolarized] [lazy loaded] [{'merged': 0}]
[colorscheme] [arcticicestudio/nord-vim] [lazy loaded] [{'merged': 0}]
[colorscheme] [rakr/vim-one] [lazy loaded] [{'merged': 0}]
[colorscheme] [nanotech/jellybeans.vim] [lazy loaded] [{'merged': 0}]
[colorscheme] [joshdick/onedark.vim] [lazy loaded] [{'merged': 0}]
[colorscheme] [Gabirel/molokai] [lazy loaded] [{'merged': 0}]
[chinese] [ianva/vim-youdao-translater] [lazy loaded] [{'on_cmd': ['Ydv', 'Ydc', 'Yde']}]
[chinese] [yianwillis/vimcdoc] [lazy loaded] [{'merged': 0}]
[VersionControl] [tpope/vim-fugitive] [lazy loaded] [{'merged': 0}]
[VersionControl] [mhinz/vim-signify] [lazy loaded] [{'merged': 0}]
[shell] [Shougo/vimshell.vim] [lazy loaded] [{'on_cmd': ['VimShell']}]
[shell] [Shougo/deol.nvim]
[core] [mhinz/vim-grepper] [lazy loaded] [{'loadconf': 1, 'on_cmd': 'Grepper'}]
[core] [tpope/vim-projectionist] [lazy loaded] [{'on_cmd': ['A', 'AS', 'AV', 'AT', 'AD', 'Cd', 'Lcd', 'ProjectDo']}]
[core] [tyru/open-browser.vim] [lazy loaded] [{'loadcon..ug>(openbrowser-', 'on_cmd': ['OpenBrowserSmartSearch', 'OpenBrowser', 'OpenBrowserSearch']}]
[core] [morhetz/gruvbox] [lazy loaded] [{'loadconf': 1, 'merged': 0}]
[core] [andymass/vim-matchup]
[core] [scrooloose/nerdcommenter] [lazy loaded] [{'loadconf': 1}]
[core] [rhysd/clever-f.vim]
[core] [Shougo/vimproc.vim] [lazy loaded] [{'build': ['make']}]
[core] [Shougo/unite.vim] [lazy loaded] [{'loadconf': 1, 'merged': 0}]
[core] [Shougo/vimfiler.vim] [lazy loaded] [{'loadconf': 1, 'loadconf_before': 1, 'on_cmd': ['VimFiler', 'VimFilerBufferDir'], 'merged': 0}]
[ui] [mhinz/vim-startify] [lazy loaded] [{'loadconf': 1, 'merged': 0}]
[ui] [t9md/vim-choosewin] [lazy loaded] [{'merged': 0}]
[ui] [tenfyzhong/tagbar-proto.vim] [lazy loaded] [{'merged': 0}]
[ui] [tenfyzhong/tagbar-makefile.vim] [lazy loaded] [{'merged': 0}]
[ui] [majutsushi/tagbar] [lazy loaded] [{'loadconf': 1}]
[ui] [Yggdroot/indentLine] [lazy loaded] [{'merged': 0}]
[edit] [lilydjwg/fcitx.vim] [lazy loaded] [{'on_event': 'InsertEnter'}]
[edit] [ntpeters/vim-better-whitespace] [lazy loaded] [{'on_cmd': 'StripWhitespace'}]
[edit] [godlygeek/tabular] [lazy loaded] [{'on_cmd': 'Tabularize'}]
[edit] [osyo-manga/vim-jplus] [lazy loaded] [{'on_map': '<Plug>(jplus'}]
[edit] [editorconfig/editorconfig-vim] [lazy loaded] [{'merged': 0}]
[edit] [haya14busa/vim-easyoperator-line]
[edit] [easymotion/vim-easymotion]
[edit] [gcmt/wildfire.vim] [lazy loaded] [{'on_map': '<Plug>(wildfire-'}]
[edit] [kana/vim-textobj-entire]
[edit] [kana/vim-textobj-line]
[edit] [kana/vim-textobj-indent]
[edit] [kana/vim-textobj-user]
[edit] [terryma/vim-expand-region] [lazy loaded] [{'loadconf': 1}]
[edit] [terryma/vim-multiple-cursors] [lazy loaded] [{'loadconf': 1, 'merged': 0}]
[edit] [junegunn/vim-emoji]
[edit] [tpope/vim-repeat]
[edit] [tpope/vim-surround]
[format] [sbdchd/neoformat] [lazy loaded] [{'loadconf': 1, 'loadconf_before': 1, 'merged': 0}]
[checkers] [w0rp/ale] [lazy loaded] [{'loadconf_before': 1, 'merged': 0}]
[autocomplete] [tenfyzhong/CompleteParameter.vim] [lazy loaded] [{'merged': 0}]
[autocomplete] [Shougo/echodoc.vim] [lazy loaded] [{'on_event': 'CompleteDone', 'loadconf_before': 1, 'on_cmd': ['EchoDocEnable', 'EchoDocDisable']}]
[autocomplete] [Shougo/deoplete.nvim] [lazy loaded] [{'loadconf': 1, 'on_event': 'InsertEnter'}]
[autocomplete] [SirVer/ultisnips] [lazy loaded] [{'loadconf_before': 1, 'merged': 0}]
[autocomplete] [Raimondi/delimitMate] [lazy loaded] [{'merged': 0}]
[autocomplete] [Shougo/neopairs.vim] [lazy loaded] [{'on_event': 'InsertEnter'}]
[autocomplete] [Shougo/neosnippet-snippets] [lazy loaded] [{'merged': 0}]
[autocomplete] [Shougo/neoinclude.vim] [lazy loaded] [{'on_event': 'InsertEnter'}]
[autocomplete] [Shougo/context_filetype.vim] [lazy loaded] [{'on_event': 'InsertEnter'}]
[autocomplete] [ujihisa/neco-look] [lazy loaded] [{'on_event': 'InsertEnter'}]
[autocomplete] [Shougo/neco-syntax] [lazy loaded] [{'on_event': 'InsertEnter'}]
[autocomplete] [honza/vim-snippets] [lazy loaded] [{'on_event': 'InsertEnter', 'loadconf_before': 1}]