1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:20:06 +08:00
SpaceVim/autoload/SpaceVim.vim

973 lines
27 KiB
VimL
Raw Normal View History

2017-03-02 22:20:46 +08:00
"=============================================================================
" SpaceVim.vim --- Initialization and core files for SpaceVim
" Copyright (c) 2016-2017 Shidong Wang & Contributors
" Author: Shidong Wang < wsdjeg at 163.com >
2017-03-06 23:39:03 +08:00
" URL: https://spacevim.org
2018-02-15 22:25:03 +08:00
" License: GPLv3
2017-03-02 22:20:46 +08:00
"=============================================================================
2017-01-02 10:38:23 +08:00
""
" @section Introduction, intro
2017-02-10 00:02:00 +08:00
" @stylized spacevim
2017-01-10 21:00:14 +08:00
" @library
2018-06-10 23:30:02 +08:00
" @order intro options config layers api faq changelog
" SpaceVim is a bundle of custom settings and plugins with a modular
" configuration for Vim. It was inspired by Spacemacs.
2017-01-27 21:49:05 +08:00
"
""
" @section Options, options
" SpaceVim uses `~/.SpaceVim.d/init.toml` as its default global config file.
2017-03-19 22:00:27 +08:00
" You can set all the SpaceVim options and layers in it. `~/.SpaceVim.d/` will
" also be added to runtimepath, so you can write your own scripts in it.
" SpaceVim also supports local config for each project. Place local config
" settings in `.SpaceVim.d/init.toml` in the root directory of your project.
2017-01-27 21:49:05 +08:00
" `.SpaceVim.d/` will also be added to runtimepath.
2018-06-10 23:30:02 +08:00
"
" here is an example setting SpaceVim options:
" >
" [options]
" enable-guicolors = true
" max-column = 120
" <
2017-01-02 10:38:23 +08:00
""
" @section Configuration, config
2018-06-15 20:41:11 +08:00
" If you still want to use `~/.SpaceVim.d/init.vim` as configuration file,
" please check bellowing options.
"
" Public SpaceVim Options {{{
scriptencoding utf-8
2017-01-04 23:53:49 +08:00
""
" Version of SpaceVim , this value can not be changed.
let g:spacevim_version = '0.9.0-dev'
2017-01-04 23:53:49 +08:00
lockvar g:spacevim_version
2018-06-15 20:41:11 +08:00
""
" @section default_indent, options-default_indent
" @parentsection options
" Change the default indentation of SpaceVim. Default is 2.
" >
" default_indent = 2
" <
2017-01-02 10:38:23 +08:00
""
" Change the default indentation of SpaceVim. Default is 2.
2017-01-03 00:27:11 +08:00
" >
" let g:spacevim_default_indent = 2
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_default_indent = 2
""
2018-04-01 21:13:49 +08:00
" In Insert mode: Use the appropriate number of spaces to insert a <Tab>
let g:spacevim_expand_tab = 1
2018-06-10 23:30:02 +08:00
""
" @section relativenumber, options-relativenumber
" @parentsection options
" Enable/Disable relativenumber, by default it is enabled.
" >
" relativenumber = true
" <
2018-04-01 21:13:49 +08:00
""
2017-06-27 15:31:34 +08:00
" Enable/Disable relativenumber, by default it is enabled.
let g:spacevim_relativenumber = 1
2018-06-10 23:30:02 +08:00
""
" @section max_column, options-max_column
" @parentsection options
" Change the max number of columns for SpaceVim. Default is 120.
" >
" max_column = 120
" <
2017-06-27 15:31:34 +08:00
""
" Change the max number of columns for SpaceVim. Default is 120.
2017-01-03 00:27:11 +08:00
" >
" let g:spacevim_max_column = 120
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_max_column = 120
2018-06-10 23:30:02 +08:00
""
" @section enable_guicolors, options-enable_guicolors
" @parentsection options
" Enable true color support in terminal. Default is true.
" >
" enable_guicolors = true
" <
2017-01-03 00:27:11 +08:00
""
" Enable true color support in terminal. Default is 1.
" >
" let g:spacevim_enable_guicolors = 1
" <
let g:spacevim_enable_guicolors = 1
2018-06-10 23:30:02 +08:00
""
" @section enable_googlesuggest, options-enable_googlesuggest
" @parentsection options
" Enable/Disable Google suggestions for neocomplete. Default is false.
" >
" enable_googlesuggest = false
" <
""
" Enable/Disable Google suggestions for neocomplete. Default is 0.
2017-01-03 00:27:11 +08:00
" >
" let g:spacevim_enable_googlesuggest = 1
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_enable_googlesuggest = 0
2018-06-10 23:30:02 +08:00
""
" @section windows_leader, options-windows_leader
" @parentsection options
" Window functions leader for SpaceVim. Default is `s`.
" Set to empty to disable this feature, or you can set to another char.
" >
" windows_leader = ""
" <
2017-01-11 23:00:28 +08:00
""
" Window functions leader for SpaceVim. Default is `s`.
" Set to empty to disable this feature, or you can set to another char.
2017-01-11 23:00:28 +08:00
" >
" let g:spacevim_windows_leader = ''
" <
let g:spacevim_windows_leader = 's'
2018-06-10 23:30:02 +08:00
""
" @section enable_insert_leader, options-enable_insert_leader
" @parentsection options
" Enable/Disable spacevim's insert mode leader, default is enable
""
" Enable/Disable spacevim's insert mode leader, default is enable
let g:spacevim_enable_insert_leader = 1
2018-06-10 23:30:02 +08:00
""
" @section plugin_bundle_dir, options-plugin_bundle_dir
" @parentsection options
" Set the cache directory of plugins. Default is `~/.cache/vimfiles`.
" >
" plugin_bundle_dir = "~/.cache/vimplugs"
" <
""
" Set the cache directory of plugins. Default is `~/.cache/vimfiles`.
" >
" let g:spacevim_plugin_bundle_dir = '~/.cache/vimplugs'
" <
2017-03-07 22:11:41 +08:00
let g:spacevim_plugin_bundle_dir
\ = $HOME. join(['', '.cache', 'vimfiles', ''],
\ SpaceVim#api#import('file').separator)
2018-06-10 23:30:02 +08:00
""
" @section realtime_leader_guide, options-realtime_leader_guide
" @parentsection options
" Enable/Disable realtime leader guide. Default is true. to disable it:
" >
" realtime_leader_guide = false
" <
2017-01-15 19:50:56 +08:00
""
" Enable/Disable realtime leader guide. Default is 1. to disable it:
2017-01-15 19:50:56 +08:00
" >
" let g:spacevim_realtime_leader_guide = 0
2017-01-15 19:50:56 +08:00
" <
let g:spacevim_realtime_leader_guide = 1
2017-04-03 12:52:09 +08:00
""
2017-04-03 13:12:35 +08:00
" Enable/Disable key frequency catching of SpaceVim. default value is 0. to
" enable it:
" >
" let g:spacevim_enable_key_frequency = 1
" <
let g:spacevim_enable_key_frequency = 0
if (has('python3') && SpaceVim#util#haspy3lib('neovim')) &&
\ (has('nvim') || (has('patch-8.0.0027')))
2017-11-23 10:39:06 +08:00
""
" Set the autocomplete engine of spacevim, the default logic is:
" >
" if has('python3')
" let g:spacevim_autocomplete_method = 'deoplete'
" elseif has('lua')
" let g:spacevim_autocomplete_method = 'neocomplete'
" elseif has('python')
" let g:spacevim_autocomplete_method = 'completor'
" elseif has('timers')
" let g:spacevim_autocomplete_method = 'asyncomplete'
" else
" let g:spacevim_autocomplete_method = 'neocomplcache'
" endif
" <
let g:spacevim_autocomplete_method = 'deoplete'
elseif has('lua')
let g:spacevim_autocomplete_method = 'neocomplete'
2018-04-09 22:05:21 +08:00
elseif has('python') && ((has('job') && has('timers') && has('lambda')) || has('nvim'))
2017-11-23 10:39:06 +08:00
let g:spacevim_autocomplete_method = 'completor'
elseif has('timers')
let g:spacevim_autocomplete_method = 'asyncomplete'
else
let g:spacevim_autocomplete_method = 'neocomplcache'
endif
2018-06-10 23:30:02 +08:00
""
" @section enable_neomake, options-enable_neomake
" @parentsection options
" SpaceVim default checker is neomake. If you want to use syntastic, use:
" >
" enable_neomake = false
" <
""
" SpaceVim default checker is neomake. If you want to use syntastic, use:
" >
" let g:spacevim_enable_neomake = 0
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_enable_neomake = 1
2018-06-10 23:30:02 +08:00
""
" @section enable_ale, options-enable_ale
" @parentsection options
" Use ale for syntax checking, disabled by default.
" >
" enable_ale = true
" <
2017-01-02 10:38:23 +08:00
""
2017-10-25 09:41:04 +08:00
" Use ale for syntax checking, disabled by default.
" >
" let g:spacevim_enable_ale = 1
" <
let g:spacevim_enable_ale = 0
2018-06-10 23:30:02 +08:00
""
" @section guifont, options-guifont
" @parentsection options
" Set the guifont of SpaceVim. Default is empty.
" >
" guifont = "DejaVu\ Sans\ Mono\ for\ Powerline\ 11"
" <
2017-10-25 09:41:04 +08:00
""
" Set the guifont of SpaceVim. Default is empty.
2017-01-11 01:03:52 +08:00
" >
" let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_guifont = ''
2018-06-10 23:30:02 +08:00
""
" @section enable_ycm, options-enable_ycm
" @parentsection options
" Enable/Disable YouCompleteMe. Default is false.
" >
" enable_ycm = true
" <
2017-01-02 10:38:23 +08:00
""
" Enable/Disable YouCompleteMe. Default is 0.
2017-01-11 01:03:52 +08:00
" >
" let g:spacevim_enable_ycm = 1
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_enable_ycm = 0
2018-06-10 23:30:02 +08:00
""
" @section sidebar_width, options-sidebar_width
" @parentsection options
" Set the width of the SpaceVim sidebar. Default is 30.
" This value will be used by tagbar and vimfiler.
""
" Set the width of the SpaceVim sidebar. Default is 30.
" This value will be used by tagbar and vimfiler.
let g:spacevim_sidebar_width = 30
2018-06-10 23:30:02 +08:00
""
" @section snippet_engine, options-snippet_engine
" @parentsection options
" Set the snippet engine of SpaceVim, default is neosnippet. to enable
" ultisnips:
" >
" snippet_engine = "ultisnips"
" <
2017-04-02 19:39:42 +08:00
""
" Set the snippet engine of SpaceVim, default is neosnippet. to enable
" ultisnips:
" >
2018-06-10 23:30:02 +08:00
" let g:spacevim_snippet_engine = "ultisnips"
2017-04-02 19:39:42 +08:00
" <
let g:spacevim_snippet_engine = 'neosnippet'
2017-01-02 10:38:23 +08:00
let g:spacevim_enable_neocomplcache = 0
2017-01-11 01:03:52 +08:00
""
" Enable/Disable cursorline. Default is 1, cursorline will be
" highlighted in normal mode.To disable this feature:
2017-01-11 01:03:52 +08:00
" >
" let g:spacevim_enable_cursorline = 0
2017-01-11 01:03:52 +08:00
" <
let g:spacevim_enable_cursorline = 1
""
2017-05-19 20:45:03 +08:00
" Set the statusline separators of statusline, default is 'arrow'
2017-06-21 21:14:30 +08:00
" >
" Separators options:
2017-06-21 21:14:30 +08:00
" 1. arrow
" 2. curve
" 3. slant
" 4. nil
" 5. fire
" <
"
" See more details in: http://spacevim.org/documentation/#statusline
"
2017-05-19 20:45:03 +08:00
let g:spacevim_statusline_separator = 'arrow'
2017-07-21 06:05:51 +08:00
let g:spacevim_statusline_inactive_separator = 'arrow'
2017-11-19 09:29:34 +08:00
2017-11-19 10:18:32 +08:00
""
" Define the left section of statusline in active windows. By default:
" >
" let g:spacevim_statusline_left_sections =
" \ [
" \ 'winnr',
" \ 'filename',
" \ 'major mode',
" \ 'minor mode lighters',
" \ 'version control info'
" \ ]
" <
2018-01-18 20:34:43 +08:00
let g:spacevim_statusline_left_sections = ['winnr', 'filename', 'major mode',
\ 'syntax checking', 'minor mode lighters',
2018-03-12 21:00:24 +08:00
\ ]
2017-11-19 10:18:32 +08:00
""
" Define the right section of statusline in active windows. By default:
" >
2018-01-18 20:34:43 +08:00
" g:spacevim_statusline_right_sections =
" \ [
" \ 'fileformat',
" \ 'cursorpos',
" \ 'percentage'
" \ ]
2017-11-19 10:18:32 +08:00
" <
2017-11-19 10:54:12 +08:00
let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos', 'percentage']
2017-11-19 09:29:34 +08:00
2017-05-19 20:45:03 +08:00
""
" Enable/Disable unicode symbols in statusline
let g:spacevim_statusline_unicode_symbols = 1
""
2018-01-07 12:12:34 +08:00
" Enable/Disable language specific leader, by default you can use `,` ket
" instead of `SPC` `l`.
let g:spacevim_enable_language_specific_leader = 1
2018-06-10 23:30:02 +08:00
""
" @section enable_statusline_mode, options-enable_statusline_mode
2018-06-10 23:30:02 +08:00
" @parentsection options
" Enable/Disable display mode. Default is 0, mode will be
" displayed in statusline. To enable this feature:
" >
" enable_statusline_mode = true
2018-06-10 23:30:02 +08:00
" <
2018-01-07 12:12:34 +08:00
""
" Enable/Disable display mode. Default is 0, mode will be
" displayed in statusline. To enable this feature:
" >
" let g:spacevim_enable_statusline_mode = 1
" <
let g:spacevim_enable_statusline_mode = 0
""
2017-10-23 03:13:42 +08:00
" Set the statusline/tabline palette of color, default values depends on the theme
" >
" let g:spacevim_custom_color_palette = [
" \ ['#282828', '#b8bb26', 246, 235],
" \ ['#a89984', '#504945', 239, 246],
" \ ['#a89984', '#3c3836', 237, 246],
" \ ['#665c54', 241],
" \ ['#282828', '#83a598', 235, 109],
" \ ['#282828', '#fe8019', 235, 208],
" \ ['#282828', '#8ec07c', 235, 108],
" \ ['#282828', '#689d6a', 235, 72],
" \ ['#282828', '#8f3f71', 235, 132],
2017-10-23 03:13:42 +08:00
" \ ]
" <
"
let g:spacevim_custom_color_palette = []
""
2017-05-06 20:36:39 +08:00
" Enable/Disable cursorcolumn. Default is 0, cursorcolumn will be
" highlighted in normal mode. To enable this feature:
" >
2017-05-06 20:36:39 +08:00
" let g:spacevim_enable_cursorcolumn = 1
" <
2017-05-06 20:36:39 +08:00
let g:spacevim_enable_cursorcolumn = 0
2018-06-10 23:30:02 +08:00
""
" @section error_symbol, options-error_symbol
" @parentsection options
" Set the error symbol for SpaceVim's syntax maker. Default is '✖'.
" >
" error_symbol = "+"
" <
2017-01-02 10:38:23 +08:00
""
" Set the error symbol for SpaceVim's syntax maker. Default is '✖'.
" >
2017-01-19 20:41:06 +08:00
" let g:spacevim_error_symbol = '+'
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_error_symbol = '✖'
2017-01-19 20:41:06 +08:00
""
" Set the warning symbol for SpaceVim's syntax maker. Default is '⚠'.
" >
2017-01-19 20:41:06 +08:00
" let g:spacevim_warning_symbol = '!'
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_warning_symbol = '⚠'
2017-03-26 16:37:49 +08:00
""
" Set the information symbol for SpaceVim's syntax maker. Default is '🛈'.
" >
" let g:spacevim_info_symbol = 'i'
" <
2018-01-07 11:01:04 +08:00
let g:spacevim_info_symbol = SpaceVim#api#import('messletters').circled_letter('i')
""
2017-12-10 00:23:18 +08:00
" Set the SpaceVim cursor shape in the terminal.
" >
" 0 : to prevent Nvim from changing the cursor shape.
" 1 : to enable non-blinking mode-sensitive cursor.
" 2 : to enable blinking mode-sensitive cursor (default).
" >
" Host terminal must support the DECSCUSR CSI escape sequence.
2017-03-26 16:37:49 +08:00
" Depending on the terminal emulator, using this option with nvim under
" tmux might require adding the following to ~/.tmux.conf:
" >
" set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
" <
let g:spacevim_terminal_cursor_shape = 2
2017-01-19 20:41:06 +08:00
""
" Set the help language of vim. Default is 'en'.
" You can change it to Chinese.
2017-01-19 20:41:06 +08:00
" >
" let g:spacevim_vim_help_language = 'cn'
2017-01-19 20:41:06 +08:00
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_vim_help_language = 'en'
""
" Set the message language of vim. Default is 'en_US.UTF-8'.
2017-01-30 20:36:03 +08:00
" >
" let g:spacevim_language = 'en_CA.utf8'
" <
let g:spacevim_language = ''
""
2017-10-04 13:49:14 +08:00
" Option for keep the spacevim server ailive
let g:spacevim_keep_server_alive = 1
""
" The colorscheme of SpaceVim. Default is 'gruvbox'.
2017-01-02 10:38:23 +08:00
let g:spacevim_colorscheme = 'gruvbox'
""
2017-04-30 15:34:09 +08:00
" The background of colorscheme. Default is 'dark'.
let g:spacevim_colorscheme_bg = 'dark'
""
" The default colorscheme of SpaceVim. Default is 'desert'.
" This colorscheme will be used if the colorscheme set by
" `g:spacevim_colorscheme` is not installed.
2017-01-11 15:40:19 +08:00
" >
" let g:spacevim_colorscheme_default = 'other_color'
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_colorscheme_default = 'desert'
""
" Enable/disable simple mode of SpaceVim. Default is 0.
" In this mode, only few plugins will be installed.
2017-01-11 20:47:23 +08:00
" >
" let g:spacevim_simple_mode = 1
" <
2017-01-11 15:40:19 +08:00
let g:spacevim_simple_mode = 0
""
" The default file manager of SpaceVim. Default is 'vimfiler'.
2017-01-02 10:38:23 +08:00
let g:spacevim_filemanager = 'vimfiler'
""
" The default plugin manager of SpaceVim. Default is 'dein'.
" Options are dein, neobundle, or vim-plug.
2017-03-07 22:11:41 +08:00
let g:spacevim_plugin_manager = 'dein'
2018-06-10 23:30:02 +08:00
""
" @section plugin_manager_processes, options-plugin_manager_processes
" @parentsection options
" Set the max process of SpaceVim plugin manager
2017-01-06 21:42:33 +08:00
""
2017-04-04 23:01:41 +08:00
" Set the max process of SpaceVim plugin manager
2018-06-10 23:30:02 +08:00
let g:spacevim_plugin_manager_processes = 16
""
" @section checkinstall, options-checkinstall
" @parentsection options
" Enable/Disable checkinstall on SpaceVim startup. Default is true.
" >
" checkinstall = true
" <
2017-04-04 23:01:41 +08:00
""
2017-03-29 22:35:02 +08:00
" Enable/Disable checkinstall on SpaceVim startup. Default is 1.
" >
2017-03-27 21:19:24 +08:00
" let g:spacevim_checkinstall = 1
2017-01-06 21:42:33 +08:00
" <
2017-03-29 22:35:02 +08:00
let g:spacevim_checkinstall = 1
2017-01-08 16:27:18 +08:00
""
" Enable/Disable vimcompatible mode, by default it is disabled. In
" vimcompatible mode all vim origin key bindings will not be changed.
2018-04-29 09:19:12 +08:00
"
" Includes:
" >
" q smart quit windows
" s windows key bindings leader
" <C-x> switch buffer
" <
let g:spacevim_vimcompatible = 0
""
" Enable/Disable debug mode for SpaceVim. Default is 0.
" >
2017-01-08 16:27:18 +08:00
" let g:spacevim_enable_debug = 1
" <
let g:spacevim_enable_debug = 0
2017-01-08 23:02:49 +08:00
""
2017-05-31 22:00:17 +08:00
" Auto disable touchpad when switch to insert mode or focuslost in neovim.
let g:spacevim_auto_disable_touchpad = 1
""
2017-04-07 23:17:01 +08:00
" Set the debug level of SpaceVim. Default is 1. see
" |SpaceVim#logger#setLevel()|
2017-01-08 23:02:49 +08:00
let g:spacevim_debug_level = 1
2017-01-02 10:38:23 +08:00
let g:spacevim_hiddenfileinfo = 1
let g:spacevim_gitcommit_pr_icon = ''
2017-11-14 23:16:24 +08:00
let g:spacevim_gitcommit_issue_icon = ''
2017-02-26 00:46:44 +08:00
""
" Set SpaceVim buffer index type, default is 0.
2017-02-26 00:46:44 +08:00
" >
" " types:
" " 0: 1 ➛ ➊
" " 1: 1 ➛ ➀
" " 2: 1 ➛ ⓵
" " 3: 1 ➛ ¹
" " 4: 1 ➛ 1
2017-02-26 00:46:44 +08:00
" let g:spacevim_buffer_index_type = 1
" <
let g:spacevim_buffer_index_type = 0
2017-01-02 10:38:23 +08:00
""
2017-06-01 00:18:32 +08:00
" Set SpaceVim windows index type, default is 0.
" >
" " types:
" " 0: 1 ➛ ➊
" " 1: 1 ➛ ➀
" " 2: 1 ➛ ⓵
2017-09-20 21:24:57 +08:00
" " 3: 1 ➛ 1
2017-06-01 00:18:32 +08:00
" let g:spacevim_windows_index_type = 1
" <
let g:spacevim_windows_index_type = 0
""
" Enable/Disable tabline filetype icon. default is 0.
let g:spacevim_enable_tabline_filetype_icon = 0
""
2017-03-01 21:14:03 +08:00
" Enable/Disable os fileformat icon. default is 0.
let g:spacevim_enable_os_fileformat_icon = 0
""
" Set the github username, It will be used for getting your starred repos, and
" fuzzy find the repo you want.
let g:spacevim_github_username = ''
""
2018-01-14 23:48:44 +08:00
" Set the default key for smart close windows, default is `q`.
let g:spacevim_windows_smartclose = 'q'
""
" Disable plugins by name.
" >
2017-01-05 21:16:45 +08:00
" let g:spacevim_disabled_plugins = ['vim-foo', 'vim-bar']
" <
let g:spacevim_disabled_plugins = []
""
" Add custom plugins.
2017-01-09 22:50:06 +08:00
" >
" let g:spacevim_custom_plugins = [
" \ ['plasticboy/vim-markdown', 'on_ft' : 'markdown'],
" \ ['wsdjeg/GitHub.vim'],
" \ ]
" <
let g:spacevim_custom_plugins = []
""
2018-01-17 21:34:44 +08:00
" change the default filetype icon for a specific filtype.
" >
" let g:spacevim_filetype_icons['md'] = ''
" <
let g:spacevim_filetype_icons = {}
""
" SpaceVim will load the global config after local config if set to 1. Default
" is 0. If you have a local config, the global config will not be loaded.
2017-01-10 00:27:52 +08:00
" >
" let g:spacevim_force_global_config = 1
" <
let g:spacevim_force_global_config = 0
""
" Enable/Disable powerline symbols. Default is 1.
2017-01-02 10:38:23 +08:00
let g:spacevim_enable_powerline_fonts = 1
2017-01-07 23:01:13 +08:00
""
" Enable/Disable lint on save feature of SpaceVim's maker. Default is 1.
2017-01-07 23:01:13 +08:00
" >
" let g:spacevim_lint_on_save = 0
" <
let g:spacevim_lint_on_save = 1
2017-06-21 23:54:32 +08:00
let g:spacevim_search_tools = ['rg', 'ag', 'pt', 'ack', 'grep']
""
2018-01-14 23:08:56 +08:00
" Set the project rooter patterns, by default it is
" `['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/']`
let g:spacevim_project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/']
""
" Enable/Disable changing directory automatically. Enabled by default.
let g:spacevim_project_rooter_automatically = 1
2018-06-10 23:30:02 +08:00
""
" @section lint_on_the_fly, options-lint_on_the_fly
" @parentsection options
" Enable/Disable lint on the fly feature of SpaceVim's maker. Default is true.
" >
" lint_on_the_fly = false
" <
2018-01-14 23:08:56 +08:00
""
2017-04-08 23:54:44 +08:00
" Enable/Disable lint on the fly feature of SpaceVim's maker. Default is 0.
" >
" let g:spacevim_lint_on_the_fly = 0
" <
let g:spacevim_lint_on_the_fly = 0
""
" Enable/Disable vimfiler in the welcome windows. Default is 1.
" This will cause vim to start up slowly if there are too many files in the
" current directory.
" >
" let g:spacevim_enable_vimfiler_welcome = 0
" <
let g:spacevim_enable_vimfiler_welcome = 1
""
2017-10-19 16:23:38 +08:00
" Enable/Disable gitstatus column in vimfiler buffer, default is 0.
let g:spacevim_enable_vimfiler_gitstatus = 0
""
2017-10-19 16:23:38 +08:00
" Enable/Disable filetypeicon column in vimfiler buffer, default is 0.
let g:spacevim_enable_vimfiler_filetypeicon = 0
2017-01-02 10:38:23 +08:00
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
let g:spacevim_smartcloseignoreft = [
\ 'tagbar',
\ 'vimfiler',
\ 'SpaceVimRunner',
\ 'SpaceVimREPL',
\ 'SpaceVimQuickFix',
\ 'HelpDescribe',
\ 'VebuggerShell',
\ 'VebuggerTerminal',
2018-07-02 14:08:47 +08:00
\ 'SpaceVimTabsManager'
\ ]
2017-01-02 10:38:23 +08:00
let g:spacevim_altmoveignoreft = ['Tagbar' , 'vimfiler']
let g:spacevim_enable_javacomplete2_py = 0
let g:spacevim_src_root = 'E:\sources\'
""
" The host file url. This option is for Chinese users who can not use
" Google and Twitter.
2017-03-07 22:11:41 +08:00
let g:spacevim_hosts_url
\ = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
let g:spacevim_wildignore
\ = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,
2017-03-06 23:26:26 +08:00
\*.ttf,*.TTF,*.png,*/target/*,
2017-03-11 21:46:04 +08:00
\.git,.svn,.hg,.DS_Store,*.svg'
" }}}
" Privite SpaceVim options
2017-03-14 00:57:16 +08:00
let g:_spacevim_mappings = {}
let g:_spacevim_mappings_space_custom = []
2017-12-01 20:16:24 +08:00
let g:_spacevim_mappings_space_custom_group_name = []
2018-06-15 20:41:11 +08:00
let g:_spacevim_neobundle_installed = 0
let g:_spacevim_dein_installed = 0
let g:_spacevim_vim_plug_installed = 0
2017-03-14 00:57:16 +08:00
if !exists('g:leaderGuide_vertical')
2017-03-14 06:56:03 +08:00
let g:leaderGuide_vertical = 0
2017-03-14 00:57:16 +08:00
endif
2017-03-16 23:48:50 +08:00
let g:spacevim_leader_guide_vertical = 0
2017-03-14 00:57:16 +08:00
if !exists('g:leaderGuide_sort_horizontal')
2017-03-14 06:56:03 +08:00
let g:leaderGuide_sort_horizontal = 0
2017-03-14 00:57:16 +08:00
endif
2017-03-16 23:48:50 +08:00
let g:spacevim_leader_guide_sort_horizontal = 0
2017-03-14 00:57:16 +08:00
if !exists('g:leaderGuide_position')
2017-03-14 06:56:03 +08:00
let g:leaderGuide_position = 'botright'
2017-03-14 00:57:16 +08:00
endif
2017-03-16 23:48:50 +08:00
let g:spacevim_leader_guide_position = 'botright'
2017-03-14 00:57:16 +08:00
if !exists('g:leaderGuide_run_map_on_popup')
2017-03-14 06:56:03 +08:00
let g:leaderGuide_run_map_on_popup = 1
2017-03-14 00:57:16 +08:00
endif
2017-03-16 23:48:50 +08:00
let g:spacevim_leader_guide_run_map_on_popup = 1
2018-02-03 21:13:00 +08:00
if !exists('g:leaderGuide_hspace')
2017-03-14 06:56:03 +08:00
let g:leaderGuide_hspace = 5
2017-03-14 00:57:16 +08:00
endif
2017-03-16 23:48:50 +08:00
let g:spacevim_leader_guide_hspace = 5
2018-02-03 21:13:00 +08:00
if !exists('g:leaderGuide_flatten')
2017-03-14 06:56:03 +08:00
let g:leaderGuide_flatten = 1
2017-03-14 00:57:16 +08:00
endif
2017-03-16 23:48:50 +08:00
let g:spacevim_leader_guide_flatten = 1
2018-02-03 21:13:00 +08:00
if !exists('g:leaderGuide_default_group_name')
let g:leaderGuide_default_group_name = ''
2017-03-14 00:57:16 +08:00
endif
2018-02-03 21:13:00 +08:00
let g:spacevim_leader_guide_default_group_name = ''
2017-03-16 23:48:50 +08:00
2018-02-03 21:13:00 +08:00
if !exists('g:leaderGuide_max_size')
2017-03-14 06:56:03 +08:00
let g:leaderGuide_max_size = 0
2017-03-14 00:57:16 +08:00
endif
2017-03-16 23:48:50 +08:00
let g:spacevim_leader_guide_max_size = 0
2018-02-03 21:13:00 +08:00
if !exists('g:leaderGuide_submode_mappings')
2017-04-22 08:21:27 +08:00
let g:leaderGuide_submode_mappings =
\ { '<C-C>': 'win_close', 'n': 'page_down', 'p': 'page_up', 'u' : 'undo'}
2017-03-14 00:57:16 +08:00
endif
2018-02-03 21:13:00 +08:00
let g:spacevim_leader_guide_submode_mappings = {'<C-C>': 'win_close'}
2017-03-14 00:57:16 +08:00
" SpaceVim/LanguageClient-neovim {{{
if !exists('g:LanguageClient_serverCommands')
let g:LanguageClient_serverCommands = {}
endif
" }}}
2017-03-14 00:57:16 +08:00
command -nargs=1 LeaderGuide call SpaceVim#mapping#guide#start_by_prefix('0', <args>)
2017-07-06 23:17:49 +08:00
command -range -nargs=1 LeaderGuideVisual call SpaceVim#mapping#guide#start_by_prefix('1', <args>)
2016-12-29 18:53:29 +08:00
2016-12-28 21:36:11 +08:00
function! SpaceVim#end() abort
2018-05-11 19:51:02 +08:00
if g:spacevim_vimcompatible != 1
call SpaceVim#mapping#def('nnoremap <silent>', '<Tab>', ':wincmd w<CR>', 'Switch to next window or tab','wincmd w')
call SpaceVim#mapping#def('nnoremap <silent>', '<S-Tab>', ':wincmd p<CR>', 'Switch to previous window or tab','wincmd p')
endif
if g:spacevim_vimcompatible == 1
let g:spacevim_windows_leader = ''
let g:spacevim_windows_smartclose = 0
endif
call SpaceVim#server#connect()
2017-11-23 09:44:40 +08:00
if g:spacevim_enable_neocomplcache
let g:spacevim_autocomplete_method = 'neocomplcache'
endif
if g:spacevim_enable_ycm
if has('python') || has('python3')
let g:spacevim_autocomplete_method = 'ycm'
else
call SpaceVim#logger#warn('YCM need +python or +python3 support, force to using ' . g:spacevim_autocomplete_method)
endif
endif
2017-10-04 13:49:14 +08:00
if g:spacevim_keep_server_alive
call SpaceVim#server#export_server()
endif
2017-03-06 23:26:26 +08:00
if !empty(g:spacevim_windows_leader)
call SpaceVim#mapping#leader#defindWindowsLeader(g:spacevim_windows_leader)
endif
2018-01-05 01:36:27 +08:00
call SpaceVim#mapping#g#init()
call SpaceVim#mapping#z#init()
call SpaceVim#mapping#leader#defindKEYs()
call SpaceVim#mapping#space#init()
2017-04-04 10:35:38 +08:00
if !SpaceVim#mapping#guide#has_configuration()
let g:leaderGuide_map = {}
call SpaceVim#mapping#guide#register_prefix_descriptions('', 'g:leaderGuide_map')
endif
if g:spacevim_vim_help_language ==# 'cn'
call SpaceVim#layers#load('chinese')
elseif g:spacevim_vim_help_language ==# 'ja'
call SpaceVim#layers#load('japanese')
2017-03-06 23:26:26 +08:00
endif
""
" generate tags for SpaceVim
let help = fnamemodify(g:_spacevim_root_dir, ':p:h:h') . '/doc'
try
exe 'helptags ' . help
catch
call SpaceVim#logger#warn('Failed to generate helptags for SpaceVim')
endtry
2017-03-06 23:26:26 +08:00
""
" set language
if !empty(g:spacevim_language)
silent exec 'lan ' . g:spacevim_language
endif
2017-02-03 19:49:18 +08:00
if SpaceVim#layers#isLoaded('core#statusline')
2017-05-16 22:14:38 +08:00
call SpaceVim#layers#core#statusline#init()
endif
2017-06-27 15:31:34 +08:00
if !g:spacevim_relativenumber
set norelativenumber
else
set relativenumber
2017-06-27 15:31:34 +08:00
endif
2018-04-01 21:13:49 +08:00
" tab options:
set smarttab
let &expandtab = g:spacevim_expand_tab
let &tabstop = g:spacevim_default_indent
let &softtabstop = g:spacevim_default_indent
2017-12-15 21:12:35 +08:00
let &shiftwidth = g:spacevim_default_indent
2018-04-01 21:13:49 +08:00
2017-03-14 06:56:03 +08:00
if g:spacevim_realtime_leader_guide
nnoremap <silent><nowait> <leader> :<c-u>LeaderGuide get(g:, 'mapleader', '\')<CR>
vnoremap <silent> <leader> :<c-u>LeaderGuideVisual get(g:, 'mapleader', '\')<CR>
endif
let g:leaderGuide_max_size = 15
2017-03-06 23:26:26 +08:00
call SpaceVim#plugins#load()
call SpaceVim#plugins#projectmanager#RootchandgeCallback()
call zvim#util#source_rc('general.vim')
call SpaceVim#autocmds#init()
if has('nvim')
call zvim#util#source_rc('neovim.vim')
endif
call zvim#util#source_rc('commands.vim')
filetype plugin indent on
syntax on
2016-12-29 18:53:29 +08:00
endfunction
function! SpaceVim#begin() abort
call zvim#util#source_rc('functions.vim')
call zvim#util#source_rc('init.vim')
" Before loading SpaceVim, We need to parser argvs.
function! s:parser_argv() abort
if !argc()
return [1, getcwd()]
elseif argv(0) =~# '/$'
2018-04-01 13:55:06 +08:00
let f = fnamemodify(expand(argv(0)), ':p')
if isdirectory(f)
return [1, f]
else
return [1, getcwd()]
endif
elseif argv(0) ==# '.'
return [1, getcwd()]
elseif isdirectory(expand(argv(0)))
return [1, expand(argv(0)) ]
else
return [0]
endif
endfunction
let s:status = s:parser_argv()
" If do not start Vim with filename, Define autocmd for opening welcome page
if s:status[0]
let g:_spacevim_enter_dir = s:status[1]
augroup SPwelcome
au!
autocmd VimEnter * call SpaceVim#welcome()
augroup END
endif
2018-02-25 22:07:18 +08:00
call SpaceVim#default#options()
2018-02-25 21:29:43 +08:00
call SpaceVim#default#layers()
2018-02-25 22:07:18 +08:00
call SpaceVim#default#keyBindings()
2017-03-07 23:31:51 +08:00
call SpaceVim#commands#load()
2016-12-29 18:53:29 +08:00
endfunction
2017-01-07 10:50:28 +08:00
function! SpaceVim#welcome() abort
if get(g:, '_spacevim_session_loaded', 0) == 1
return
endif
exe 'cd' fnameescape(g:_spacevim_enter_dir)
2017-04-25 21:59:35 +08:00
if exists('g:_spacevim_checking_flag') && g:_spacevim_checking_flag
2017-04-25 21:54:20 +08:00
return
endif
2017-03-10 20:36:26 +08:00
if exists(':Startify') == 2
Startify
if isdirectory(bufname(1))
bwipeout! 1
endif
if exists(':IndentLinesDisable')
IndentLinesDisable
endif
2017-03-10 20:36:26 +08:00
endif
2017-03-09 23:51:06 +08:00
if g:spacevim_enable_vimfiler_welcome
2017-04-08 13:45:45 +08:00
\ && get(g:, '_spacevim_checking_flag', 0) == 0
2017-03-09 23:51:06 +08:00
if exists(':VimFiler') == 2
2017-03-06 23:26:26 +08:00
VimFiler
2017-05-05 20:29:09 +08:00
wincmd p
2017-02-02 00:55:16 +08:00
endif
2017-03-09 23:51:06 +08:00
endif
2017-01-07 10:50:28 +08:00
endfunction
2017-01-25 20:04:17 +08:00
""
" @section FAQ, faq
"1. How do I enable YouCompleteMe?
2017-01-25 20:44:05 +08:00
" >
" I do not recommend using YouCompleteMe.
" It is too big as a vim plugin. Also, I do not like using submodules in a vim
" plugin. It is hard to manage with a plugin manager.
2017-01-25 20:44:05 +08:00
"
" 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, go into it. Otherwise clone
2017-01-25 20:44:05 +08:00
" YouCompleteMe repo by
" `git clone https://github.com/Valloric/YouCompleteMe.git`. After cloning,
" get into it and run `git submodule update --init --recursive`.
2017-01-25 20:44:05 +08:00
"
" Step 3: Compile YouCompleteMe with the features you want. If you just want
" C family support, run `./install.py --clang-completer`.
2017-01-25 20:44:05 +08:00
" <
2017-02-08 20:27:27 +08:00
"
" 2. How to add custom snippet?
2017-02-08 20:27:27 +08:00
" >
" SpaceVim uses neosnippet as the default snippet engine. If you want to add
" a snippet for a vim filetype, open a vim file and run `:NeoSnippetEdit`
" command. A buffer will be opened and you can add your custom snippet.
" By default this buffer will be save in `~/.SpaceVim/snippets`.
" If you want to use another directory:
"
2017-02-08 20:27:27 +08:00
" let g:neosnippet#snippets_directory = '~/path/to/snip_dir'
"
" For more info about how to write snippet, please
" read |neosnippet-snippet-syntax|.
2017-02-08 20:27:27 +08:00
" <
2017-02-08 21:01:16 +08:00
"
" 3. Where is `<c-f>` in cmdline-mode?
" >
" `<c-f>` is the default value of |cedit| option, but in SpaceVim we use that
" binding as `<Right>`, so maybe you can change the `cedit` option or use
" `<leader>+<c-f>`.
" <
2017-02-22 21:25:17 +08:00
"
" 4. How to use `<space>` as `<leader>`?
" >
" Add `let mapleader = "\<space>"` to `~/.SpaceVim.d/init.vim`
" <
2017-03-06 23:26:26 +08:00
2018-06-10 23:30:02 +08:00
""
" @section Changelog, changelog
" Following HEAD: changes in master branch since last release v0.7.0
"
" https://github.com/SpaceVim/SpaceVim/wiki/Following-HEAD
"
" 2018-03-19: v0.7.0
"
" https://spacevim.org/SpaceVim-release-v0.7.0/
2017-03-06 23:26:26 +08:00
2017-03-07 22:11:41 +08:00
" vim:set et sw=2 cc=80: