diff options
author | Oxbian <got.dacs@slmail.me> | 2023-07-25 15:58:14 +0200 |
---|---|---|
committer | Oxbian <got.dacs@slmail.me> | 2023-07-25 15:58:14 +0200 |
commit | 2383c4b5878055e2cd13fd5ed2ac2e0820b3286f (patch) | |
tree | a1a25229e1973f204b99ac4564360975975d6796 /.vim/plugins.vim | |
parent | 32de71752457551f96433f9aff5fba81950d8245 (diff) | |
download | vimrc-2383c4b5878055e2cd13fd5ed2ac2e0820b3286f.tar.gz vimrc-2383c4b5878055e2cd13fd5ed2ac2e0820b3286f.zip |
Updating fern actions & fern treeview + how to use vm in vim instructions
Diffstat (limited to '.vim/plugins.vim')
-rw-r--r-- | .vim/plugins.vim | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/.vim/plugins.vim b/.vim/plugins.vim index add6b38..6db8cc9 100644 --- a/.vim/plugins.vim +++ b/.vim/plugins.vim @@ -72,41 +72,49 @@ let g:loaded_netrwPlugin = 1 let g:loaded_netrwSettings = 1 let g:loaded_netrwFileHandlers = 1 + let g:fern#default_hidden = 1 " Show hidden files let g:fern#renderer = 'devicons' let g:fern_renderer_devicons_disable_warning = 1 " Multi window select in which you open the file function! s:init_fern() abort - " Use 'select' instead of 'edit' for default 'open' action - nnoremap <buffer> <Plug>(fern-action-open) <Plug>(fern-action-open:select) - - nnoremap <buffer> a <Plug>(fern-action-new-path) - nnoremap <buffer> d <Plug>(fern-action-remove) - nnoremap < <buffer> m <Plug>(fern-action-move) - nnoremap <buffer> r <Plug>(fern-action-rename) - nnoremap <buffer> v <Plug>(fern-action-open:vsplit) - nnoremap <buffer> ga <Plug>(fern-action-git-stage) - nnoremap <buffer> gd <Plug>(fern-action-git-unstage) + nmap <buffer><expr> + \ <Plug>(fern-my-open-expand-collapse) + \ fern#smart#leaf( + \ "\<Plug>(fern-action-open:select)", + \ "\<Plug>(fern-action-expand)", + \ "\<Plug>(fern-action-collapse)", + \ ) + nmap <buffer> action <Plug>(fern-action-choice) + nmap <buffer> <CR> <Plug>(fern-my-open-expand-collapse) + nmap <buffer> a <Plug>(fern-action-new-path) + nmap <buffer> d <Plug>(fern-action-remove) + nmap <buffer> m <Plug>(fern-action-move) + nmap <buffer> r <Plug>(fern-action-rename) + nmap <buffer> s <Plug>(fern-action-open:split) + nmap <buffer> v <Plug>(fern-action-open:vsplit) + nmap <buffer> ga <Plug>(fern-action-git-stage) + nmap <buffer> gd <Plug>(fern-action-git-unstage) endfunction augroup my-fern-hijack - autocmd! - autocmd BufEnter * ++nested call s:hijack_directory() + autocmd! + autocmd BufEnter * ++nested call s:hijack_directory() augroup END function! s:hijack_directory() abort - let path = expand('%:p') - if !isdirectory(path) - return - endif - bwipeout % - execute printf('Fern %s', fnameescape(path)) + let path = expand('%:p') + if !isdirectory(path) + return + endif + bwipeout % + execute printf('Fern %s', fnameescape(path)) endfunction augroup fern-custom - autocmd! * - autocmd FileType fern call s:init_fern() + autocmd! * + autocmd FileType fern call s:init_fern() augroup END " Which Key |