nvim: Replace nerdtree with vifm

Simple, experimental replacement for now. Tries to keep the previous key
functionality intact:
use <leader>e to open working directory in vifm, <leader>E to open the
directory of the current file.

Some problems will remain - currently it is hard to navigate away from
an open vifm instance with C-hjkl since it is not recognized as a vim
window anymore.

Additionally, invoking vim functions does not work from the vifm window,
which means that if I start nvim pointing to a directory, i.e. with vifm
open, it not possible for me currently to directly start up fzf to open
another file, or a buffer from the history, or similar.
This commit is contained in:
Marty Oehme 2021-03-14 14:01:16 +01:00
parent 78e678fe1f
commit 7181d881d7
Signed by: Marty
GPG key ID: B7538B8F50A1C800
5 changed files with 13 additions and 30 deletions

View file

@ -102,7 +102,7 @@ end
set noequalalways set noequalalways
" make sure there's always *some* context below cursor " make sure there's always *some* context below cursor
set scrolloff=5 set scrolloff=4
" in .tex files, default to latex over plaintext/context as syntax " in .tex files, default to latex over plaintext/context as syntax
let g:tex_flavor = "latex" let g:tex_flavor = "latex"
@ -134,6 +134,7 @@ iabbrev tehn then
iabbrev whit with iabbrev whit with
iabbrev whith with iabbrev whith with
iabbrev grwoth growth iabbrev grwoth growth
iabbrev Grwoth Growth
iabbrev teh the iabbrev teh the
iabbrev projcets projects iabbrev projcets projects

View file

@ -125,14 +125,11 @@ map F <Plug>Sneak_F
map t <Plug>Sneak_t map t <Plug>Sneak_t
map T <Plug>Sneak_T map T <Plug>Sneak_T
" PLUGIN: NERDTree " PLUGIN: Vifm.vim
" open/close NERDtree with leader-e " open/close file tree with leader-e
" whatever method tree has been opened by, leader-e closes it again nnoremap <leader>e :Vifm getcwd()<CR>
nnoremap <leader>e :NERDTreeToggle<CR> " open current file tree with current file directory
" open root of current VCS project in tree nnoremap <leader>E :Vifm<CR>
nnoremap <leader><C-e> :NERDTreeVCS<CR>
" open current nerdtree with current file highlighted
nnoremap <leader>E :NERDTreeFind<CR>
" PLUGIN: FZF GLOBAL FUZZY FINDING " PLUGIN: FZF GLOBAL FUZZY FINDING
" FZF buffers and files in current workdir " FZF buffers and files in current workdir

View file

@ -1,19 +0,0 @@
" PLUGIN: NERDTree
" " Ecosystem
" " Plug 'tpope/vim-fugitive' - Will have to take a closer look some other time
" highlight the line the cursor is on
let NERDTreeHighlightCursorline = 1
" remove Press ? for help
let NERDTreeMinimalUI=1
" loads nerdtree plugin when starting vim with a directory
" this is necessary when we lazyload nerdtree with vimplug above
" since it would only get loaded with nttoggle otherwise, and run netrw
augroup nerd_loader
autocmd!
autocmd VimEnter * silent! autocmd! FileExplorer
autocmd BufEnter,BufNew *
\ if isdirectory(expand('<amatch>'))
\| call plug#load('nerdtree')
\| execute 'autocmd! nerd_loader'
\| endif
augroup END

View file

@ -0,0 +1,4 @@
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
let g:vifm_replace_netrw = 1
let g:vifm_exec_args = '-c "set vifminfo=''''" -c "set statusline=''''" -c "only"'

View file

@ -26,8 +26,7 @@ Plug 'justinmk/vim-sneak'
Plug 'RRethy/vim-illuminate' " highlight other occurences of the word under cursor Plug 'RRethy/vim-illuminate' " highlight other occurences of the word under cursor
" filedrawer " filedrawer
Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } " show a directory listing within vim Plug 'vifm/vifm.vim'
Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } " show git status in nerdtree for files and dirs
" editing " editing
Plug 'tpope/vim-commentary' " easily toggle comments for lines, paragraphs etc with gc Plug 'tpope/vim-commentary' " easily toggle comments for lines, paragraphs etc with gc
@ -42,6 +41,7 @@ Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
Plug 'neovim/nvim-lspconfig' " some commong language server configurations Plug 'neovim/nvim-lspconfig' " some commong language server configurations
Plug 'glepnir/lspsaga.nvim' " nice and fast ui for lsp actions
Plug 'nvim-lua/completion-nvim' " simple completion engine built specifically for nvim and lsp Plug 'nvim-lua/completion-nvim' " simple completion engine built specifically for nvim and lsp
Plug 'steelsojka/completion-buffers' " completion source from words found in current buffers Plug 'steelsojka/completion-buffers' " completion source from words found in current buffers
Plug 'desmap/ale-sensible' | Plug 'w0rp/ale' " asynchronous linting - might be superseded by lsp or coc.nvim at some point Plug 'desmap/ale-sensible' | Plug 'w0rp/ale' " asynchronous linting - might be superseded by lsp or coc.nvim at some point