|
41 | 41 | Plug 'nvim-lua/completion-nvim' |
42 | 42 | Plug 'steelsojka/completion-buffers' |
43 | 43 | endif |
| 44 | +Plug 'lambdalisue/fern.vim' |
44 | 45 | call plug#end() |
45 | 46 |
|
46 | 47 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
@@ -429,7 +430,7 @@ let g:fzf_tags_prompt = "Gd " |
429 | 430 |
|
430 | 431 | " Indentline |
431 | 432 | let g:indentLine_char = '│' |
432 | | -let g:indentLine_fileTypeExclude = ['defx'] |
| 433 | +let g:indentLine_fileTypeExclude = ['defx', 'fern'] |
433 | 434 |
|
434 | 435 | " Vim test |
435 | 436 | let test#strategy = "asyncrun" |
@@ -563,3 +564,49 @@ augroup RubySpecialKeywordCharacters |
563 | 564 | augroup END |
564 | 565 |
|
565 | 566 | lua require("lsp_config") |
| 567 | + |
| 568 | +" Fern |
| 569 | +let g:fern#disable_default_mappings = 1 |
| 570 | +let g:fern#renderer#default#root_symbol = '[root] ' |
| 571 | +let g:fern#renderer#default#leading = ' ' |
| 572 | +let g:fern#renderer#default#leaf_symbol = ' ' |
| 573 | +let g:fern#renderer#default#collapsed_symbol = ' ' |
| 574 | +let g:fern#renderer#default#expanded_symbol = 'ﱮ ' |
| 575 | + |
| 576 | +nnoremap <C-b> :Fern . -drawer<CR> |
| 577 | +function! s:init_fern() abort |
| 578 | + nmap <nowait><buffer> d <Plug>(fern-action-remove) |
| 579 | + nmap <nowait><buffer> c <Plug>(fern-action-clipboard-copy) |
| 580 | + nmap <buffer> x <Plug>(fern-action-clipboard-move) |
| 581 | + nmap <buffer> p <Plug>(fern-action-clipboard-paste) |
| 582 | + nmap <buffer> o <Plug>(fern-action-open-or-expand) |
| 583 | + nmap <buffer> i <Plug>(fern-action-collapse) |
| 584 | + nmap <buffer> l <Plug>(fern-action-open-or-enter) |
| 585 | + nmap <buffer> h <Plug>(fern-action-leave) |
| 586 | + nmap <buffer> m <Plug>(fern-action-new-path) |
| 587 | + nmap <buffer> v <Plug>(fern-action-mark:toggle) |
| 588 | + nmap <buffer> V <Plug>(fern-action-mark:clear) |
| 589 | + nmap <buffer> r <Plug>(fern-action-rename) |
| 590 | + nmap <buffer> H <Plug>(fern-action-hidden:toggle) |
| 591 | + nmap <buffer> fi <Plug>(fern-action-include) |
| 592 | + nmap <buffer> <CR> <Plug>(fern-action-open-or-expand) |
| 593 | + nmap <buffer> <C-C> <Plug>(fern-action-cancel) |
| 594 | + nmap <buffer> q :<C-u>quit<CR> |
| 595 | +endfunction |
| 596 | + |
| 597 | +augroup fern-custom |
| 598 | + autocmd! * |
| 599 | + autocmd FileType fern call s:init_fern() |
| 600 | +augroup END |
| 601 | + |
| 602 | +nnoremap <silent> <Leader>ee :Fern . -drawer -reveal=%<CR> |
| 603 | +
|
| 604 | +function! s:on_highlight() abort |
| 605 | + highlight link FernRootSymbol Comment |
| 606 | + highlight link FernRootText Statement |
| 607 | +endfunction |
| 608 | + |
| 609 | +augroup MyFernHighlight |
| 610 | + autocmd! |
| 611 | + autocmd User FernHighlight call s:on_highlight() |
| 612 | +augroup END |
0 commit comments