From 7181d881d7c31ec57eedf412cf10cb3ca14fb740 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 14 Mar 2021 14:01:16 +0100 Subject: [PATCH] nvim: Replace nerdtree with vifm Simple, experimental replacement for now. Tries to keep the previous key functionality intact: use e to open working directory in vifm, 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. --- nvim/.config/nvim/init.vim | 3 ++- nvim/.config/nvim/keys/maps.vim | 13 +++++-------- nvim/.config/nvim/plugin/nerdtree.vim | 19 ------------------- nvim/.config/nvim/plugin/vifm.vim | 4 ++++ nvim/.config/nvim/plugins.vim | 4 ++-- 5 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 nvim/.config/nvim/plugin/nerdtree.vim create mode 100644 nvim/.config/nvim/plugin/vifm.vim diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 03420ed..63dd3e7 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -102,7 +102,7 @@ end set noequalalways " 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 let g:tex_flavor = "latex" @@ -134,6 +134,7 @@ iabbrev tehn then iabbrev whit with iabbrev whith with iabbrev grwoth growth +iabbrev Grwoth Growth iabbrev teh the iabbrev projcets projects diff --git a/nvim/.config/nvim/keys/maps.vim b/nvim/.config/nvim/keys/maps.vim index 550c716..53ba969 100644 --- a/nvim/.config/nvim/keys/maps.vim +++ b/nvim/.config/nvim/keys/maps.vim @@ -125,14 +125,11 @@ map F Sneak_F map t Sneak_t map T Sneak_T -" PLUGIN: NERDTree -" open/close NERDtree with leader-e -" whatever method tree has been opened by, leader-e closes it again -nnoremap e :NERDTreeToggle -" open root of current VCS project in tree -nnoremap :NERDTreeVCS -" open current nerdtree with current file highlighted -nnoremap E :NERDTreeFind +" PLUGIN: Vifm.vim +" open/close file tree with leader-e +nnoremap e :Vifm getcwd() +" open current file tree with current file directory +nnoremap E :Vifm " PLUGIN: FZF GLOBAL FUZZY FINDING " FZF buffers and files in current workdir diff --git a/nvim/.config/nvim/plugin/nerdtree.vim b/nvim/.config/nvim/plugin/nerdtree.vim deleted file mode 100644 index a66938d..0000000 --- a/nvim/.config/nvim/plugin/nerdtree.vim +++ /dev/null @@ -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('')) - \| call plug#load('nerdtree') - \| execute 'autocmd! nerd_loader' - \| endif -augroup END diff --git a/nvim/.config/nvim/plugin/vifm.vim b/nvim/.config/nvim/plugin/vifm.vim new file mode 100644 index 0000000..7ab5941 --- /dev/null +++ b/nvim/.config/nvim/plugin/vifm.vim @@ -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"' diff --git a/nvim/.config/nvim/plugins.vim b/nvim/.config/nvim/plugins.vim index cf4bf87..3116b1b 100644 --- a/nvim/.config/nvim/plugins.vim +++ b/nvim/.config/nvim/plugins.vim @@ -26,8 +26,7 @@ Plug 'justinmk/vim-sneak' Plug 'RRethy/vim-illuminate' " highlight other occurences of the word under cursor " filedrawer -Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } " show a directory listing within vim -Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } " show git status in nerdtree for files and dirs +Plug 'vifm/vifm.vim' " editing 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 '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 '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