~yerinalexey/dotfiles

ref: b75055cfb2820b41efd348481e49a2f487355931 dotfiles/nvim/fern.vim -rw-r--r-- 1.0 KiB
b75055cf — Alexey Yerin bottom: fix indents 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
" File tree configuration

" Toggle file explorer
nmap <silent> <leader>e <Cmd>Fern . -drawer -toggle<cr>

" Set drawer width
let g:fern#drawer_width = 25

" Show hidden files by default
let g:fern#default_hidden = 1

" Add icons
let g:fern#renderer = "nerdfont"

fun! s:fern_custom()
  " Disable line numbers
  setl nonumber norelativenumber

  " Fix <C-l>
  nmap <buffer> <C-l> <C-w>l

  nmap <buffer> <Plug>(fern-my-enter-and-tcd)
        \ <Plug>(fern-action-enter)
        \ <Plug>(fern-wait)
        \ <Plug>(fern-action-tcd:root)

  nmap <buffer> <Plug>(fern-my-leave-and-tcd)
        \ <Plug>(fern-action-leave)
        \ <Plug>(fern-wait)
        \ <Plug>(fern-action-tcd:root) 

  " Additional bindings
  nmap <buffer> o <Plug>(fern-action-new-file)
  nmap <buffer> O <Plug>(fern-action-new-dir)
  nmap <buffer> D <Plug>(fern-action-remove)
  nmap <buffer> < <Plug>(fern-my-leave-and-tcd)
  nmap <buffer> > <Plug>(fern-my-enter-and-tcd)
endfun

augroup fern
  au!

  au FileType fern :call <SID>fern_custom()
augroup END