From d6d42a3852c61cd2e1e50e3123ba5bc0d88e7028 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sun, 4 Apr 2021 15:04:29 +0200 Subject: [PATCH] cleanup config --- fnl/plugins/lsp.fnl | 32 ++++++++++++++++++++----------- fnl/utils.fnl | 9 ++++++--- init.vim | 2 -- plugins.vim | 46 +-------------------------------------------- 4 files changed, 28 insertions(+), 61 deletions(-) diff --git a/fnl/plugins/lsp.fnl b/fnl/plugins/lsp.fnl index 398a679..c49405c 100644 --- a/fnl/plugins/lsp.fnl +++ b/fnl/plugins/lsp.fnl @@ -4,6 +4,7 @@ nvim aniseed.nvim lsp lspconfig saga lspsaga + utils utils compe compe} @@ -12,16 +13,17 @@ (fn on_attach [client bufnr] (if client.resolved_capabilities.document_highlight - (vim.api.nvim_exec - "hi LspReferenceRead cterm=bold ctermbg=red guibg='#8ec07c' guifg='#282828' - hi LspReferenceText cterm=bold ctermbg=red guibg='#8ec07c' guifg='#282828' - hi LspReferenceWrite cterm=bold ctermbg=red guibg='#8ec07c' guifg='#282828' - augroup lsp_document_highlight - autocmd! * - autocmd CursorHold lua vim.lsp.buf.document_highlight() - autocmd CursorMoved lua vim.lsp.buf.clear_references() - augroup END" - false))) + (do + (utils.highlight "LspReferenceRead" {:gui "underline"}) + (utils.highlight "LspReferenceText" {:gui "underline"}) + (utils.highlight "LspReferenceWrite" {:gui "underline"}) + (vim.api.nvim_exec + "augroup lsp_document_highlight + autocmd! * + autocmd CursorHold lua vim.lsp.buf.document_highlight() + autocmd CursorMoved lua vim.lsp.buf.clear_references() + augroup END" + false)))) (lsp.rust_analyzer.setup { :on_attach on_attach }) @@ -29,7 +31,7 @@ (lsp.vimls.setup { :on_attach on_attach }) (lsp.tsserver.setup { :on_attach on_attach }) (lsp.bashls.setup { :on_attach on_attach }) -(lsp.html.setup { :on_attach on_attach }) +(lsp.html.setup { :on_attach on_attach}) (lsp.denols.setup { :on_attach on_attach :root_dir (lsp.util.root_pattern ".git") }) @@ -68,3 +70,11 @@ :scroll_up "" :scroll_down ""}}) + +(utils.highlight "LspSagaCodeActionTitle" {:fg "#8ec07c"}) +(utils.highlight "LspSagaBorderTitle" {:fg "#8ec07c"}) +(utils.highlight "LspSagaCodeActionContent" {:fg "#8ec07c"}) +(utils.highlight "LspSagaFinderSelection" {:fg "#8ec07c"}) +(utils.highlight "LspSagaDiagnosticHeader" {:fg "#8ec07c"}) + +(set nvim.o.signcolumn "yes") diff --git a/fnl/utils.fnl b/fnl/utils.fnl index 4498a1c..76618ce 100644 --- a/fnl/utils.fnl +++ b/fnl/utils.fnl @@ -53,8 +53,11 @@ (defn highlight [group colset] - (nvim.command (.. "hi " group " guifg='" colset.fg "' guibg='" colset.bg "' gui=NONE"))) + (let [default { :fg "NONE" :bg "NONE" :gui "NONE"} + opts (a.merge default colset)] + (nvim.command (.. "hi! "group" guifg='"opts.fg"' guibg='"opts.bg"' gui='"opts.gui"'")))) -(defn comp [f g ...] - (f (g ...))) +(defn comp [f g] + (fn [...] + (f (g ...)))) diff --git a/init.vim b/init.vim index 7f58234..865045f 100644 --- a/init.vim +++ b/init.vim @@ -9,8 +9,6 @@ let g:vim_config_root = expand(':p:h') let $VIM_ROOT = g:vim_config_root -let g:vimspector_enable_mappings = 'HUMAN' - source $VIM_ROOT/plugins.vim diff --git a/plugins.vim b/plugins.vim index 7a8e150..4f7eb82 100644 --- a/plugins.vim +++ b/plugins.vim @@ -10,7 +10,6 @@ call plug#begin('~/.vim/plugged') Plug 'akinsho/nvim-bufferline.lua' Plug 'Olical/aniseed', { 'tag': 'v3.16.0' } - Plug 'bakpakin/fennel.vim' " general purpose lua wrappers for nvim stuff Plug 'norcalli/nvim.lua' @@ -19,15 +18,10 @@ call plug#begin('~/.vim/plugged') Plug 'tpope/vim-repeat' Plug 'junegunn/goyo.vim', {'on': 'Goyo'} - "Plug 'osyo-manga/vim-over', {'on': 'OverCommandLine'} " Substitute preview Plug 'liuchengxu/vim-which-key' - if has('nvim') || has('patch-8.0.902') - Plug 'mhinz/vim-signify' - else - Plug 'mhinz/vim-signify', { 'branch': 'legacy' } - endif + Plug 'mhinz/vim-signify' Plug 'tpope/vim-fugitive' @@ -35,21 +29,11 @@ call plug#begin('~/.vim/plugged') Plug 'glepnir/galaxyline.nvim' - "Plug 'vim-airline/vim-airline-themes' - "Plug 'vim-airline/vim-airline' - - " buffer line - if has('nvim') - "Plug 'romgrk/barbar.nvim' - endif - - "Plug 'morhetz/gruvbox' Plug 'gruvbox-community/gruvbox' Plug 'godlygeek/tabular' " :Tab /regex can align code on occurrences of the given regex. I.e. :Tab /= aligns all = signs in a block. Plug 'tpope/vim-surround' - "Plug 'easymotion/vim-easymotion' " press f [somekey] to have quick-movement to any occurrence of the key Plug 'christoomey/vim-tmux-navigator' " good integration with tmux pane switching Plug 'nathanaelkane/vim-indent-guides' " Can be toggled using ig (intent-guides) @@ -59,16 +43,10 @@ call plug#begin('~/.vim/plugged') Plug 'mg979/vim-visual-multi' Plug 'hauleth/sad.vim' " Use siw instead of ciw. when using . afterwards, will find the next occurrence of the changed word and change it too Plug 'wellle/targets.vim' " more text objects. IE: cin) (change in next parens). generally better handling of surrounding objects. - "Plug 'haya14busa/incsearch.vim' " Show search result-highlights whilst typing the query - - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Fuzzy file opener, use: :FZF or :FZF! for fullscreen - Plug 'junegunn/fzf.vim' Plug 'unblevable/quick-scope' " highlight targets when pressing f Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } } " :MarkdownPreview for live markdown preview - "Plug 'jiangmiao/auto-pairs' - Plug 'machakann/vim-highlightedyank' Plug 'ciaranm/detectindent' @@ -78,22 +56,10 @@ call plug#begin('~/.vim/plugged') Plug 'editorconfig/editorconfig-vim' - Plug 'honza/vim-snippets' - Plug 'liuchengxu/vista.vim' - - Plug 'antoinemadec/coc-fzf' - Plug 'tommcdo/vim-exchange' - if !has('nvim') - Plug 'puremourning/vimspector' - endif - - Plug 'svermeulen/vim-yoink' - - Plug 'Shougo/echodoc.vim' Plug 'kien/rainbow_parentheses.vim' Plug 'bhurlow/vim-parinfer' @@ -103,7 +69,6 @@ call plug#begin('~/.vim/plugged') " Language Plugins ----------------------------------------------------- {{{ - Plug 'ziglang/zig.vim' Plug 'bduggan/vim-raku' Plug 'LnL7/vim-nix' @@ -116,8 +81,6 @@ call plug#begin('~/.vim/plugged') Plug 'sheerun/vim-polyglot' " Syntax highlighting for most languages "Plug 'mattn/emmet-vim' - Plug 'udalov/kotlin-vim' - Plug 'purescript-contrib/purescript-vim' Plug 'HerringtonDarkholme/yats.vim' " typescript syntax highlighting @@ -125,20 +88,13 @@ call plug#begin('~/.vim/plugged') "" Haskell Plug 'neovimhaskell/haskell-vim' - Plug 'Twinside/vim-hoogle', {'on': 'Hoogle'} " Rust Plug 'rust-lang/rust.vim' Plug 'mattn/webapi-vim' - - "Plug 'neoclide/coc.nvim', {'branch': 'release'} - Plug 'thyrgle/vim-dyon' - Plug 'bakpakin/fennel.vim' - Plug 'tjdevries/nlua.nvim' - "Plug 'nvim-lua/completion-nvim' "Plug 'mxw/vim-prolog'