mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 03:40:06 +08:00
Merge branch 'file_tree' into dev
This commit is contained in:
commit
3cf2dad981
@ -529,6 +529,7 @@ endfunction
|
||||
|
||||
|
||||
function! SpaceVim#welcome() abort
|
||||
exe 'cd ' . g:_spacevim_enter_dir
|
||||
if exists('g:_spacevim_checking_flag') && g:_spacevim_checking_flag
|
||||
return
|
||||
endif
|
||||
|
@ -187,7 +187,7 @@ endfunction
|
||||
|
||||
function! zvim#util#OpenVimfiler() abort
|
||||
if bufnr('vimfiler') == -1
|
||||
VimFiler
|
||||
silent VimFiler
|
||||
if exists(':AirlineRefresh')
|
||||
AirlineRefresh
|
||||
endif
|
||||
@ -198,7 +198,7 @@ function! zvim#util#OpenVimfiler() abort
|
||||
endif
|
||||
wincmd p
|
||||
else
|
||||
VimFiler
|
||||
silent VimFiler
|
||||
doautocmd WinEnter
|
||||
if exists(':AirlineRefresh')
|
||||
AirlineRefresh
|
||||
|
@ -12,6 +12,8 @@ function! s:parser_argv() abort
|
||||
else
|
||||
return [1, getcwd()]
|
||||
endif
|
||||
elseif argv(0) ==# '.'
|
||||
return [1, getcwd()]
|
||||
elseif isdirectory(expand(argv(0)))
|
||||
return [1, expand(argv(0)) ]
|
||||
else
|
||||
@ -20,7 +22,7 @@ function! s:parser_argv() abort
|
||||
endfunction
|
||||
let s:status = s:parser_argv()
|
||||
if s:status[0]
|
||||
exe 'cd ' . s:status[1]
|
||||
let g:_spacevim_enter_dir = s:status[1]
|
||||
augroup SPwelcom
|
||||
au!
|
||||
autocmd VimEnter * call SpaceVim#welcome()
|
||||
|
@ -79,14 +79,16 @@ function! s:vimfilerinit()
|
||||
nnoremap <silent><buffer><expr> sg vimfiler#do_action('vsplit')
|
||||
nnoremap <silent><buffer><expr> sv vimfiler#do_action('split')
|
||||
nnoremap <silent><buffer><expr> st vimfiler#do_action('tabswitch')
|
||||
nmap <buffer> gx <Plug>(vimfiler_execute_vimfiler_associated)
|
||||
nmap <buffer> ' <Plug>(vimfiler_toggle_mark_current_line)
|
||||
nmap <buffer> v <Plug>(vimfiler_quick_look)
|
||||
nmap <buffer> p <Plug>(vimfiler_preview_file)
|
||||
nmap <buffer> V <Plug>(vimfiler_clear_mark_all_lines)
|
||||
nmap <buffer> i <Plug>(vimfiler_switch_to_history_directory)
|
||||
nmap <buffer> <Tab> <Plug>(vimfiler_switch_to_other_window)
|
||||
nmap <buffer> <C-r> <Plug>(vimfiler_redraw_screen)
|
||||
nmap <buffer> gx <Plug>(vimfiler_execute_vimfiler_associated)
|
||||
nmap <buffer> ' <Plug>(vimfiler_toggle_mark_current_line)
|
||||
nmap <buffer> v <Plug>(vimfiler_quick_look)
|
||||
nmap <buffer> p <Plug>(vimfiler_preview_file)
|
||||
nmap <buffer> V <Plug>(vimfiler_clear_mark_all_lines)
|
||||
nmap <buffer> i <Plug>(vimfiler_switch_to_history_directory)
|
||||
nmap <buffer> <Tab> <Plug>(vimfiler_switch_to_other_window)
|
||||
nmap <buffer> <C-r> <Plug>(vimfiler_redraw_screen)
|
||||
nmap <buffer> <Left> <Plug>(vimfiler_smart_h)
|
||||
nmap <buffer> <Right> <Plug>(vimfiler_smart_l)
|
||||
endf
|
||||
|
||||
" vim:set et sw=2:
|
||||
|
@ -61,6 +61,9 @@ title: "Documentation"
|
||||
* [Special Buffers](#special-buffers)
|
||||
* [Files manipulations key bindings](#files-manipulations-key-bindings)
|
||||
* [Vim and SpaceVim files](#vim-and-spacevim-files)
|
||||
* [File tree](#file-tree)
|
||||
* [File tree navigation](#file-tree-navigation)
|
||||
* [Open file with file tree.](#open-file-with-file-tree)
|
||||
* [Auto-saving](#auto-saving)
|
||||
* [Searching](#searching)
|
||||
* [Editing](#editing)
|
||||
@ -97,7 +100,6 @@ title: "Documentation"
|
||||
* [Window Management](#window-management)
|
||||
* [Native functions](#native-functions)
|
||||
* [Plugin: Unite](#plugin-unite)
|
||||
* [Plugin: VimFiler](#plugin-vimfiler)
|
||||
* [Plugin: neocomplete](#plugin-neocomplete)
|
||||
* [Plugin: NERD Commenter](#plugin-nerd-commenter)
|
||||
* [Plugin: Goyo and Limelight](#plugin-goyo-and-limelight)
|
||||
@ -803,6 +805,55 @@ Key Binding | Description
|
||||
`SPC f v v` | display and copy SpaceVim version
|
||||
`SPC f v d` | open SpaceVim custom configuration file
|
||||
|
||||
#### File tree
|
||||
|
||||
SpaceVim use vimfiler as the default file tree, and the default key binding is `F3`, and SpaceVim also provide `SPC f t` and `SPC f T` to open the file tree. to change the file explore to nerdtree:
|
||||
|
||||
```vim
|
||||
" the default value is vimfiler
|
||||
let g:spacevim_filemanager = 'nerdtree'
|
||||
```
|
||||
|
||||
VCS integration is supported, there will be a colum status, this feature maybe make vimfiler slow, so it is not enabled by default. to enable this feature, add `let g:spacevim_enable_vimfiler_gitstatus = 1` to your custom config. here is any picture for this feature:
|
||||
|
||||
![file-tree](https://user-images.githubusercontent.com/13142418/26881817-279225b2-4bcb-11e7-8872-7e4bd3d1c84e.png)
|
||||
|
||||
##### File tree navigation
|
||||
|
||||
Navigation is centered on the `hjkl` keys with the hope of providing a fast navigation experience like in [vifm](https://github.com/vifm):
|
||||
|
||||
|
||||
Key Binding | Description
|
||||
-----------| -----------
|
||||
`<F3>` or `SPC f t` | Toggle file explorer
|
||||
| **Within _VimFiler_ buffers** | |
|
||||
`<Left>` or `h` | go to parent node and collapse expanded directory
|
||||
`<Down>` or `j` | select next file or directory
|
||||
`<Up>` or `k` | select previous file or directory
|
||||
`<Right>` or `l` | open selected file or expand directory
|
||||
`Ctrl`+`j` | Un-map
|
||||
`Ctrl`+`l` | Un-map
|
||||
`E` | Un-map
|
||||
`.` | toggle visible ignored files
|
||||
`sv` | Split edit
|
||||
`sg` | Vertical split edit
|
||||
`p` | Preview
|
||||
`i` | Switch to directory history
|
||||
`v` | Quick look
|
||||
`gx` | Execute with vimfiler associated
|
||||
`'` | Toggle mark current line
|
||||
`V` | Clear all marks
|
||||
`Ctrl`+`r` | Redraw
|
||||
|
||||
##### Open file with file tree.
|
||||
|
||||
If there is only one file buffer opened, a file is opened in the active window, otherwise we need to use vim-choosewin to select a window to open the file.
|
||||
|
||||
Key Binding | Description
|
||||
-----------| -----------
|
||||
`l` or `Enter` | open file in one window
|
||||
`sg` | open file in an vertically split window
|
||||
`sv` | open file in an horizontally split window
|
||||
|
||||
### Auto-saving
|
||||
|
||||
@ -1212,24 +1263,6 @@ Key | Mode | Action
|
||||
`<leader>`+`ugf` | Normal | Opens Unite file with word at cursor
|
||||
`<leader>`+`ugt` | Normal/visual | Opens Unite tag with word at cursor
|
||||
|
||||
##### Plugin: VimFiler
|
||||
|
||||
Key | Mode | Action
|
||||
----- |:----:| ------------------
|
||||
`<F3>` | Normal | Toggle file explorer
|
||||
| **Within _VimFiler_ buffers** |||
|
||||
`Ctrl`+`j` | Normal | Un-map
|
||||
`Ctrl`+`l` | Normal | Un-map
|
||||
`E` | Normal | Un-map
|
||||
`sv` | Normal | Split edit
|
||||
`sg` | Normal | Vertical split edit
|
||||
`p` | Normal | Preview
|
||||
`i` | Normal | Switch to directory history
|
||||
`v` | Normal | Quick look
|
||||
`gx` | Normal | Execute with vimfiler associated
|
||||
`'` | Normal | Toggle mark current line
|
||||
`V` | Normal | Clear all marks
|
||||
`Ctrl`+`r` | Normal | Redraw
|
||||
|
||||
##### Plugin: neocomplete
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user