diff --git a/fnl/init.fnl b/fnl/init.fnl index f3c6b30..d82cb33 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -15,7 +15,7 @@ (fn [x] (print (fennel.view x)))) -(set nvim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.") +;(set nvim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.") @@ -52,4 +52,3 @@ :separator visible :indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua}}})) - diff --git a/fnl/keybinds.fnl b/fnl/keybinds.fnl index 4ac8a47..4d17d63 100644 --- a/fnl/keybinds.fnl +++ b/fnl/keybinds.fnl @@ -9,10 +9,13 @@ (utils.noremap :n : ":WhichKey ''") (utils.noremap :v : ":WhichKeyVisual ''") -(utils.mapexpr :i : "compe#complete()") ;(utils.mapexpr :i : "compe#confirm(lexima#expand('CR>', 'i'))") + +(utils.mapexpr :i : "compe#complete()") (utils.mapexpr :i : "compe#close('')") + + (fn le [s] (.. ":call luaeval(\"" s "\")")) (set nvim.g.which_key_map {}) @@ -50,8 +53,8 @@ "e" [ (le "vim.lsp.diagnostic.goto_next()") "Jump to the next error"] "g" [ (le "vim.lsp.buf.definition()") "go to definition"] "i" [ (le "vim.lsp.buf.implementation()") "show implementation"] - "r" [ (le "vim.lsp.buf.references()") "show references"] - ;"r" [ ":Telescope lsp_references" "show references"] + ;"r" [ (le "vim.lsp.buf.references()") "show references"] + "r" [ ":Telescope lsp_references" "show references"] "f" [ (le "vim.lsp.buf.formatting()") "format file"]} diff --git a/fnl/plugins/galaxyline.fnl b/fnl/plugins/galaxyline.fnl index 427b31f..86685bc 100644 --- a/fnl/plugins/galaxyline.fnl +++ b/fnl/plugins/galaxyline.fnl @@ -15,23 +15,23 @@ (local colors (utils.colors)) (local modes - { :n { :text "NORMAL" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + { :n { :text "NORMAL" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :i { :text "INSERT" :colors { :bg colors.neutral_yellow :fg colors.dark0}} - :c { :text "CMD" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :ce { :text "NORMEX" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :cv { :text "EX" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :ic { :text "INSCOMP" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :no { :text "OP-PENDING" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :r { :text "HIT-ENTER" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :r? { :text "CONFIRM" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :R { :text "REPLACE" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :Rv { :text "VIRTUAL" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :s { :text "SELECT" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :S { :text "SELECT" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :t { :text "TERM" :colors { :bg colors.neutral_aqua :fg colors.dark0}} - :v { :text "VISUAL" :colors { :bg colors.neutral_blue :fg colors.dark0}} - :V { :text "VISUAL LINE" :colors { :bg colors.neutral_blue :fg colors.dark0}} - "" { :text "VISUAL BLOCK" :colors { :bg colors.neutral_blue :fg colors.dark0}}}) + :c { :text "CMD" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :ce { :text "NORMEX" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :cv { :text "EX" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :ic { :text "INSCOMP" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :no { :text "OP-PENDING" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :r { :text "HIT-ENTER" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :r? { :text "CONFIRM" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :R { :text "REPLACE" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :Rv { :text "VIRTUAL" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :s { :text "SELECT" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :S { :text "SELECT" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :t { :text "TERM" :colors { :bg colors.neutral_aqua :fg colors.dark0}} + :v { :text "VISUAL" :colors { :bg colors.neutral_blue :fg colors.dark0}} + :V { :text "VISUAL LINE" :colors { :bg colors.neutral_blue :fg colors.dark0}} + "" { :text "VISUAL BLOCK" :colors { :bg colors.neutral_blue :fg colors.dark0}}}) (fn buf-empty? [] diff --git a/fnl/plugins/lsp.fnl b/fnl/plugins/lsp.fnl index 8366e97..d89f071 100644 --- a/fnl/plugins/lsp.fnl +++ b/fnl/plugins/lsp.fnl @@ -3,6 +3,7 @@ fennel aniseed.fennel nvim aniseed.nvim lsp lspconfig + lsp-configs lspconfig.configs saga lspsaga utils utils compe compe} @@ -26,17 +27,47 @@ false)))) -(lsp.rust_analyzer.setup { :on_attach on_attach}) -(lsp.jsonls.setup { :on_attach on_attach }) -(lsp.vimls.setup { :on_attach on_attach }) +(fn better_root_pattern [patterns except-patterns] + "match path if one of the given patterns is matched, EXCEPT if one of the except-patterns is matched" + (fn [path] + (when (not ((lsp.util.root_pattern except-patterns) path)) + ((lsp.util.root_pattern patterns) path)))) + + +(local capabilities (vim.lsp.protocol.make_client_capabilities)) +(set capabilities.textDocument.completion.completionItem.snippetSupport true) +(set capabilities.textDocument.completion.completionItem.resolveSupport + { :properties ["documentation" "detail" "additionalTextEdits"]}) + +(lsp.rust_analyzer.setup { :on_attach on_attach + :capabilities capabilities}) +(lsp.vimls.setup { :on_attach on_attach}) (lsp.tsserver.setup { :on_attach on_attach :root_dir (lsp.util.root_pattern "package.json")}) (lsp.bashls.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")}) + :root_dir (better_root_pattern [".git"] ["package.json"])}) (lsp.hls.setup { :on_attach on_attach :settings { :languageServerHaskell { :formattingProvider "stylish-haskell"}}}) + +(lsp.jsonls.setup + { :on_attach on_attach + :commands { :Format [ (fn [] (vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0]))]}}) + + + + +(when (not lsp.erlangls) + (set lsp-configs.erlangls + { :default_config + { :cmd ["erlang_ls"] + :filetypes ["lua"] + :root_dir (lsp.util.root_pattern "rebar.config") + :settings {}}})) +(lsp.erlangls.setup {}) + + (compe.setup { :enabled true :autocomplete false diff --git a/plugins.vim b/plugins.vim index 7232c53..1f0a7c9 100644 --- a/plugins.vim +++ b/plugins.vim @@ -66,7 +66,7 @@ call plug#begin('~/.vim/plugged') Plug 'bhurlow/vim-parinfer' - Plug 'Olical/conjure', {'tag': 'v4.17.0'} + "Plug 'Olical/conjure', {'tag': 'v4.17.0'} " Language Plugins ----------------------------------------------------- {{{ @@ -102,6 +102,8 @@ call plug#begin('~/.vim/plugged') Plug 'neovim/nvim-lspconfig' + + "Plug 'nvim-lua/completion-nvim' Plug 'hrsh7th/nvim-compe' Plug 'glepnir/lspsaga.nvim' "Plug 'cohama/lexima.vim'