From 6d557a0817af45bd7d8f2966337f053b082cad71 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Tue, 2 May 2023 17:29:52 +0200 Subject: init.vim cleanup continued --- nvim/.config/nvim/init.vim | 145 +++++++++++++++++++++------------------------ 1 file changed, 69 insertions(+), 76 deletions(-) (limited to 'nvim/.config') diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 7cd0d16..7a30d95 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -1,7 +1,7 @@ " ============================ " Miguel's Fresh Neovim Config " ============================ -" 29th Apr 2021 - 27th Apr 2023 +" 29th Apr 2021 - 2nd May 2023 " " {{{ INSTALLATION " @@ -24,52 +24,64 @@ " " }}} -" {{{ vim-plug +" {{{ VIM-PLUG call plug#begin('~/.vim/plugged') -" colors +" COLOR Plug 'jnurmine/Zenburn' -" lualine +" STATUSLINE Plug 'nvim-lualine/lualine.nvim' -" tpope! -Plug 'tpope/vim-fugitive' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-sensible' -Plug 'tpope/vim-commentary' -Plug 'tpope/vim-unimpaired' -Plug 'tpope/vim-dispatch' -Plug 'tpope/vim-dadbod' -Plug 'tpope/vim-vinegar' -Plug 'tpope/vim-eunuch' - -Plug 'godlygeek/tabular' - +" TPOPE +Plug 'tpope/vim-commentary' " comment/uncomment +Plug 'tpope/vim-dadbod' " database interface +Plug 'tpope/vim-dispatch' " dispatch async +Plug 'tpope/vim-eunuch' " common shell commands +Plug 'tpope/vim-fugitive' " git wrapper +Plug 'tpope/vim-sensible' " reasonable defaults +Plug 'tpope/vim-surround' " xml tags +Plug 'tpope/vim-unimpaired' " brackets +Plug 'tpope/vim-vinegar' " enhance netrw + +" auto-align +Plug 'godlygeek/tabular' + +" fuzzy finder " consider telescope & fzf-lua instead below Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' +" git diff symbols Plug 'airblade/vim-gitgutter' -Plug 'nelstrom/vim-visual-star-search' + +" undotree visualizer +Plug 'mbbill/undotree' + +" browse tags Plug 'majutsushi/tagbar' -Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +" ??? need that? +"Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } -" lsp -Plug 'neovim/nvim-lspconfig' -Plug 'nvim-lua/lsp-status.nvim' +" navigate between splits (integrates with tmux) +Plug 'christoomey/vim-tmux-navigator' -Plug 'christoomey/vim-tmux-navigator' +" select in visual mode and search with `*` +Plug 'nelstrom/vim-visual-star-search' -Plug 'mbbill/undotree' +" LANGUAGE SERVER PROTOCOL +Plug 'neovim/nvim-lspconfig' +Plug 'nvim-lua/lsp-status.nvim' " LANGUAGE SPECIFIC - +" " Haskell -Plug 'neovimhaskell/haskell-vim' -Plug 'alx741/vim-stylishask' " let hls run this? -Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' } +"check: https://wiki.haskell.org/Vim +"try: haskell-tools.nvim ? +Plug 'neovimhaskell/haskell-vim' " highlight and indent (hls instead?) +Plug 'alx741/vim-stylishask' " maybe let hls run this instead? +"Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' } " Agda Plug 'derekelkins/agda-vim' "this requires python2 / pip2 :( @@ -77,7 +89,7 @@ Plug 'derekelkins/agda-vim' "this requires python2 / pip2 :( call plug#end() " }}} -" {{{ colors +" {{{ COLORS & FILETYPE colorscheme zenburn syntax on @@ -86,9 +98,12 @@ hi DiffAdd ctermfg=none ctermbg=23 hi DiffDelete ctermfg=none ctermbg=52 hi DiffChange ctermfg=none ctermbg=236 hi DiffText ctermfg=none ctermbg=94 + +" detect type and autoload plugin and indent files +filetype plugin indent on " }}} -" {{{ options +" {{{ OPTIONS set nocompatible set cursorcolumn set cursorline @@ -108,24 +123,10 @@ set noerrorbells set updatetime=1000 set signcolumn=yes set mouse=a -" disable preview window on autocompletion +set scrolloff=8 set completeopt-=preview -" }}} - -" detect type and autoload plugin and indent files -filetype plugin indent on - -let g:deoplete#enable_at_startup = 1 - -let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` -let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` -let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` -let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern` -let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles -let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` -let g:haskell_backpack = 1 " to enable highlighting of backpack keywords -" {{{ tabs +" tabs set listchars=tab:>.,trail:~ set list set tabstop=8 @@ -133,25 +134,21 @@ set softtabstop=4 set expandtab set shiftwidth=4 set shiftround -" }}} -" {{{ folding +" folding set foldcolumn=5 set foldlevelstart=0 -" }}} -" {{{ search +" search set hlsearch set incsearch set ignorecase set smartcase -" }}} - -set scrolloff=8 -" {{{ match brackets +" match brackets set showmatch set matchtime=5 + " }}} " {{{ KEY BINDINGS @@ -161,12 +158,8 @@ nmap _ let mapleader="\_" let maplocalleader="\_" -" get rid of bad habits. (might break other stuff eg. in cygwin) -" inoremap -" inoremap -" inoremap -" inoremap -" inoremap +" write current file as superuser +cmap w!! SudoWrite " activate 'very magic' for searches automatically nnoremap / /\v @@ -180,8 +173,8 @@ cnoremap jk tnoremap " easy editing and sourcing of vimrc -" nnoremap sv :source $MYVIMRC nnoremap ev :e $MYVIMRC +" nnoremap sv :source $MYVIMRC " turn off search highlight nnoremap h :nohlsearch @@ -189,17 +182,11 @@ nnoremap h :nohlsearch " layout "nnoremap ln :NERDTreeToggle -" silver search -"noremap a :Ack! - -" show list if multiple ctrl-] matches +" show list on multiple matches nnoremap g " misc nmap q :call setqflist(filter(getqflist(),"v:val['type'] == 'E'")) -nnoremap cc :set invcursorcolumn -nnoremap dd :wincmd gf:Gvdiff! develop2 -nnoremap tc :tabc " ctrl-space auto complete in insert mode inoremap @@ -227,22 +214,27 @@ augroup filetype_haskell autocmd Filetype haskell nnoremap l :lua vim.lsp.codelens.run() autocmd Filetype haskell nnoremap L :lua vim.lsp.codelens.refresh() autocmd Filetype haskell autocmd InsertLeave lua vim.lsp.codelens.refresh() -" vim.lsp.buf.formatting() -" vim.lsp.buf.rename() ? -" print(vim.lsp.buf.server_ready()) - + " vim.lsp.buf.formatting() + " vim.lsp.buf.rename() ? + " print(vim.lsp.buf.server_ready()) " autocmd Filetype haskell nnoremap x :call LanguageClient#explainErrorAtPoint() autocmd Filetype haskell setlocal softtabstop=2 autocmd Filetype haskell setlocal shiftwidth=2 autocmd Filetype haskell setlocal omnifunc=v:lua.vim.lsp.omnifunc - augroup END +" }}} +" {{{ PLUGINS CONFIG -" }}} +let g:deoplete#enable_at_startup = 1 -" write current file as superuser -cmap w!! SudoWrite +let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` +let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` +let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` +let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern` +let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles +let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` +let g:haskell_backpack = 1 " to enable highlighting of backpack keywords let g:fzf_layout = { 'down': '~40%' } @@ -332,3 +324,4 @@ require('lspconfig').hls.setup } END " }}} +" }}} -- cgit v1.2.3