From d6c5b475a1a69510401b2879792d424b594a3e8d Mon Sep 17 00:00:00 2001 From: Agatha Lovelace Date: Thu, 23 Jun 2022 10:07:54 +0200 Subject: [PATCH] Fern --- .vimrc | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/.vimrc b/.vimrc index aaebd3f..08e4d5b 100644 --- a/.vimrc +++ b/.vimrc @@ -5,6 +5,7 @@ " || | || || || || || || " \\/ \\ \\ \\ \\ \\, \\,/ + " Install VimPlug let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' if empty(glob(data_dir . '/autoload/plug.vim')) @@ -22,27 +23,31 @@ Plug 'dhruvasagar/vim-table-mode' Plug 'fadein/vim-FIGlet' Plug 'gkeep/iceberg-dark' Plug 'itchyny/lightline.vim' -Plug 'jistr/vim-nerdtree-tabs' Plug 'karolbelina/uxntal.vim', {'for': 'uxntal'} +Plug 'lambdalisue/fern-git-status.vim' +Plug 'lambdalisue/fern-hijack.vim' +Plug 'lambdalisue/fern-renderer-nerdfont.vim' +Plug 'lambdalisue/fern.vim' Plug 'lilydjwg/colorizer' Plug 'mg979/vim-visual-multi' Plug 'owickstrom/vim-colors-paramount' Plug 'raimondi/delimitmate' -Plug 'scrooloose/nerdtree' Plug 'tpope/vim-commentary' Plug 'vim-scripts/nginx.vim', {'for': 'nginx'} Plug 'yuttie/comfortable-motion.vim' +Plug 'lambdalisue/nerdfont.vim' Plug 'ryanoasis/vim-devicons' " don't install these plugins on remote servers if has('nvim') + Plug 'airblade/vim-gitgutter' Plug 'folke/todo-comments.nvim' Plug 'hrsh7th/cmp-calc' Plug 'j-hui/fidget.nvim' Plug 'jghauser/mkdir.nvim' Plug 'stevearc/dressing.nvim' - Plug 'airblade/vim-gitgutter' + Plug 'williamboman/nvim-lsp-installer' Plug 'antoinemadec/FixCursorHold.nvim' Plug 'edluffy/specs.nvim' Plug 'folke/lsp-colors.nvim' @@ -56,14 +61,12 @@ if has('nvim') Plug 'hrsh7th/vim-vsnip' Plug 'kyazdani42/nvim-web-devicons' Plug 'maximbaz/lightline-ale' - Plug 'williamboman/nvim-lsp-installer' Plug 'neovim/nvim-lspconfig' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'tpope/vim-fugitive' Plug 'w0rp/ale' - Plug 'xuyuanp/nerdtree-git-plugin' endif call plug#end() @@ -81,14 +84,50 @@ noremap :call comfortable_motion#flick(-20) let g:VM_maps = {} let g:VM_maps["I BS"] = '' -" Nerdtree/git config -let g:NERDTreeGitStatusConcealBrackets = 1 +" Fern config +let g:fern#renderer = "nerdfont" +function FindSessionDirectory() abort + if len(argv()) > 0 + return fnamemodify(argv()[0], ':p:h') + endif + return getcwd() +endfunction! + +function! s:init_fern() abort + nmap + \ (fern-my-expand-or-collapse) + \ fern#smart#leaf( + \ "\(fern-action-open)", + \ "\(fern-action-expand)", + \ "\(fern-action-collapse)", + \ ) + + " Define NERDTree like mappings + nmap t (fern-action-open:tabedit) + nmap T (fern-action-open:tabedit)gT + nmap i (fern-action-open:split) + nmap gi (fern-action-open:split)p + nmap s (fern-action-open:vsplit) + nmap gs (fern-action-open:vsplit)p + nmap ma (fern-action-new-path) + nmap (fern-my-expand-or-collapse) + nmap P gg +endfunction + +augroup my-fern-startup + autocmd! * + autocmd FileType fern call s:init_fern() + if has('nvim') + autocmd TabNewEntered * ++nested exec 'Fern -reveal=% -drawer -stay ' . FindSessionDirectory() + endif +augroup END " Aliases command Header FIGlet -f Gothic cmap W w !sudo tee > /dev/null % -nnoremap :NERDTreeTabsToggle +" nnoremap :NERDTreeTabsToggle +nnoremap :exec ':Fern -reveal=% -drawer -toggle -stay ' . FindSessionDirectory() " Colorscheme set background=dark