epic vim stuff

This commit is contained in:
elkowar 2021-04-30 16:26:31 +02:00
parent 76bf280f9d
commit c7566e0f7d
4 changed files with 65 additions and 40 deletions

View file

@ -3,7 +3,8 @@
fennel aniseed.fennel fennel aniseed.fennel
nvim aniseed.nvim nvim aniseed.nvim
kb keybinds kb keybinds
utils utils} utils utils
nvim-treesitter-configs nvim-treesitter.configs}
require-macros [macros]}) require-macros [macros]})
(require "plugins.telescope") (require "plugins.telescope")
@ -14,8 +15,26 @@
;(set nvim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.") ;(set nvim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.")
(nvim-treesitter-configs.setup
{ :ensure_installed "all"
:highlight { :enable true
:disable ["fennel"] }
:indent { :enable true }
; " :: and _ as space ------------------------------------------------------------------- {{{ :incremental_selection
{ :enable true
:keymaps { :init_selection "gss"
:node_incremental "gsl"
:node_decremental "gsh"
:scope_incremental "gsj"
:scope_decremental "gsk"}}
:rainbow { :enable true
:extended_mode true}
:context_commentstring { :enable true}})
; " :: and _ as space ------------------------------------------------------------------- <<<<<
(var remapped-space nil) (var remapped-space nil)
(fn _G.RebindShit [newKey] (fn _G.RebindShit [newKey]
(set remapped-space {:old (vim.fn.maparg :<Space> :i) (set remapped-space {:old (vim.fn.maparg :<Space> :i)
@ -41,4 +60,6 @@
(utils.keymap :i "<Tab>k" "<space><C-o>:call v:lua.RebindShit('::')<CR>") (utils.keymap :i "<Tab>k" "<space><C-o>:call v:lua.RebindShit('::')<CR>")
(utils.keymap :n "ö" "a") (utils.keymap :n "ö" "a")
; }}} ; >>>>>
; vim:foldmarker=<<<<<,>>>>>

View file

@ -44,10 +44,10 @@
"E" (cmd "Telescope lsp_workspace_diagnostics" "List diagnostics") "E" (cmd "Telescope lsp_workspace_diagnostics" "List diagnostics")
"r" (cmd "Telescope lsp_references" "Show references") "r" (cmd "Telescope lsp_references" "Show references")
"e" (cmd "LspTroubleOpen" "Show diagnostics") "e" (cmd "LspTroubleOpen" "Show diagnostics")
;"e" (le "vim.lsp.diagnostic.goto_next()" "Jump to the next error") "g" [vim.lsp.buf.definition "Go to definition"]
"g" (le "vim.lsp.buf.definition()" "Go to definition") "i" [vim.lsp.buf.implementation "Show implementation"]
"i" (le "vim.lsp.buf.implementation()" "Show implementation") "f" [vim.lsp.buf.formatting "format file"]
"f" (le "vim.lsp.buf.formatting()" "format file")} "h" (cmd "RustToggleInlayHints" "Toggle inlay hints")}
"f" { :name "+folds" "f" { :name "+folds"
"o" (cmd "foldopen" "open fold") "o" (cmd "foldopen" "open fold")

View file

@ -10,7 +10,7 @@
lsp_signature lsp_signature lsp_signature lsp_signature
symbols-outline symbols-outline symbols-outline symbols-outline
trouble trouble trouble trouble
nvim-treesitter-configs nvim-treesitter.configs} rust-tools rust-tools}
require-macros [macros]}) require-macros [macros]})
@ -18,25 +18,8 @@
(symbols-outline.setup { :highlight_hovered_item true :show_guides true}) (symbols-outline.setup { :highlight_hovered_item true :show_guides true})
(nvim-treesitter-configs.setup
{ :ensure_installed "all"
:highlight { :enable true}
:indent { :enable true}
:incremental_selection ; LSP config -------------------------------------------------------------------------------- <<<<<
{ :enable true
:keymaps { :init_selection "gss"
:node_incremental "gsl"
:node_decremental "gsh"
:scope_incremental "gsj"
:scope_decremental "gsk"}}
:rainbow { :enable true
:extended_mode true}
:context_commentstring { :enable true}})
; LSP config -------------------------------------------------------------------------------- {{{{{
(fn on_attach [client bufnr] (fn on_attach [client bufnr]
(lsp_signature.on_attach) (lsp_signature.on_attach)
@ -61,10 +44,6 @@
((lsp.util.root_pattern 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"]})
(fn init-lsp [lsp-name ?opts] (fn init-lsp [lsp-name ?opts]
"initialize a language server with defaults" "initialize a language server with defaults"
@ -72,7 +51,12 @@
((. lsp lsp-name :setup) merged-opts))) ((. lsp lsp-name :setup) merged-opts)))
(init-lsp :rust_analyzer { :capabilities capabilities}) (let [capabilities (vim.lsp.protocol.make_client_capabilities)]
(set capabilities.textDocument.completion.completionItem.snippetSupport true)
(set capabilities.textDocument.completion.completionItem.resolveSupport
{ :properties ["documentation" "detail" "additionalTextEdits"]})
(init-lsp :rust_analyzer { :capabilities capabilities}))
(init-lsp :tsserver { :root_dir (lsp.util.root_pattern "package.json")}) (init-lsp :tsserver { :root_dir (lsp.util.root_pattern "package.json")})
(init-lsp :jsonls { :commands { :Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}}) (init-lsp :jsonls { :commands { :Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}})
(init-lsp :denols { :root_dir (better_root_pattern [".git"] ["package.json"])}) (init-lsp :denols { :root_dir (better_root_pattern [".git"] ["package.json"])})
@ -86,9 +70,9 @@
;(lsp.vimls.setup { :on_attach on_attach}) ;(lsp.vimls.setup { :on_attach on_attach})
; }}}}} ; >>>>>
; compe -------------------------------------------------------------------------------- {{{{{ ; compe -------------------------------------------------------------------------------- <<<<<
(compe.setup (compe.setup
{ :enabled true { :enabled true
:autocomplete false :autocomplete false
@ -109,12 +93,15 @@
:nvim_lua true :nvim_lua true
:vsnip false}}) :vsnip false}})
; }}}}} ; >>>>>
; LSP saga -------------------------------------------------------------------------------- {{{{{ ; LSP saga -------------------------------------------------------------------------------- <<<<<
(saga.init_lsp_saga (saga.init_lsp_saga
{ :border_style 1 { :border_style "single" ; single double round plus
:code_action_prompt { :enable true
:sign true
:virtual_text false}
:code_action_keys { :quit "<esc>" :exec "<CR>"} :code_action_keys { :quit "<esc>" :exec "<CR>"}
:rename_action_keys { :quit "<esc>" :exec "<CR>"} :rename_action_keys { :quit "<esc>" :exec "<CR>"}
:finder_action_keys { :quit "<esc>" :finder_action_keys { :quit "<esc>"
@ -125,6 +112,14 @@
:scroll_down "<C-d>"}}) :scroll_down "<C-d>"}})
(utils.highlight "LspFloatWinNormal" {:bg colors.dark0_hard})
(utils.highlight "LspFloatWinBorder" {:bg colors.dark0_hard :fg colors.dark0_hard})
(utils.highlight "LspSagaHoverBorder" {:bg colors.dark0_hard :fg colors.dark0_hard})
(utils.highlight "LspSagaRenameBorder" {:bg colors.dark0_hard :fg colors.dark0_hard})
(utils.highlight "LspSagaSignatureHelpBorder" {:bg colors.dark0_hard :fg colors.dark0_hard})
(utils.highlight "LspSagaCodeActionBorder" {:bg colors.dark0_hard :fg colors.dark0_hard})
(utils.highlight "LspSagaDefPreviewBorder" {:bg colors.dark0_hard :fg colors.dark0_hard})
(utils.highlight "LspSagaCodeActionTitle" {:fg colors.bright_aqua}) (utils.highlight "LspSagaCodeActionTitle" {:fg colors.bright_aqua})
(utils.highlight "LspSagaBorderTitle" {:fg colors.bright_aqua}) (utils.highlight "LspSagaBorderTitle" {:fg colors.bright_aqua})
(utils.highlight "LspSagaCodeActionContent" {:fg colors.bright_aqua}) (utils.highlight "LspSagaCodeActionContent" {:fg colors.bright_aqua})
@ -133,9 +128,9 @@
(utils.highlight "TargetWord" {:fg colors.bright_aqua}) (utils.highlight "TargetWord" {:fg colors.bright_aqua})
; }}}}} ; >>>>>
; LSP trouble -------------------------------------------------------------------------------- {{{{{ ; LSP trouble -------------------------------------------------------------------------------- <<<<<
(trouble.setup (trouble.setup
{:icons false {:icons false
:auto_preview true :auto_preview true
@ -152,9 +147,16 @@
(utils.highlight "LspTroubleSignInformation" {:bg "NONE" :fg colors.bright_aqua}) (utils.highlight "LspTroubleSignInformation" {:bg "NONE" :fg colors.bright_aqua})
(utils.highlight "LspTroubleSignHint" {:bg "NONE" :fg colors.bright_blue}) (utils.highlight "LspTroubleSignHint" {:bg "NONE" :fg colors.bright_blue})
; }}}}} ; >>>>>
; Empty template -------------------------------------------------------------------------------- <<<<<
; >>>>>
(rust-tools.setup { :inlay_hints { :show_parameter_hints false}})
(set vim.o.signcolumn "yes") (set vim.o.signcolumn "yes")
; vim:foldmarker={{{{{,}}}}}
; vim:foldmarker=<<<<<,>>>>>

View file

@ -127,6 +127,8 @@ require("packer").startup(function(use)
-- use "mxw/vim-prolog" -- use "mxw/vim-prolog"
use "simrat39/rust-tools.nvim"
use "neovim/nvim-lspconfig" use "neovim/nvim-lspconfig"
-- use "nvim-lua/completion-nvim" -- use "nvim-lua/completion-nvim"