1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:30:04 +08:00
SpaceVim/autoload/SpaceVim.vim

1761 lines
49 KiB
VimL
Raw Normal View History

2017-03-02 22:20:46 +08:00
"=============================================================================
" SpaceVim.vim --- Initialization and core files for SpaceVim
2020-08-31 21:24:27 +08:00
" Copyright (c) 2016-2020 Wang Shidong & Contributors
2017-03-02 22:20:46 +08:00
" 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
"=============================================================================
2021-01-02 17:58:45 +08:00
scriptencoding utf-8
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
2020-05-06 20:59:34 +08:00
" @order intro options config layers usage 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.
2018-12-19 23:59:41 +08:00
" 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-12-19 23:59:41 +08:00
"
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 take a look at the following options.
"
2021-01-02 17:58:45 +08:00
let s:SYSTEM = SpaceVim#api#import('system')
" Public SpaceVim Options {{{
2017-01-04 23:53:49 +08:00
""
" Version of SpaceVim , this value can not be changed.
2021-06-15 23:35:59 +08:00
let g:spacevim_version = '1.8.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
""
" Enable/Disable relativenumber in current windows, by default it is enabled.
2017-06-27 15:31:34 +08:00
let g:spacevim_relativenumber = 1
2018-06-10 23:30:02 +08:00
2019-04-13 22:12:33 +08:00
""
" @section enable_bepo_layout, options-enable_bepo_layout
" @parentsection options
" Enable/Disable bepo layout, by default it is disabled.
" >
" enable_bepo_layout = true
" <
""
" Enable/Disable bepo layout, by default it is disabled.
let g:spacevim_enable_bepo_layout = 0
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 default_custom_leader, options-default_custom_leader
" @parentsection options
" Change the default custom leader of SpaceVim. Default is <Space>.
" >
" default_custom_leader = "<Space>"
" <
""
" Change the default custom leader of SpaceVim. Default is <Space>.
" >
" let g:spacevim_default_custom_leader = '<Space>'
" <
let g:spacevim_default_custom_leader = '<Space>'
""
" @section home_files_number, options-home_files_number
" @parentsection options
" Change the list number of files for SpaceVim home. Default is 6.
" >
" home_files_number = 6
" <
""
" Change the list number of files for SpaceVim home. Default is 6.
" >
" let g:spacevim_home_files_number = 6
" <
let g:spacevim_home_files_number = 6
2018-06-10 23:30:02 +08:00
""
" @section enable_guicolors, options-enable_guicolors
" @parentsection options
" Enable true color support in terminal. Default is false.
2018-06-10 23:30:02 +08:00
" >
" enable_guicolors = true
" <
2017-01-03 00:27:11 +08:00
""
" Enable true color support in terminal. Default is 0.
" >
" let g:spacevim_enable_guicolors = 1
" <
let g:spacevim_enable_guicolors = 0
2018-06-10 23:30:02 +08:00
2020-06-30 22:25:15 +08:00
""
" @section escape_key_binding, options-escape_key_binding
" @parentsection options
" Set the key binding for switch to normal mode in insert mode.
" Default is `jk`, to disable this key binding, set this option to empty
" string.
" >
" escape_key_binding = 'jk'
" <
""
" Set the key binding for switch to normal mode in insert mode.
" Default is `jk`, to disable this key binding, set this option to empty
" string.
" >
" let g:spacevim_escape_key_binding = 'jk'
" <
let g:spacevim_escape_key_binding = 'jk'
2021-05-01 22:47:19 +08:00
""
" @section file_searching_tools, options-file_searching_tools
" @parentsection options
" Set the default file searching tool used by `SPC f /`, by default it is `[]`.
" The first item in this list is the name of the tool, the second one is the
" default command. for example:
" >
" file_searching_tools = ['find', 'find -not -iwholename "*.git*" ']
" <
let g:spacevim_file_searching_tools = []
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
2018-12-19 23:59:41 +08:00
" Window functions leader for SpaceVim. Default is `s`.
2018-06-10 23:30:02 +08:00
" Set to empty to disable this feature, or you can set to another char.
" >
" windows_leader = ""
" <
2017-01-11 23:00:28 +08:00
""
2018-12-19 23:59:41 +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 data_dir, options-data_dir
" @parentsection options
" Set the cache directory of SpaceVim. Default is `$XDG_CACHE_HOME`
" or if not set `~/.cache¸.
" >
" data_dir = "~/.cache"
" <
""
" Set the cache directory of SpaceVim. Default is `$XDG_CACHE_HOME`
" or if not set `~/.cache¸.
" >
" let g:spacevim_data_dir = '~/.cache'
" <
let g:spacevim_data_dir
\ = $XDG_CACHE_HOME != ''
\ ? $XDG_CACHE_HOME . SpaceVim#api#import('file').separator
\ : expand($HOME. join(['', '.cache', ''],
\ SpaceVim#api#import('file').separator))
2020-08-29 16:46:57 +08:00
if !isdirectory(g:spacevim_data_dir)
call mkdir(g:spacevim_data_dir, 'p')
endif
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 `$data_dir/vimfiles`.
2018-06-10 23:30:02 +08:00
" >
" plugin_bundle_dir = "~/.cache/vimplugs"
" <
""
" Set the cache directory of plugins. Default is `$data_dir/vimfiles`.
" >
" let g:spacevim_plugin_bundle_dir = g:spacevim_data_dir.'/vimplugs'
" <
2017-03-07 22:11:41 +08:00
let g:spacevim_plugin_bundle_dir
\ = g:spacevim_data_dir . join(['vimfiles', ''],
2017-03-07 22:11:41 +08:00
\ 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
""
" @section enable_key_frequency, options-enable_key_frequency
" @parentsection options
" Enable/Disable key frequency catching of SpaceVim. default value is 0. to
" enable it:
" >
" enable_key_frequency = true
" <
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')
\ || SpaceVim#util#haspy3lib('pynvim'))) &&
\ (has('nvim') || (has('patch-8.0.0027')))
""
" @section autocomplete_method, options-autocomplete_method
" @parentsection options
" 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
" <
"
" and you can alse set this option to coc, then coc.nvim will be used.
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
" <
"
" and you can alse set this option to coc, then coc.nvim will be used.
2017-11-23 10:39:06 +08:00
let g:spacevim_autocomplete_method = 'deoplete'
" neocomplete does not work with Vim 8.2.1066
elseif has('lua') && !has('patch-8.2.1066')
2017-11-23 10:39:06 +08:00
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
""
2021-02-10 10:31:34 +08:00
" @section lint_engine, options-lint_engine
2018-06-10 23:30:02 +08:00
" @parentsection options
2021-02-10 10:31:34 +08:00
" Set the lint engine used in checkers layer, the default engine is neomake,
" if you want to use ale, use:
2018-06-10 23:30:02 +08:00
" >
2021-02-10 10:31:34 +08:00
" lint_engine = 'ale'
2018-06-10 23:30:02 +08:00
" <
2021-02-10 10:31:34 +08:00
" NOTE: the `enable_neomake` and `enable_ale` option has been deprecated.
" *spacevim-options-enable_naomake*
" *spacevim-options-enable_ale*
2018-06-10 23:30:02 +08:00
""
2021-02-10 10:31:34 +08:00
" Set the lint engine used in checkers layer, the default engine is neomake,
" if you want to use ale, use:
" >
2021-02-10 10:31:34 +08:00
" let g:spacevim_lint_engine = 'ale'
" <
2021-02-10 10:31:34 +08:00
let g:spacevim_lint_engine = 'neomake'
2018-06-10 23:30:02 +08:00
""
" @section guifont, options-guifont
" @parentsection options
" Set the guifont of SpaceVim. Default is empty.
" >
" guifont = "SauceCodePro Nerd Font Mono:h11"
2018-06-10 23:30:02 +08:00
" <
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 = "SauceCodePro Nerd Font Mono:h11"
2017-01-11 01:03:52 +08:00
" <
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
""
" @section enable_cursorline, options-enable_cursorline
" @parentsection options
" Enable/Disable cursorline. Default is true, cursorline will be
" highlighted in normal mode.To disable this feature:
" >
" enable_cursorline = false
" <
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
""
" @section statusline_separator, options-statusline_separator
" @parentsection options
" Set the statusline separators of statusline, default is 'nil'
" >
" Separators options:
" 1. arrow
" 2. curve
" 3. slant
" 4. nil
" 5. fire
" <
"
" See more details in: http://spacevim.org/documentation/#statusline
"
""
" Set the statusline separators of statusline, default is 'nil'
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
"
let g:spacevim_statusline_separator = 'nil'
""
" @section statusline_iseparator, options-statusline_iseparator
" @parentsection options
" Set the statusline separators of statusline in inactive windows, default is
" 'nil'
" >
" Separators options:
" 1. arrow
" 2. curve
" 3. slant
" 4. nil
" 5. fire
" <
"
" See more details in: http://spacevim.org/documentation/#statusline
"
2017-11-19 09:29:34 +08:00
""
" Set the statusline separators of statusline in inactive windows, default is
" 'nil'
" >
" Separators options:
" 1. arrow
" 2. curve
" 3. slant
" 4. nil
" 5. fire
" <
"
" See more details in: http://spacevim.org/documentation/#statusline
"
let g:spacevim_statusline_iseparator = 'nil'
""
" @section enable_statusline_bfpath, options-enable_statusline_bfpath
" @parentsection options
" Enable/Disable showing full path of current buffer on statusline, disabled
" by default, to enable this feature:
" >
" enable_statusline_bfpath = true
" <
""
" Enable/Disable showing full path of current buffer on statusline, disabled
" by default, to enable this feature:
" >
" enable_statusline_bfpath = true
" <
let g:spacevim_enable_statusline_bfpath = 0
2018-12-31 23:09:35 +08:00
""
" @section enable_statusline_tag, options-enable_statusline_tag
" @parentsection options
" Enable/Disable showing current tag on statusline
" >
" enable_statusline_tag = false
" <
""
" Enable/Disable showing current tag on statusline
let g:spacevim_enable_statusline_tag = 1
""
" @section statusline_left_sections, options-statusline_left_sections
" @parentsection options
" Define the left section of statusline in active windows. By default:
" >
" statusline_left_sections = [
" 'winnr',
" 'filename',
" 'major mode',
" 'minor mode lighters',
" 'version control info'
" ]
" <
2018-12-31 23:09:35 +08:00
2017-11-19 10:18:32 +08:00
""
" Define the left section of statusline in active windows. By default:
" >
2018-12-19 23:59:41 +08:00
" let g:spacevim_statusline_left_sections =
2017-11-19 10:18:32 +08:00
" \ [
" \ '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',
2019-09-19 22:43:59 +08:00
\ 'search count',
2018-01-18 20:34:43 +08:00
\ '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
""
2020-09-26 11:14:25 +08:00
" @section statusline_unicode_symbols, options-statusline_unicode_symbols
" @parentsection options
" Enable/Disable unicode symbols in statusline, includes the mode icons and
" fileformat icons. This option is enabled by default, to disable it:
" >
" statusline_unicode_symbols = false
" <
""
" Enable/Disable unicode symbols in statusline, includes the mode icons and
" fileformat icons. This option is enabled by default, to disable it:
" >
" let g:spacevim_statusline_unicode_symbols = 0
" <
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 = []
2019-10-03 22:00:09 +08:00
""
" @section enable_cursorcolumn, options-enable_cursorcolumn
" @parentsection options
" Enable/Disable cursorcolumn. Default is 0, cursorcolumn will be
" highlighted in normal mode. To enable this feature:
" >
" enable_cursorcolumn = true
" <
2017-10-23 03:13:42 +08:00
""
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 = '✖'
""
" @section warning_symbol, options-warning_symbol
" @parentsection options
" Set the warning symbol for SpaceVim's syntax maker. Default is '⚠'.
" >
" warning_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 = '⚠'
""
" @section info_symbol, options-info_symbol
" @parentsection options
" Set the information symbol for SpaceVim's syntax maker. Default is '🛈'.
" >
" info_symbol = 'i'
" <
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')
""
" @section terminal_cursor_shape, options-terminal_cursor_shape
" @parentsection options
" 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.
" 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'
" <
""
2018-12-19 23:59:41 +08:00
" Set the SpaceVim cursor shape in the terminal.
2017-12-10 00:23:18 +08:00
" >
" 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
2019-10-03 22:00:09 +08:00
""
" @section vim_help_language, options-vim_help_language
" @parentsection options
" Set the help language of vim. Default is 'en'.
" You can change it to Chinese.
" >
" vim_help_language = "cn"
" <
2017-01-19 20:41:06 +08:00
""
2018-12-19 23:59:41 +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'
""
" @section language, options-language
" @parentsection options
" Set the message language of vim. Default is 'en_US.UTF-8'.
" >
" language = 'en_CA.utf8'
" <
2017-01-02 10:38:23 +08:00
""
" 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 = ''
""
" @section keep_server_alive, options-keep_server_alive
" @parentsection options
" Option for keep the spacevim server ailive
2017-01-30 20:36:03 +08:00
""
2017-10-04 13:49:14 +08:00
" Option for keep the spacevim server ailive
let g:spacevim_keep_server_alive = 1
""
" @section colorscheme, options-colorscheme
" @parentsection options
" The colorscheme of SpaceVim. Default is 'gruvbox'.
2017-10-04 13:49:14 +08:00
""
" The colorscheme of SpaceVim. Default is 'gruvbox'.
2017-01-02 10:38:23 +08:00
let g:spacevim_colorscheme = 'gruvbox'
""
" @section colorscheme_bg, options-colorscheme_bg
" @parentsection options
" The background of colorscheme. Default is 'dark'.
2017-01-02 10:38:23 +08:00
""
2017-04-30 15:34:09 +08:00
" The background of colorscheme. Default is 'dark'.
let g:spacevim_colorscheme_bg = 'dark'
""
2018-12-19 23:59:41 +08:00
" 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'
""
" @section filemanager, options-filemanager
" @parentsection options
" The default file manager of SpaceVim. Default is 'vimfiler'.
" you can also use nerdtree or defx
2017-01-11 15:40:19 +08:00
""
" The default file manager of SpaceVim. Default is 'vimfiler'.
2019-03-10 20:49:12 +08:00
" you can also use nerdtree or defx
2017-01-02 10:38:23 +08:00
let g:spacevim_filemanager = 'vimfiler'
""
" @section filetree_direction, options-filetree_direction
" @parentsection options
" Config the direction of file tree. Default is 'right'. you can also set to
" 'left'.
"
" NOTE: if it is 'left', the tagbar will be move to right.
2019-03-14 00:03:35 +08:00
""
" Config the direction of file tree. Default is 'right'. you can also set to
" 'left'.
2019-03-14 00:03:35 +08:00
"
" NOTE: if it is 'left', the tagbar will be move to right.
let g:spacevim_filetree_direction = 'right'
let g:spacevim_sidebar_direction = ''
2017-01-02 10:38:23 +08:00
""
" The default plugin manager of SpaceVim.
" if has patch 7.4.2071, the default value is dein. Otherwise it is neobundle.
" Options are dein, neobundle, or vim-plug.
2021-02-21 15:56:37 +08:00
if has('patch-7.4.2071')
let g:spacevim_plugin_manager = 'dein'
else
let g:spacevim_plugin_manager = 'neobundle'
endif
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
""
2019-10-03 22:00:09 +08:00
" @section vimcompatible, options-vimcompatible
" @parentsection options
" Enable/Disable vimcompatible mode, by default it is false.
2019-10-03 22:00:09 +08:00
" to enable vimcompatible mode, just add:
" >
" vimcompatible = true
" <
" In vimcompatible mode all vim origin key bindings will not be changed.
"
" Includes:
" >
" q smart quit windows
" s windows key bindings leader
2020-04-17 22:23:43 +08:00
" , language specific leader
" <C-a> move cursor to beginning in command line mode
" <C-b> move cursor to left in command line mode
" <C-f> move cursor to right in command line mode
2019-10-03 22:00:09 +08:00
" <C-x> switch buffer
" <
""
" Enable/Disable vimcompatible mode, by default it is false.
2019-10-03 22:00:09 +08:00
" to enable vimcompatible mode, just add:
" >
" let g:spacevim_vimcompatible = 1
" <
" 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
2020-04-17 22:23:43 +08:00
" , language specific leader
" <C-a> move cursor to beginning in command line mode
" <C-b> move cursor to left in command line mode
" <C-f> move cursor to right in command line mode
2018-04-29 09:19:12 +08:00
" <C-x> switch buffer
" <
let g:spacevim_vimcompatible = 0
""
" @section enable_debug, options-enable_debug
" @parentsection options
" Enable/Disable debug mode for SpaceVim. Default is false.
" >
" enable_debug = true
" <
""
" 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
""
" @section buffer_index_type, options-buffer_index_type
" @parentsection options
" Set SpaceVim buffer index type, default is 4.
" >
" # types:
" # 0: 1 ➛ ➊
" # 1: 1 ➛ ➀
" # 2: 1 ➛ ⓵
" # 3: 1 ➛ ¹
" # 4: 1 ➛ 1
" buffer_index_type = 1
" <
""
" Set SpaceVim buffer index type, default is 4.
2017-02-26 00:46:44 +08:00
" >
" " types:
2018-12-19 23:59:41 +08:00
" " 0: 1 ➛ ➊
2017-02-26 00:46:44 +08:00
" " 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 = 4
""
" @section windows_index_type, options-windows_index_type
" @parentsection options
" Set SpaceVim windows index type, default is 3.
" >
" # types:
" # 0: 1 ➛ ➊
" # 1: 1 ➛ ➀
" # 2: 1 ➛ ⓵
" # 3: 1 ➛ 1
" windows_index_type = 1
" <
2017-01-02 10:38:23 +08:00
""
" Set SpaceVim windows index type, default is 3.
2017-06-01 00:18:32 +08:00
" >
" " types:
2018-12-19 23:59:41 +08:00
" " 0: 1 ➛ ➊
2017-06-01 00:18:32 +08:00
" " 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 = 3
""
" @section enable_tabline_ft_icon, options-enable_tabline_ft_icon
" @parentsection options
" Enable/Disable tabline filetype icon. default is false. To enable this
" feature:
" >
" enable_tabline_ft_icon = true
" <
2017-06-01 00:18:32 +08:00
""
" Enable/Disable tabline filetype icon. default is 0.
let g:spacevim_enable_tabline_ft_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 = ''
2019-10-03 22:00:09 +08:00
""
" @section windows_smartclose, options-windows_smartclose
" @parentsection options
" Set the default key for smart close windows, default is `q`.
" to disable this feature, just set it to empty string:
" >
" windows_smartclose = ""
" <
""
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 = []
2020-05-06 20:59:34 +08:00
""
" @section custom_plugins, usage-custom_plugins
" @parentsection usage
" Add custom plugins.
" >
" [[custom_plugins]]
2020-07-19 10:47:58 +08:00
" repo = 'vimwiki/vimwiki'
2020-05-06 20:59:34 +08:00
" merged = false
" <
2017-01-05 21:16:45 +08:00
""
" 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
2018-12-19 23:59:41 +08:00
" 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
2020-08-21 22:36:25 +08:00
""
" @section search_tools, options-search_tools
" @parentsection options
" Default search tools supported by flygrep. The default order is ['rg', 'ag',
" 'pt', 'ack', 'grep', 'findstr', 'git']
" The `git` command means using `git-grep`. If you prefer to use `git-grep` by
" default. You can change this option to:
" >
" [options]
" search_tools = ['git', 'rg', 'ag']
" <
""
" Default search tools supported by flygrep. The default order is ['rg', 'ag',
2020-08-21 22:36:25 +08:00
" 'pt', 'ack', 'grep', 'findstr', 'git']
let g:spacevim_search_tools = ['rg', 'ag', 'pt', 'ack', 'grep', 'findstr', 'git']
""
2020-09-27 22:49:44 +08:00
" @section project_rooter_patterns, options-project_rooter_patterns
" @parentsection options
" Set the project root patterns, SpaceVim determines the root directory of the
" project based on this option. By default it is:
" >
" ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/']
" <
""
" Set the project root patterns, SpaceVim determines the root directory of the
" project based on this option. By default it is:
" >
" ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/']
" <
2018-01-14 23:08:56 +08:00
let g:spacevim_project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/']
2020-09-27 22:49:44 +08:00
""
2020-10-08 12:05:34 +08:00
" @section enable_projects_cache, options-enable_projects_cache
" @parentsection options
" Enable/Disable cross session projects cache. Enabled by default.
""
" Enable/Disable cross session projects cache. Enabled by default.
let g:spacevim_enable_projects_cache = 1
""
" @section projects_cache_num, options-projects_cache_num
" @parentsection options
" Setting the numbers of cached projects, by default it is 20.
""
" Setting the numbers of cached projects, by default it is 20.
let g:spacevim_projects_cache_num = 20
""
2020-09-27 22:49:44 +08:00
" @section project_rooter_automatically, options-project_rooter_automatically
" @parentsection options
" Enable/Disable project root detection. By default, SpaceVim will change the
" directory to the project root directory based on `project_rooter_patterns`
" option. To disable this feature:
" >
" [options]
" project_rooter_automatically = false
" <
2018-01-14 23:08:56 +08:00
""
" Enable/Disable changing directory automatically. Enabled by default.
let g:spacevim_project_rooter_automatically = 1
2020-07-05 22:09:46 +08:00
""
2020-09-27 22:49:44 +08:00
" @section project_rooter_outermost, options-project_rooter_outermost
" @parentsection options
2020-07-05 22:09:46 +08:00
" Enable/Disable finding outermost directory for project root detection.
2020-09-27 22:49:44 +08:00
" By default SpaceVim will find the outermost directory based on
" `project_rooter_patterns`. To find nearest directory, you need to disable
" this option:
" >
" [options]
" project_rooter_outermost = false
" <
""
" Enable/Disable finding outermost directory for project root detection.
" By default SpaceVim will find the outermost directory based on
" `project_rooter_patterns`. To find nearest directory, you need to disable
" this option:
" >
" let g:spacevim_project_rooter_outermost = 0
" <
2020-07-05 22:09:46 +08:00
let g:spacevim_project_rooter_outermost = 1
2018-06-10 23:30:02 +08:00
""
" Config the command line prompt for flygrep and denite etc.
let g:spacevim_commandline_prompt = '➭'
""
" Option for setting todo labels in current project.
let g:spacevim_todo_labels = map(['fixme', 'question', 'todo', 'idea'], '"@" . v:val')
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
""
" @section retry_cnt, options-retry_cnt
" @parentsection options
" Set the number of retries for SpaceVim Update when failed. Default is 3.
" Set to 0 to disable this feature, or you can set to another number.
" >
" update_retry_cnt = 3
" <
""
" Set the number of retries for SpaceVim Update when failed. Default is 3.
" Set to 0 to disable this feature, or you can set to another number.
" >
" let g:spacevim_update_retry_cnt = 3
" <
let g:spacevim_update_retry_cnt = 3
2019-06-08 21:14:13 +08:00
""
" @section enable_vimfiler_welcome, options-enable_vimfiler_welcome
" @parentsection options
" Enable/Disable vimfiler in the welcome windows. Default is true.
" This will cause vim to start up slowly if there are too many files in the
" current directory.
" >
" enable_vimfiler_welcome = false
" <
2017-04-08 23:54:44 +08:00
""
2018-12-19 23:59:41 +08:00
" 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
2018-12-19 23:59:41 +08:00
" current directory.
" >
" let g:spacevim_enable_vimfiler_welcome = 0
" <
let g:spacevim_enable_vimfiler_welcome = 1
""
2019-10-01 11:34:24 +08:00
" @section autocomplete_parens, options-autocomplete_parens
" @parentsection options
" Enable/Disable autocompletion of parentheses, default is true (enabled).
" >
" autocomplete_parens = false
" <
""
" Enable/Disable autocompletion of parentheses, default is 1 (enabled).
let g:spacevim_autocomplete_parens = 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',
2019-03-10 20:49:12 +08:00
\ 'defx',
\ 'SpaceVimRunner',
\ 'SpaceVimREPL',
\ 'SpaceVimQuickFix',
\ 'HelpDescribe',
\ 'VebuggerShell',
\ 'VebuggerTerminal',
2018-07-02 14:08:47 +08:00
\ 'SpaceVimTabsManager'
\ ]
2018-07-28 15:25:12 +08:00
let g:_spacevim_altmoveignoreft = ['Tagbar' , 'vimfiler']
2017-01-02 10:38:23 +08:00
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'
" }}}
" Private 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 = []
let g:_spacevim_mappings_language_specified_space_custom = {}
let g:_spacevim_mappings_language_specified_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')
2018-12-19 23:59:41 +08:00
let g:leaderGuide_submode_mappings =
2017-04-22 08:21:27 +08:00
\ { '<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
2019-10-03 22:00:09 +08:00
if g:spacevim_vimcompatible
let g:spacevim_windows_leader = ''
2019-10-03 22:00:09 +08:00
let g:spacevim_windows_smartclose = ''
endif
2018-09-17 21:09:15 +08:00
if !g:spacevim_vimcompatible
cnoremap <C-f> <Right>
" Navigation in command line
cnoremap <C-a> <Home>
cnoremap <C-b> <Left>
2020-02-14 21:39:42 +08:00
" @bug_vim with <silent> command line can not be cleared
cnoremap <expr> <C-k> repeat('<Delete>', strchars(getcmdline()) - getcmdpos() + 1)
2020-06-30 22:25:15 +08:00
"Use escape_key_binding switch to normal mode
if !empty(g:spacevim_escape_key_binding)
exe printf('inoremap %s <esc>', g:spacevim_escape_key_binding)
endif
2018-09-17 21:09:15 +08:00
endif
2021-01-02 17:58:45 +08:00
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'
let &helplang = 'cn'
elseif g:spacevim_vim_help_language ==# 'ja'
let &helplang = 'jp'
2017-03-06 23:26:26 +08:00
endif
""
" generate tags for SpaceVim
2019-02-03 00:07:31 +08:00
let help = fnamemodify(g:_spacevim_root_dir, ':p: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
2018-04-01 21:13:49 +08:00
" tab options:
set smarttab
let &expandtab = g:spacevim_expand_tab
2021-04-04 13:46:48 +08:00
if g:spacevim_default_indent > 0
let &tabstop = g:spacevim_default_indent
let &softtabstop = g:spacevim_default_indent
let &shiftwidth = g:spacevim_default_indent
endif
2017-12-15 21:12:35 +08:00
2019-06-09 13:04:26 +08:00
let g:unite_source_menu_menus =
\ get(g:,'unite_source_menu_menus',{})
let g:unite_source_menu_menus.CustomKeyMaps = {'description':
\ 'Custom mapped keyboard shortcuts [unite]<SPACE>'}
let g:unite_source_menu_menus.CustomKeyMaps.command_candidates =
\ get(g:unite_source_menu_menus.CustomKeyMaps,'command_candidates', [])
let g:unite_source_menu_menus.MyStarredrepos = {'description':
\ 'All github repos starred by me <leader>ls'}
let g:unite_source_menu_menus.MyStarredrepos.command_candidates =
\ get(g:unite_source_menu_menus.MyStarredrepos,'command_candidates', [])
let g:unite_source_menu_menus.MpvPlayer = {'description':
\ 'Musics list <leader>lm'}
let g:unite_source_menu_menus.MpvPlayer.command_candidates =
\ get(g:unite_source_menu_menus.MpvPlayer,'command_candidates', [])
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()
2021-01-02 17:58:45 +08:00
exe 'set wildignore+=' . g:spacevim_wildignore
" shell
if has('filterpipe')
set noshelltemp
endif
if g:spacevim_enable_guicolors == 1
if !has('nvim') && has('patch-7.4.1770')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
if exists('+termguicolors')
set termguicolors
elseif exists('+guicolors')
set guicolors
endif
endif
if g:spacevim_colorscheme !=# '' "{{{
try
exec 'set background=' . g:spacevim_colorscheme_bg
exec 'colorscheme ' . g:spacevim_colorscheme
catch
exec 'colorscheme '. g:spacevim_colorscheme_default
endtry
else
exec 'colorscheme '. g:spacevim_colorscheme_default
endif
if g:spacevim_hiddenfileinfo == 1 && has('patch-7.4.1570')
set shortmess+=F
endif
if has('gui_running') && !empty(g:spacevim_guifont)
if has('gui_vimr')
" VimR has removed support for guifont
else
let &guifont = g:spacevim_guifont
endif
endif
call SpaceVim#autocmds#init()
2021-04-04 13:46:48 +08:00
if !has('nvim-0.2.0') && !has('nvim')
" In old version of neovim, &guicursor do not support cursor shape
" setting.
let $NVIM_TUI_ENABLE_CURSOR_SHAPE = g:spacevim_terminal_cursor_shape
else
if g:spacevim_terminal_cursor_shape == 0
" prevent nvim from changing the cursor shape
set guicursor=
elseif g:spacevim_terminal_cursor_shape == 1
" enable non-blinking mode-sensitive cursor
set guicursor=n-v-c:block-blinkon0,i-ci-ve:ver25-blinkon0,r-cr:hor20,o:hor50
elseif g:spacevim_terminal_cursor_shape == 2
" enable blinking mode-sensitive cursor
set guicursor=n-v-c:block-blinkon10,i-ci-ve:ver25-blinkon10,r-cr:hor20,o:hor50
2021-01-02 17:58:45 +08:00
endif
endif
filetype plugin indent on
syntax on
2016-12-29 18:53:29 +08:00
endfunction
2018-10-01 10:55:58 +08:00
" return [status, dir]
" status: 0 : no argv
" 1 : dir
" 2 : filename
function! s:parser_argv() abort
if !argc()
return [0]
elseif argv(0) =~# '/$'
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, fnamemodify(expand(argv(0)), ':p')]
else
return [2, argv()]
endif
endfunction
function! SpaceVim#begin() abort
2021-01-02 17:58:45 +08:00
"Use English for anything in vim
try
if s:SYSTEM.isWindows
silent exec 'lan mes en_US.UTF-8'
elseif s:SYSTEM.isOSX
silent exec 'language en_US.UTF-8'
else
let s:uname = system('uname -s')
if s:uname ==# "Darwin\n"
" in mac-terminal
silent exec 'language en_US.UTF-8'
elseif s:uname ==# "SunOS\n"
" in Sun-OS terminal
silent exec 'lan en_US.UTF-8'
elseif s:uname ==# "FreeBSD\n"
" in FreeBSD terminal
silent exec 'lan en_US.UTF-8'
else
" in linux-terminal
silent exec 'lan en_US.UTF-8'
endif
endif
catch /^Vim\%((\a\+)\)\=:E197/
call SpaceVim#logger#error('Can not set language to en_US.utf8')
endtry
" try to set encoding to utf-8
if s:SYSTEM.isWindows
" Be nice and check for multi_byte even if the config requires
" multi_byte support most of the time
if has('multi_byte')
" Windows cmd.exe still uses cp850. If Windows ever moved to
" Powershell as the primary terminal, this would be utf-8
if exists('&termencoding') && !has('nvim')
set termencoding=cp850
endif
setglobal fileencoding=utf-8
" Windows has traditionally used cp1252, so it's probably wise to
" fallback into cp1252 instead of eg. iso-8859-15.
" Newer Windows files might contain utf-8 or utf-16 LE so we might
" want to try them first.
set fileencodings=ucs-bom,utf-8,gbk,utf-16le,cp1252,iso-8859-15,cp936
endif
else
if exists('&termencoding') && !has('nvim')
set termencoding=utf-8
endif
set fileencoding=utf-8
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
endif
" Before loading SpaceVim, We need to parser argvs.
let s:status = s:parser_argv()
" If do not start Vim with filename, Define autocmd for opening welcome page
2018-10-01 10:55:58 +08:00
if s:status[0] == 0
let g:_spacevim_enter_dir = fnamemodify(getcwd(), ':~')
call SpaceVim#logger#info('Startup with no argv, current dir is used: ' . g:_spacevim_enter_dir )
augroup SPwelcome
au!
autocmd VimEnter * call SpaceVim#welcome()
augroup END
elseif s:status[0] == 1
let g:_spacevim_enter_dir = fnamemodify(s:status[1], ':~')
call SpaceVim#logger#info('Startup with directory: ' . g:_spacevim_enter_dir )
augroup SPwelcome
au!
autocmd VimEnter * call SpaceVim#welcome()
augroup END
2018-10-01 10:55:58 +08:00
else
call SpaceVim#logger#info('Startup with argv: ' . string(s:status[1]) )
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()
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
2018-09-06 21:19:59 +08:00
call SpaceVim#logger#info('try to open SpaceVim welcome page')
if get(g:, '_spacevim_session_loaded', 0) == 1
2018-09-06 21:19:59 +08:00
call SpaceVim#logger#info('start SpaceVim with session file, skip welcome page')
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
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
2018-12-19 23:59:41 +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
2019-03-10 20:49:12 +08:00
elseif exists(':Defx') == 2
Defx
wincmd p
2020-06-21 08:00:52 +08:00
elseif exists(':NERDTree') == 2
NERDTree
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
2020-05-06 20:59:34 +08:00
""
" @section Usage, usage
2020-08-21 22:36:25 +08:00
" General guide for using SpaceVim. Including layer configuration, bootstrap
" function.
2020-05-06 20:59:34 +08:00
2021-05-07 19:29:32 +08:00
""
" @section buffers-and-files, usage-buffers-and-files
" @parentsection usage
" @subsection Buffers manipulation key bindings
" All buffers key bindings are start with `b` prefix:
" >
" Key Bindings Descriptions
" SPC <Tab> switch to alternate buffer in the current window (switch back and forth)
" SPC b . buffer transient state
" SPC b b switch to a buffer (via denite/unite)
" SPC b d kill the current buffer (does not delete the visited file)
" SPC u SPC b d kill the current buffer and window (does not delete the visited file) (TODO)
" SPC b D kill a visible buffer using vim-choosewin
" <
2017-01-25 20:04:17 +08:00
""
" @section FAQ, faq
2020-05-06 20:59:34 +08:00
" This is a list of the frequently asked questions about SpaceVim.
"
" 1. How do I enable YouCompleteMe?
2017-01-25 20:44:05 +08:00
"
2020-05-06 20:59:34 +08:00
" Step 1: Add `enable_ycm = true` to custom_config. By default it should be
" `~/.SpaceVim.d/init.toml`.
"
" 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`.
2020-05-06 20:59:34 +08:00
"
2017-02-08 20:27:27 +08:00
"
" 2. How to add custom snippet?
2020-05-06 20:59:34 +08:00
"
" SpaceVim uses neosnippet as the default snippet engine. This can be changed
" by @section(options-snippet_engine) option.
"
2020-05-06 20:59:34 +08:00
" If you want to add a snippet for a current filetype, run |:NeoSnippetEdit|
" command. A buffer will be opened and you can add your custom snippet.
" By default this buffer will be save in `~/.SpaceVim.d/snippets`.
"
" For more info about how to write snippet, please
" read |neosnippet-snippet-syntax|.
2018-12-19 23:59:41 +08:00
"
2017-02-08 21:01:16 +08:00
"
" 3. Where is `<c-f>` in cmdline-mode?
2020-05-06 20:59:34 +08:00
"
" `<c-f>` is the default value of |cedit| option, but in SpaceVim we use that
2020-05-06 20:59:34 +08:00
" binding as `<Right>`, so maybe you can change the `cedit` option or use
" `<leader>+<c-f>`.
2017-02-22 21:25:17 +08:00
"
2018-08-04 14:31:00 +08:00
" 4. How to use `<Space>` as `<Leader>`?
2020-05-06 20:59:34 +08:00
"
" Add `let g:mapleader = "\<Space>"` to bootstrap function.
"
" 5. Why does Vim freeze after pressing Ctrl-s?
"
" This is a feature of terminal emulators. You can use `Ctrl-q` to unfreeze Vim. To disable
" this feature you need the following in either `~/.bash_profile` or `~/.bashrc`:
">
" stty -ixon
"<
"
" 6. How to enable `+py` and `+py3` in Neovim?
"
" In Neovim we can use `g:python_host_prog` and `g:python3_host_prog`
" to config python prog. But in SpaceVim the custom configuration file is
" loaded after SpaceVim core code. So in SpaceVim itself, if we using `:py`
" command, it may cause errors.
"
" So we introduce two new environment variables: `PYTHON_HOST_PROG` and
" `PYTHON3_HOST_PROG`.
"
" For example:
2017-02-22 21:25:17 +08:00
" >
2020-05-06 20:59:34 +08:00
" export PYTHON_HOST_PROG='/home/q/envs/neovim2/bin/python'
" export PYTHON3_HOST_PROG='/home/q/envs/neovim3/bin/python'
2017-02-22 21:25:17 +08:00
" <
2017-03-06 23:26:26 +08:00
2018-06-10 23:30:02 +08:00
""
" @section Changelog, changelog
2020-05-06 20:59:34 +08:00
" Following HEAD: changes in master branch since last release v1.4.0
2018-12-19 23:59:41 +08:00
"
2018-06-10 23:30:02 +08:00
" https://github.com/SpaceVim/SpaceVim/wiki/Following-HEAD
"
2020-05-06 20:59:34 +08:00
" 2020-04-05: v1.4.0
"
" https://spacevim.org/SpaceVim-release-v1.4.0/
"
2019-12-02 23:18:11 +08:00
" 2019-11-04: v1.3.0
"
" https://spacevim.org/SpaceVim-release-v1.3.0/
"
" 2019-07-17: v1.2.0
"
" https://spacevim.org/SpaceVim-release-v1.2.0/
"
2019-06-09 10:42:59 +08:00
" 2019-04-08: v1.1.0
"
" https://spacevim.org/SpaceVim-release-v1.1.0/
"
" 2018-12-25: v1.0.0
"
" https://spacevim.org/SpaceVim-release-v1.0.0/
"
" 2018-09-26: v0.9.0
"
" https://spacevim.org/SpaceVim-release-v0.9.0/
"
" 2018-06-18: v0.8.0
"
" https://spacevim.org/SpaceVim-release-v0.8.0/
"
" 2018-03-18: v0.7.0
2018-06-10 23:30:02 +08:00
"
" https://spacevim.org/SpaceVim-release-v0.7.0/
2019-06-09 10:42:59 +08:00
"
" 2017-12-30: v0.6.0
"
" https://spacevim.org/SpaceVim-release-v0.6.0/
"
" 2017-11-06: v0.5.0
"
" https://spacevim.org/SpaceVim-release-v0.5.0/
"
" 2017-08-05: v0.4.0
"
" https://spacevim.org/SpaceVim-release-v0.4.0/
"
" 2017-06-27: v0.3.1
"
" https://spacevim.org/SpaceVim-release-v0.3.1/
"
" 2017-05-31: v0.3.0
"
" https://spacevim.org/SpaceVim-release-v0.3.0/
"
" 2017-03-30: v0.2.0
"
" https://spacevim.org/SpaceVim-release-v0.2.0/
"
" 2017-01-26: v0.1.0
"
" https://spacevim.org/SpaceVim-release-v0.1.0/
"
2017-03-06 23:26:26 +08:00
2017-03-07 22:11:41 +08:00
" vim:set et sw=2 cc=80: