mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 05:20:04 +08:00
485 lines
15 KiB
Plaintext
485 lines
15 KiB
Plaintext
*SpaceVim.txt* Like spacemacs, but for vim
|
|
wsdjeg *Maktaba* *SpaceVim*
|
|
|
|
==============================================================================
|
|
CONTENTS *SpaceVim-contents*
|
|
1. Introduction.............................................|SpaceVim-intro|
|
|
2. Configuration...........................................|SpaceVim-config|
|
|
3. Functions............................................|SpaceVim-functions|
|
|
4. Layers..................................................|SpaceVim-layers|
|
|
5. Autocomplete......................................|SpaceVim-autocomplete|
|
|
6. Colorscheme........................................|SpaceVim-colorscheme|
|
|
7. Layer_lang_java................................|SpaceVim-layer_lang_java|
|
|
8. Layer_lang_php..................................|SpaceVim-layer_lang_php|
|
|
9. Layer_lang_c......................................|SpaceVim-layer_lang_c|
|
|
10. layer-lang-rust...............................|SpaceVim-layer-lang-rust|
|
|
11. FAQ.......................................................|SpaceVim-faq|
|
|
|
|
==============================================================================
|
|
INTRODUCTION *SpaceVim-intro*
|
|
|
|
SpaceVim is a Modular configuration, a bundle of custom settings and
|
|
plugins, for Vim. It got inspired by spacemacs.
|
|
|
|
==============================================================================
|
|
CONFIGURATION *SpaceVim-config*
|
|
|
|
*g:spacevim_default_indent*
|
|
Change the default indent of SpaceVim. default is 2.
|
|
>
|
|
let g:spacevim_default_indent = 2
|
|
<
|
|
|
|
*g:spacevim_max_column*
|
|
Change the max column of SpaceVim, default is 120.
|
|
>
|
|
let g:spacevim_max_column = 120
|
|
<
|
|
|
|
*g:spacevim_enable_guicolors*
|
|
Enable true color support in terminal.
|
|
>
|
|
let g:spacevim_enable_guicolors = 1
|
|
<
|
|
|
|
*g:spacevim_enable_googlesuggest*
|
|
Enable/Disable google suggestion for neocomplete. by default it is Disabled.
|
|
you can enable it by:
|
|
>
|
|
let g:spacevim_enable_googlesuggest = 1
|
|
<
|
|
|
|
*g:spacevim_windows_leader*
|
|
Windows function leader of SpaceVim, default is `s`, set to empty to disable
|
|
this feature, or you can set to other char.
|
|
>
|
|
let g:spacevim_windows_leader = ''
|
|
<
|
|
|
|
*g:spacevim_unite_leader*
|
|
Unite work flow leader of SpaceVim, default is `f`, set to empty to disable
|
|
this feature, or you can set to other char.
|
|
|
|
*g:spacevim_plugin_bundle_dir*
|
|
Set the cache dir of plugins, by default, it is `~/.cache/vimfiles`. you can
|
|
set it by:
|
|
>
|
|
let g:spacevim_plugin_bundle_dir = '~/.cache/vimplugs'
|
|
<
|
|
|
|
*g:spacevim_realtime_leader_guide*
|
|
Disable/Enable realtime leader guide, by default it is 0. to enable this
|
|
feature:
|
|
>
|
|
let g:spacevim_realtime_leader_guide = 1
|
|
<
|
|
|
|
*g:spacevim_guifont*
|
|
set the guifont of Spacevim, default is empty.
|
|
>
|
|
let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
|
|
<
|
|
|
|
*g:spacevim_enable_ycm*
|
|
Disable/Enable YouCompleteMe, by default it is disabled. To enable it:
|
|
>
|
|
let g:spacevim_enable_ycm = 1
|
|
<
|
|
|
|
*g:spacevim_enable_cursorline*
|
|
Enable cursorline
|
|
>
|
|
let g:spacevim_enable_cursorline = 1
|
|
<
|
|
|
|
*g:spacevim_error_symbol*
|
|
Set the error symbol of SpaceVim's syntax maker. example:
|
|
>
|
|
let g:spacevim_error_symbol = '+'
|
|
<
|
|
|
|
*g:spacevim_warning_symbol*
|
|
Set the warning symbol of SpaceVim's syntax maker. example:
|
|
>
|
|
let g:spacevim_warning_symbol = '!'
|
|
<
|
|
|
|
*g:spacevim_vim_help_language*
|
|
Set the help language of vim. By default it is `en`, you can change it to
|
|
chinese.
|
|
>
|
|
let g:spacevim_vim_help_language = 'chinese'
|
|
<
|
|
|
|
*g:spacevim_colorscheme*
|
|
The colorscheme of SpaceVim, if colorscheme groups are installed.
|
|
|
|
*g:spacevim_colorscheme_default*
|
|
The default colorscheme of SpaceVim. By default SpaceVim use desert, if
|
|
colorscheme which name is the value of g:spacevim_colorscheme has not been
|
|
installed.you can change it in custom config file.
|
|
>
|
|
let g:spacevim_colorscheme_default = 'other_color'
|
|
<
|
|
|
|
*g:spacevim_simple_mode*
|
|
Disable/Enable simple mode of SpaceVim, in this mode, only few plugins will be
|
|
installed.
|
|
>
|
|
let g:spacevim_simple_mode = 1
|
|
<
|
|
|
|
*g:spacevim_filemanager*
|
|
The default file manager of SpaceVim.
|
|
|
|
*g:spacevim_plugin_manager*
|
|
The default plugin manager of SpaceVim, dein, neobundle or vim-plug. by
|
|
default it is dein.
|
|
|
|
*g:spacevim_checkinstall*
|
|
Enable/Disable checkinstall on SpaceVim startup. by default is 1.
|
|
|
|
To disable it:
|
|
>
|
|
let g:spacevim_checkinstall = 0
|
|
<
|
|
|
|
*g:spacevim_enable_debug*
|
|
Enable/Disable debug mode for SpaceVim, by default it is disabled.
|
|
|
|
to enable it:
|
|
>
|
|
let g:spacevim_enable_debug = 1
|
|
<
|
|
|
|
*g:spacevim_debug_level*
|
|
Set the debug level of SpaceVim, by default it is 1.
|
|
|
|
*g:spacevim_plugin_groups*
|
|
groups of plugins should be loaded.
|
|
|
|
example:
|
|
>
|
|
let g:spacevim_plugin_groups = ['core', 'lang']
|
|
<
|
|
now Space Vim support these groups:
|
|
|
|
*g:spacevim_disabled_plugins*
|
|
Disable plugins by names. example:
|
|
>
|
|
let g:spacevim_disabled_plugins = ['vim-foo', 'vim-bar']
|
|
<
|
|
|
|
*g:spacevim_custom_plugins*
|
|
Add custom plugins
|
|
>
|
|
let g:spacevim_custom_plugins = [
|
|
\ ['plasticboy/vim-markdown', 'on_ft' : 'markdown'],
|
|
\ ['wsdjeg/GitHub.vim'],
|
|
\ ]
|
|
<
|
|
|
|
*g:spacevim_force_global_config*
|
|
SpaceVim will load global config after local config if set to 1. by default it
|
|
is 0, if you has local config, the global config will not be loaded.
|
|
>
|
|
let g:spacevim_force_global_config = 1
|
|
<
|
|
|
|
*g:spacevim_enable_powerline_fonts*
|
|
enable/disable SpaceVim with powerline symbols.
|
|
|
|
*g:spacevim_lint_on_save*
|
|
Enable/Disable lint on save feature of SpaceVim's maker.
|
|
|
|
To disable lint on save:
|
|
>
|
|
let g:spacevim_lint_on_save = 0
|
|
<
|
|
|
|
*g:spacevim_hosts_url*
|
|
The host file url. this option is for chinese users who can not use google and
|
|
twitter.
|
|
|
|
==============================================================================
|
|
FUNCTIONS *SpaceVim-functions*
|
|
|
|
SpaceVim#layers#load({layer}) *SpaceVim#layers#load()*
|
|
Load the {layer} you want, for all the layers SpaceVim supported, see
|
|
|SpaceVim-layers|.
|
|
|
|
SpaceVim#logger#setLevel({level}) *SpaceVim#logger#setLevel()*
|
|
Set debug level of SpaceVim, by default it is 1. all message will be logged.
|
|
|
|
1 : log all the message.
|
|
|
|
2 : log warning and error message
|
|
|
|
3 : log error message only
|
|
|
|
SpaceVim#logger#setOutput({file}) *SpaceVim#logger#setOutput()*
|
|
Set log output file of SpaceVim. by default it is
|
|
`~/.SpaceVim/.SpaceVim.log`
|
|
|
|
==============================================================================
|
|
LAYERS *SpaceVim-layers*
|
|
|
|
SpaceVim support such layers:
|
|
|
|
==============================================================================
|
|
AUTOCOMPLETE *SpaceVim-autocomplete*
|
|
|
|
SpaceVim use neocomplete as default completion engine for vim with lua
|
|
support, if has no lua support neocomplcache will be the completion engine.
|
|
SpaceVim use deoplete as default completion engine for nevoim. to make neovim
|
|
support python, please read neovim's |provider-python|.
|
|
|
|
SpaceVim include YouCompleteMe, but it is disabled by default, to enable ycm,
|
|
see |g:spacevim_enable_ycm|.
|
|
|
|
==============================================================================
|
|
COLORSCHEME *SpaceVim-colorscheme*
|
|
|
|
SpaceVim default colorscheme is gruvbox, you can change it by set spacevim
|
|
option. add this to your `~/.SpaceVim.d/init.vim`
|
|
>
|
|
let g:spacevim_colorscheme = 'solarized'
|
|
<
|
|
|
|
colorschemes: if the colorscheme you want do not list below, PR welcome.
|
|
>
|
|
gruvbox
|
|
hybrid-material
|
|
solarized
|
|
zellner
|
|
yowish
|
|
wombat256mod
|
|
twilight256
|
|
torte
|
|
solarized
|
|
slate
|
|
shine
|
|
seoul256-light
|
|
seoul256
|
|
scheakur
|
|
ron
|
|
rdark-terminal2
|
|
pyte
|
|
peachpuff
|
|
parsec
|
|
pablo
|
|
onedark
|
|
murphy
|
|
morning
|
|
molokayo
|
|
molokai
|
|
lucius
|
|
lightning
|
|
koehler
|
|
jellybeans
|
|
janah
|
|
industry
|
|
hybrid_reverse
|
|
hybrid_material
|
|
hybrid
|
|
gruvbox
|
|
focuspoint
|
|
flattened_light
|
|
flattened_dark
|
|
flatcolor
|
|
evening
|
|
elflord
|
|
desert
|
|
delek
|
|
default
|
|
darkblue
|
|
blue
|
|
base16-woodland
|
|
base16-unikitty-light
|
|
base16-unikitty-dark
|
|
base16-twilight
|
|
base16-tomorrow-night
|
|
base16-tomorrow
|
|
base16-summerfruit-light
|
|
base16-summerfruit-dark
|
|
base16-spacemacs
|
|
base16-solarized-light
|
|
base16-solarized-dark
|
|
base16-solar-flare
|
|
base16-shapeshifter
|
|
base16-seti-ui
|
|
base16-railscasts
|
|
base16-pop
|
|
base16-pico
|
|
base16-phd
|
|
base16-paraiso
|
|
base16-onedark
|
|
base16-oceanicnext
|
|
base16-ocean
|
|
base16-monokai
|
|
base16-mocha
|
|
base16-mexico-light
|
|
base16-materia
|
|
base16-marrakesh
|
|
base16-macintosh
|
|
base16-london-tube
|
|
base16-isotope
|
|
base16-ir-black
|
|
base16-hopscotch
|
|
base16-harmonic16-light
|
|
base16-harmonic16-dark
|
|
base16-green-screen
|
|
base16-grayscale-light
|
|
base16-grayscale-dark
|
|
base16-google-light
|
|
base16-google-dark
|
|
base16-github
|
|
base16-flat
|
|
base16-embers
|
|
base16-eighties
|
|
base16-dracula
|
|
base16-default-light
|
|
base16-default-dark
|
|
base16-darktooth
|
|
base16-cupcake
|
|
base16-codeschool
|
|
base16-chalk
|
|
base16-bright
|
|
base16-brewer
|
|
base16-bespin
|
|
base16-atelier-sulphurpool
|
|
base16-atelier-seaside
|
|
base16-atelier-savanna
|
|
base16-atelier-plateau
|
|
base16-atelier-lakeside
|
|
base16-atelier-heath
|
|
base16-atelier-forest
|
|
base16-atelier-estuary
|
|
base16-atelier-dune
|
|
base16-atelier-cave
|
|
base16-ashes
|
|
base16-apathy
|
|
base16-3024
|
|
atom
|
|
apprentice
|
|
anderson
|
|
PaperColor
|
|
OceanicNextLight
|
|
OceanicNext
|
|
<
|
|
|
|
==============================================================================
|
|
LAYER_LANG_JAVA *SpaceVim-layer_lang_java*
|
|
|
|
This layer is for java development.
|
|
>
|
|
import-mappings:
|
|
mode key function
|
|
normal <F4> import class under corsor.
|
|
insert <F4> import class under corsor.
|
|
normal <leader>jI import missing classes.
|
|
normal <leader>jR remove unused imports.
|
|
normal <leader>ji smart import class under corsor.
|
|
normal <leader>jii same as <F4>
|
|
insert <c-j>I import missing imports.
|
|
insert <c-j>R remove unused imports.
|
|
insert <c-j>i smart import class under corsor.
|
|
insert <c-j>ii add import for class under corsor.
|
|
|
|
generate-mappings:
|
|
mode key function
|
|
normal <leader>jA generate accessors.
|
|
normal <leader>js generate setter accessor.
|
|
normal <leader>jg generate getter accessor.
|
|
normal <leader>ja generate setter and getter accessor.
|
|
normal <leader>jts generate toString function.
|
|
normal <leader>jeq generate equals and hashcode function.
|
|
normal <leader>jc generate constructor.
|
|
normal <leader>jcc generate default constructor.
|
|
insert <c-j>s generate setter accessor.
|
|
insert <c-j>g generate getter accessor.
|
|
insert <c-j>a generate getter and setter accessor.
|
|
visual <leader>js generate setter accessor.
|
|
visual <leader>jg generate getter accessor.
|
|
visual <leader>ja generate setter and getter acctssor.
|
|
<
|
|
|
|
|
|
==============================================================================
|
|
LAYER_LANG_PHP *SpaceVim-layer_lang_php*
|
|
|
|
lang#php :
|
|
|
|
this layer is for php development, and it provide auto codo completion, and
|
|
syntax check, and jump to the definition location.
|
|
|
|
requirement:
|
|
|
|
PHP 5.3+
|
|
|
|
PCNTL Extension
|
|
|
|
Msgpack 0.5.7+(for NeoVim) Extension or JSON(for Vim 7.4+) Extension
|
|
|
|
Composer Project
|
|
|
|
|
|
==============================================================================
|
|
LAYER_LANG_C *SpaceVim-layer_lang_c*
|
|
|
|
lang#c :
|
|
|
|
this layer provide c family language code completion.
|
|
|
|
requirement: clang libclang
|
|
|
|
==============================================================================
|
|
LAYER-LANG-RUST *SpaceVim-layer-lang-rust*
|
|
|
|
requirement:
|
|
1. racer : cargo install racer
|
|
2. export RUST_SRC_PATH : you can download src by : rustup component add
|
|
rust-src, and add below into your bashrc.
|
|
|
|
export RUST_SRC_PATH=~/.multirust/toolchains/[your-toolchain]/lib/rustlib/src/
|
|
rust/src
|
|
|
|
configuration:
|
|
1. add `let g:racer_cmd = "/path/to/racer/bin"` in to custom config, if you
|
|
has racer executable in you PATH. g:racer_cmd should be auto detect.
|
|
|
|
mappings:
|
|
>
|
|
mode key function
|
|
normal gd rust-definition
|
|
normal gs rust-definition-split
|
|
normal gx rust-definition-vertical
|
|
normal <leader>gd rust-doc
|
|
<
|
|
|
|
==============================================================================
|
|
FAQ *SpaceVim-faq*
|
|
|
|
1. How to enable YouCompleteMe? (I do not recommend to use YouCompleteMe, it
|
|
is too big as a vim plugin, BTW I do not like using submodule in vim plugin,
|
|
it is hard to manager by vim plugin manager.)
|
|
|
|
|
|
>
|
|
step 1: add `let g:spacevim_enable_ycm = 1` to custom_config, by default it
|
|
should be `~/.SpaceVim.d/init.vim`.
|
|
|
|
step 2: Get into the directory of YouCompleteMe's author, by default it
|
|
should be `~/.cache/vimfiles/repos/github.com/Valloric/`, If you find the
|
|
directory `YouCompleteMe` in it, just get into it, otherwise clone
|
|
YouCompleteMe repo by
|
|
`git clone https://github.com/Valloric/YouCompleteMe.git`, after cloning,
|
|
get into it, run `git submodule update --init --recursive`.
|
|
|
|
step 3: compile YouCompleteMe with the feature you want. if you just want
|
|
support c family, you need run `./install.py --clang-completer`.
|
|
<
|
|
|
|
|
|
vim:tw=78:ts=8:ft=help:norl:
|