1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:50:05 +08:00

Update core layer (#4467)

This commit is contained in:
Wang Shidong 2021-09-19 17:32:31 +08:00 committed by GitHub
parent 513a682963
commit 68e123447a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 14 deletions

View File

@ -403,11 +403,11 @@ let g:spacevim_enable_ycm = 0
" @section sidebar_width, options-sidebar_width " @section sidebar_width, options-sidebar_width
" @parentsection options " @parentsection options
" Set the width of the SpaceVim sidebar. Default is 30. " Set the width of the SpaceVim sidebar. Default is 30.
" This value will be used by tagbar and vimfiler. " This value will be used by tagbar and filetree.
"" ""
" Set the width of the SpaceVim sidebar. Default is 30. " Set the width of the SpaceVim sidebar. Default is 30.
" This value will be used by tagbar and vimfiler. " This value will be used by tagbar and filetree.
let g:spacevim_sidebar_width = 30 let g:spacevim_sidebar_width = 30
"" ""

View File

@ -5,6 +5,8 @@
" URL: https://spacevim.org " URL: https://spacevim.org
" License: GPLv3 " License: GPLv3
"============================================================================= "=============================================================================
scriptencoding utf-8
if exists('s:string_hi') if exists('s:string_hi')
finish finish
@ -13,6 +15,10 @@ endif
let s:enable_smooth_scrolling = 1 let s:enable_smooth_scrolling = 1
" disabel netrw
let g:loaded_netrwPlugin = 1
let s:SYS = SpaceVim#api#import('system') let s:SYS = SpaceVim#api#import('system')
let s:FILE = SpaceVim#api#import('file') let s:FILE = SpaceVim#api#import('file')
let s:MESSAGE = SpaceVim#api#import('vim#message') let s:MESSAGE = SpaceVim#api#import('vim#message')
@ -935,18 +941,37 @@ endfunction
let g:_spacevim_filetree_show_hidden_files = 0 let g:_spacevim_filetree_show_hidden_files = 0
let g:_spacevim_filetree_opened_icon = '▼'
let g:_spacevim_filetree_closed_icon = '▶'
function! SpaceVim#layers#core#set_variable(var) abort function! SpaceVim#layers#core#set_variable(var) abort
let g:_spacevim_filetree_show_hidden_files = get(a:var, let g:_spacevim_filetree_show_hidden_files = get(a:var,
\ 'filetree_show_hidden', \ 'filetree_show_hidden',
\ g:_spacevim_filetree_show_hidden_files) \ g:_spacevim_filetree_show_hidden_files)
let g:_spacevim_filetree_opened_icon = get(a:var,
\ 'filetree_opened_icon',
\ g:_spacevim_filetree_opened_icon)
let g:_spacevim_filetree_closed_icon = get(a:var,
\ 'filetree_closed_icon',
\ g:_spacevim_filetree_closed_icon)
let s:enable_smooth_scrolling = get(a:var, let s:enable_smooth_scrolling = get(a:var,
\ 'enable_smooth_scrolling', \ 'enable_smooth_scrolling',
\ s:enable_smooth_scrolling) \ s:enable_smooth_scrolling)
endfunction endfunction
function! SpaceVim#layers#core#get_options() abort
return [
\ 'filetree_closed_icon',
\ 'filetree_opened_icon',
\ 'filetree_show_hidden',
\ 'enable_smooth_scrolling'
\ ]
endfunction
function! SpaceVim#layers#core#health() abort function! SpaceVim#layers#core#health() abort
call SpaceVim#layers#core#plugins() call SpaceVim#layers#core#plugins()
call SpaceVim#layers#core#config() call SpaceVim#layers#core#config()

View File

@ -6,11 +6,12 @@ if get(g:, 'spacevim_filetree_direction', 'right') ==# 'right'
else else
let g:NERDTreeWinPos = 'left' let g:NERDTreeWinPos = 'left'
endif endif
let g:NERDTreeWinSize=get(g:,'NERDTreeWinSize',31) let g:NERDTreeWinSize=get(g:,'NERDTreeWinSize', get(g:, 'spacevim_sidebar_width', 35))
let g:NERDTreeChDirMode=get(g:,'NERDTreeChDirMode',1) let g:NERDTreeChDirMode=get(g:,'NERDTreeChDirMode',1)
let g:NERDTreeShowHidden = get(g:, '_spacevim_filetree_show_hidden_files', 0) let g:NERDTreeShowHidden = get(g:, '_spacevim_filetree_show_hidden_files', 0)
let g:NERDTreeDirArrowExpandable = '▶' let g:NERDTreeDirArrowExpandable = get(g:, 'NERDTreeDirArrowExpandable', get(g:, '_spacevim_filetree_closed_icon', ''))
let g:NERDTreeDirArrowCollapsible = '▼' let g:NERDTreeDirArrowCollapsible = get(g:, 'NERDTreeDirArrowCollapsible', get(g:, '_spacevim_filetree_opened_icon', ''))
let g:NERDTreeMinimalUI=1
augroup nerdtree_zvim augroup nerdtree_zvim
autocmd! autocmd!
autocmd bufenter * autocmd bufenter *

View File

@ -6,8 +6,8 @@ let g:vimfiler_as_default_explorer = get(g:, 'vimfiler_as_default_explorer', 1)
let g:vimfiler_restore_alternate_file = get(g:, 'vimfiler_restore_alternate_file', 1) let g:vimfiler_restore_alternate_file = get(g:, 'vimfiler_restore_alternate_file', 1)
let g:vimfiler_tree_indentation = get(g:, 'vimfiler_tree_indentation', 1) let g:vimfiler_tree_indentation = get(g:, 'vimfiler_tree_indentation', 1)
let g:vimfiler_tree_leaf_icon = get(g:, 'vimfiler_tree_leaf_icon', '') let g:vimfiler_tree_leaf_icon = get(g:, 'vimfiler_tree_leaf_icon', '')
let g:vimfiler_tree_opened_icon = get(g:, 'vimfiler_tree_opened_icon', '') let g:vimfiler_tree_opened_icon = get(g:, 'vimfiler_tree_opened_icon', g:_spacevim_filetree_opened_icon)
let g:vimfiler_tree_closed_icon = get(g:, 'vimfiler_tree_closed_icon', '') let g:vimfiler_tree_closed_icon = get(g:, 'vimfiler_tree_closed_icon', g:_spacevim_filetree_closed_icon)
let g:vimfiler_file_icon = get(g:, 'vimfiler_file_icon', '') let g:vimfiler_file_icon = get(g:, 'vimfiler_file_icon', '')
let g:vimfiler_readonly_file_icon = get(g:, 'vimfiler_readonly_file_icon', '*') let g:vimfiler_readonly_file_icon = get(g:, 'vimfiler_readonly_file_icon', '*')
let g:vimfiler_marked_file_icon = get(g:, 'vimfiler_marked_file_icon', '√') let g:vimfiler_marked_file_icon = get(g:, 'vimfiler_marked_file_icon', '√')

View File

@ -648,7 +648,7 @@ option to:
SIDEBAR_WIDTH *SpaceVim-options-sidebar_width* SIDEBAR_WIDTH *SpaceVim-options-sidebar_width*
Set the width of the SpaceVim sidebar. Default is 30. This value will be used Set the width of the SpaceVim sidebar. Default is 30. This value will be used
by tagbar and vimfiler. by tagbar and filetree.
============================================================================== ==============================================================================
SNIPPET_ENGINE *SpaceVim-options-snippet_engine* SNIPPET_ENGINE *SpaceVim-options-snippet_engine*
@ -939,7 +939,7 @@ Enable/Disable YouCompleteMe. Default is 0.
*g:spacevim_sidebar_width* *g:spacevim_sidebar_width*
Set the width of the SpaceVim sidebar. Default is 30. This value will be used Set the width of the SpaceVim sidebar. Default is 30. This value will be used
by tagbar and vimfiler. by tagbar and filetree.
*g:spacevim_snippet_engine* *g:spacevim_snippet_engine*
Set the snippet engine of SpaceVim, default is neosnippet. to enable Set the snippet engine of SpaceVim, default is neosnippet. to enable

View File

@ -16,18 +16,19 @@ description: "SpaceVim core layer provides many default key bindings and feature
## Intro ## Intro
This is the core layer of SpaceVim, and it is loaded by default. The `core` layer of SpaceVim. This layer is enabled by default, and it provides filetree,
comment key bindings etc.
## Features ## Features
### FileTree ### FileTree
The filetree plugin is included in core layer, by default `vimfiler` is used as filetree manager. The filetree is included in core layer, by default `nerdtree` is used as filetree manager.
To use nerdtree or defx, please add following snippet into your configuration file. To use defx, please add following snippet into your configuration file.
```toml ```toml
[options] [options]
filemanager = "nerdtree" filemanager = "defx"
``` ```
## Configuration ## Configuration
@ -40,5 +41,6 @@ To use nerdtree or defx, please add following snippet into your configuration fi
name = 'core' name = 'core'
filetree_show_hidden = true filetree_show_hidden = true
enable_smooth_scrolling = true enable_smooth_scrolling = true
filetree_opened_icon = ''
filetree_closed_icon = ''
``` ```