mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 01:20:05 +08:00
Change default filetree to nerdtree (#4464)
This commit is contained in:
parent
2bad103358
commit
39bf31c4b2
@ -6,7 +6,7 @@
|
|||||||
[推特](https://twitter.com/SpaceVim) \|
|
[推特](https://twitter.com/SpaceVim) \|
|
||||||
[中文官网](https://spacevim.org/cn/)
|
[中文官网](https://spacevim.org/cn/)
|
||||||
|
|
||||||
[![Gitter](https://badges.gitter.im/SpaceVim/SpaceVim.svg)](https://gitter.im/SpaceVim/cn)
|
[![Gitter](https://img.shields.io/gitter/room/SpaceVim/SpaceVim?color=%2364CEAA)](https://gitter.im/SpaceVim/cn)
|
||||||
[![build](https://github.com/SpaceVim/SpaceVim/workflows/build/badge.svg)](https://github.com/SpaceVim/SpaceVim/actions?query=workflow%3Abuild)
|
[![build](https://github.com/SpaceVim/SpaceVim/workflows/build/badge.svg)](https://github.com/SpaceVim/SpaceVim/actions?query=workflow%3Abuild)
|
||||||
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
|
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
|
||||||
[![Version](https://img.shields.io/badge/version-1.7.0--dev-8700FF.svg)](https://github.com/SpaceVim/SpaceVim/releases)
|
[![Version](https://img.shields.io/badge/version-1.7.0--dev-8700FF.svg)](https://github.com/SpaceVim/SpaceVim/releases)
|
||||||
|
@ -6,8 +6,7 @@
|
|||||||
[Twitter](https://twitter.com/SpaceVim) \|
|
[Twitter](https://twitter.com/SpaceVim) \|
|
||||||
[中文官网](https://spacevim.org/cn/)
|
[中文官网](https://spacevim.org/cn/)
|
||||||
|
|
||||||
|
[![Gitter](https://img.shields.io/gitter/room/SpaceVim/SpaceVim?color=%2364CEAA)](https://gitter.im/SpaceVim/SpaceVim)
|
||||||
[![Gitter](https://badges.gitter.im/SpaceVim/SpaceVim.svg)](https://gitter.im/SpaceVim/SpaceVim)
|
|
||||||
[![build](https://github.com/SpaceVim/SpaceVim/workflows/build/badge.svg)](https://github.com/SpaceVim/SpaceVim/actions?query=workflow%3Abuild)
|
[![build](https://github.com/SpaceVim/SpaceVim/workflows/build/badge.svg)](https://github.com/SpaceVim/SpaceVim/actions?query=workflow%3Abuild)
|
||||||
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
|
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
|
||||||
[![Version](https://img.shields.io/badge/version-1.8.0--dev-8700FF.svg)](https://github.com/SpaceVim/SpaceVim/releases)
|
[![Version](https://img.shields.io/badge/version-1.8.0--dev-8700FF.svg)](https://github.com/SpaceVim/SpaceVim/releases)
|
||||||
|
@ -789,13 +789,13 @@ let g:spacevim_colorscheme_default = 'desert'
|
|||||||
""
|
""
|
||||||
" @section filemanager, options-filemanager
|
" @section filemanager, options-filemanager
|
||||||
" @parentsection options
|
" @parentsection options
|
||||||
" The default file manager of SpaceVim. Default is 'vimfiler'.
|
" The default file manager of SpaceVim. Default is 'nerdtree'.
|
||||||
" you can also use nerdtree or defx
|
" you can also use defx or vimfiler
|
||||||
|
|
||||||
""
|
""
|
||||||
" The default file manager of SpaceVim. Default is 'vimfiler'.
|
" The default file manager of SpaceVim. Default is 'nerdtree'.
|
||||||
" you can also use nerdtree or defx
|
" you can also use defx or vimfiler
|
||||||
let g:spacevim_filemanager = 'vimfiler'
|
let g:spacevim_filemanager = 'nerdtree'
|
||||||
""
|
""
|
||||||
" @section filetree_direction, options-filetree_direction
|
" @section filetree_direction, options-filetree_direction
|
||||||
" @parentsection options
|
" @parentsection options
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
scriptencoding utf-8
|
||||||
let s:VCOP = SpaceVim#api#import('vim#compatible')
|
let s:VCOP = SpaceVim#api#import('vim#compatible')
|
||||||
|
let s:FILE = SpaceVim#api#import('file')
|
||||||
if get(g:, 'spacevim_filetree_direction', 'right') ==# 'right'
|
if get(g:, 'spacevim_filetree_direction', 'right') ==# 'right'
|
||||||
let g:NERDTreeWinPos = 'rightbelow'
|
let g:NERDTreeWinPos = 'rightbelow'
|
||||||
else
|
else
|
||||||
@ -7,6 +9,8 @@ endif
|
|||||||
let g:NERDTreeWinSize=get(g:,'NERDTreeWinSize',31)
|
let g:NERDTreeWinSize=get(g:,'NERDTreeWinSize',31)
|
||||||
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:NERDTreeDirArrowCollapsible = '▼'
|
||||||
augroup nerdtree_zvim
|
augroup nerdtree_zvim
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd bufenter *
|
autocmd bufenter *
|
||||||
@ -21,6 +25,8 @@ augroup END
|
|||||||
function! s:nerdtreeinit() abort
|
function! s:nerdtreeinit() abort
|
||||||
nnoremap <silent><buffer> yY :<C-u>call <SID>copy_to_system_clipboard()<CR>
|
nnoremap <silent><buffer> yY :<C-u>call <SID>copy_to_system_clipboard()<CR>
|
||||||
nnoremap <silent><buffer> P :<C-u>call <SID>paste_to_file_manager()<CR>
|
nnoremap <silent><buffer> P :<C-u>call <SID>paste_to_file_manager()<CR>
|
||||||
|
nnoremap <silent><buffer> h :<C-u>call <SID>nerdtree_h()<CR>
|
||||||
|
nnoremap <silent><buffer> l :<C-u>call <SID>nerdtree_l()<CR>
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:paste_to_file_manager() abort
|
function! s:paste_to_file_manager() abort
|
||||||
@ -43,3 +49,29 @@ function! s:copy_to_system_clipboard() abort
|
|||||||
call s:VCOP.systemlist(['xclip-copyfile', filename])
|
call s:VCOP.systemlist(['xclip-copyfile', filename])
|
||||||
echo 'Yanked:' . (type(filename) == 3 ? len(filename) : 1 ) . ( isdirectory(filename) ? 'directory' : 'file' )
|
echo 'Yanked:' . (type(filename) == 3 ? len(filename) : 1 ) . ( isdirectory(filename) ? 'directory' : 'file' )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:nerdtree_h() abort
|
||||||
|
" let path = g:NERDTreeFileNode.GetSelected().path.str()
|
||||||
|
" if isdirectory(path)
|
||||||
|
" let path = s:FILE.unify_path(path, ':p:h:h')
|
||||||
|
" else
|
||||||
|
" let path = s:FILE.unify_path(path, ':p:h')
|
||||||
|
" endif
|
||||||
|
" exe 'NERDTreeFind ' . path
|
||||||
|
call g:NERDTreeKeyMap.Invoke('p')
|
||||||
|
call g:NERDTreeKeyMap.Invoke('o')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:nerdtree_l() abort
|
||||||
|
let path = g:NERDTreeFileNode.GetSelected().path.str()
|
||||||
|
if isdirectory(path)
|
||||||
|
if matchstr(getline('.'), 'S') ==# g:NERDTreeDirArrowCollapsible
|
||||||
|
normal! gj
|
||||||
|
else
|
||||||
|
call g:NERDTreeKeyMap.Invoke('o')
|
||||||
|
normal! gj
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
call g:NERDTreeKeyMap.Invoke('o')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
@ -1 +1,74 @@
|
|||||||
bundle/spacevim/doc/SpaceVim.txt
|
*SpaceVim.txt*
|
||||||
|
|
||||||
|
|
||||||
|
/###### /## /##/##
|
||||||
|
/##__ ## | ## | #|__/
|
||||||
|
| ## \__/ /###### /###### /####### /######| ## | ##/##/######/####
|
||||||
|
| ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##
|
||||||
|
\____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##
|
||||||
|
/## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##
|
||||||
|
| ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##
|
||||||
|
\______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/
|
||||||
|
| ##
|
||||||
|
| ##
|
||||||
|
|__/
|
||||||
|
wsdjeg *spacevim* *SpaceVim*
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
CONTENTS *SpaceVim-contents*
|
||||||
|
1. 简介.......................................................|SpaceVim-intro|
|
||||||
|
2. 选项.....................................................|SpaceVim-options|
|
||||||
|
1. default_indent......................|SpaceVim-options-default_indent|
|
||||||
|
2. relativenumber......................|SpaceVim-options-relativenumber|
|
||||||
|
3. Configuration...........................................|SpaceVim-config|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
简介 *SpaceVim-intro*
|
||||||
|
|
||||||
|
SpaceVim 是一个社区驱动的模块化 Vim 配置,这一思想概念起源于 Spacemacs。
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
选项 *SpaceVim-options*
|
||||||
|
|
||||||
|
SpaceVim 使用 `~/.SpaceVim.d/init.toml` 作为默认的全局配置文件。所有的选项
|
||||||
|
都可以在该文件中进行设置,同时,`~/.SpaceVim.d/` 将被加入 Vim 的运行时(&rtp)内。因此,可以在该目录下创建私有的 Vim
|
||||||
|
脚本文件。SpaceVim 也支持项目的本地配置,在项目的根目录下,`.SpaceVim.d/init.toml`
|
||||||
|
即为默认的本地配置,`./SpaceVim./` 目录同样会被加入到 Vim 的运行时(&rtp)内。
|
||||||
|
|
||||||
|
以下即为一个配置示例:
|
||||||
|
>
|
||||||
|
[options]
|
||||||
|
enable-guicolors = true
|
||||||
|
max-column = 120
|
||||||
|
<
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
DEFAULT_INDENT *SpaceVim-options-default_indent*
|
||||||
|
|
||||||
|
设置默认的对齐具体,默认的值为 2。
|
||||||
|
>
|
||||||
|
default_indent = 2
|
||||||
|
<
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
RELATIVENUMBER *SpaceVim-options-relativenumber*
|
||||||
|
|
||||||
|
启用/禁用相对行号,相对行号可以用于快速上下多行移动,默认已启用。
|
||||||
|
>
|
||||||
|
relativenumber = true
|
||||||
|
<
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
CONFIGURATION *SpaceVim-config*
|
||||||
|
|
||||||
|
*g:spacevim_default_indent*
|
||||||
|
设置默认的对齐具体,默认的值为 2。
|
||||||
|
>
|
||||||
|
let g:spacevim_default_indent = 2
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:spacevim_relativenumber*
|
||||||
|
启用/禁用相对行号,相对行号可以用于快速上下多行移动,默认已启用。
|
||||||
|
|
||||||
|
|
||||||
|
vim:tw=78:ts=8:ft=help:norl:
|
||||||
|
@ -469,8 +469,8 @@ default command. for example:
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
FILEMANAGER *SpaceVim-options-filemanager*
|
FILEMANAGER *SpaceVim-options-filemanager*
|
||||||
|
|
||||||
The default file manager of SpaceVim. Default is 'vimfiler'. you can also use
|
The default file manager of SpaceVim. Default is 'nerdtree'. you can also use
|
||||||
nerdtree or defx
|
defx or vimfiler
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
FILETREE_DIRECTION *SpaceVim-options-filetree_direction*
|
FILETREE_DIRECTION *SpaceVim-options-filetree_direction*
|
||||||
@ -1113,8 +1113,8 @@ installed.
|
|||||||
<
|
<
|
||||||
|
|
||||||
*g:spacevim_filemanager*
|
*g:spacevim_filemanager*
|
||||||
The default file manager of SpaceVim. Default is 'vimfiler'. you can also use
|
The default file manager of SpaceVim. Default is 'nerdtree'. you can also use
|
||||||
nerdtree or defx
|
defx or vimfiler
|
||||||
|
|
||||||
*g:spacevim_filetree_direction*
|
*g:spacevim_filetree_direction*
|
||||||
Config the direction of file tree. Default is 'right'. you can also set to
|
Config the direction of file tree. Default is 'right'. you can also set to
|
||||||
|
@ -4,7 +4,7 @@ description: "SpaceVim 是一个社区驱动的模块化的 Vim IDE,以模块
|
|||||||
lang: zh
|
lang: zh
|
||||||
---
|
---
|
||||||
|
|
||||||
[![Gitter](https://badges.gitter.im/SpaceVim/SpaceVim.svg)](https://gitter.im/SpaceVim/cn)
|
[![Gitter](https://img.shields.io/gitter/room/SpaceVim/SpaceVim?color=%2364CEAA)](https://gitter.im/SpaceVim/cn)
|
||||||
[![build](https://github.com/SpaceVim/SpaceVim/workflows/build/badge.svg)](https://github.com/SpaceVim/SpaceVim/actions?query=workflow%3Abuild)
|
[![build](https://github.com/SpaceVim/SpaceVim/workflows/build/badge.svg)](https://github.com/SpaceVim/SpaceVim/actions?query=workflow%3Abuild)
|
||||||
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
|
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
|
||||||
[![Version](https://img.shields.io/badge/version-1.8.0--dev-8700FF.svg)](https://github.com/SpaceVim/SpaceVim/releases)
|
[![Version](https://img.shields.io/badge/version-1.8.0--dev-8700FF.svg)](https://github.com/SpaceVim/SpaceVim/releases)
|
||||||
|
@ -832,8 +832,8 @@ To change the filemanager plugin:
|
|||||||
```toml
|
```toml
|
||||||
[options]
|
[options]
|
||||||
# file manager plugins supported in SpaceVim:
|
# file manager plugins supported in SpaceVim:
|
||||||
# - vimfiler (default)
|
# - nerdtree (default)
|
||||||
# - nerdtree
|
# - vimfiler
|
||||||
# - defx
|
# - defx
|
||||||
filemanager = "defx"
|
filemanager = "defx"
|
||||||
```
|
```
|
||||||
|
@ -3,7 +3,7 @@ title: "Home"
|
|||||||
description: "SpaceVim is a community-driven vim distribution that seeks to provide layer feature."
|
description: "SpaceVim is a community-driven vim distribution that seeks to provide layer feature."
|
||||||
---
|
---
|
||||||
|
|
||||||
[![Gitter](https://badges.gitter.im/SpaceVim/SpaceVim.svg)](https://gitter.im/SpaceVim/SpaceVim)
|
[![Gitter](https://img.shields.io/gitter/room/SpaceVim/SpaceVim?color=%2364CEAA)](https://gitter.im/SpaceVim/SpaceVim)
|
||||||
[![build](https://github.com/SpaceVim/SpaceVim/workflows/build/badge.svg)](https://github.com/SpaceVim/SpaceVim/actions?query=workflow%3Abuild)
|
[![build](https://github.com/SpaceVim/SpaceVim/workflows/build/badge.svg)](https://github.com/SpaceVim/SpaceVim/actions?query=workflow%3Abuild)
|
||||||
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
|
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
|
||||||
[![Version](https://img.shields.io/badge/version-1.8.0--dev-8700FF.svg)](https://github.com/SpaceVim/SpaceVim/releases)
|
[![Version](https://img.shields.io/badge/version-1.8.0--dev-8700FF.svg)](https://github.com/SpaceVim/SpaceVim/releases)
|
||||||
|
Loading…
Reference in New Issue
Block a user