Some fixes

This commit is contained in:
elkowar 2021-05-17 17:06:21 +02:00
parent 39dae0dca0
commit 0a7b80f3e2
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
5 changed files with 30 additions and 19 deletions

View file

@ -99,6 +99,8 @@
(utils.highlight-add :NormalFloat {:bg colors.dark0_hard}) (utils.highlight-add :NormalFloat {:bg colors.dark0_hard})
(utils.highlight-add :SignColumn {:bg colors.dark0}) (utils.highlight-add :SignColumn {:bg colors.dark0})
(utils.highlight-add :FloatBorder {:bg colors.dark0_hard})
(utils.highlight ["StatusLine" "GalaxyLineInfo" "GalaxySpace" ] {:bg colors.dark1 :fg colors.light0}) (utils.highlight ["StatusLine" "GalaxyLineInfo" "GalaxySpace" ] {:bg colors.dark1 :fg colors.light0})

View file

@ -7,11 +7,8 @@
trouble trouble} trouble trouble}
require-macros [macros]}) require-macros [macros]})
; undo autopairs fuckup
(utils.keymap :i :<C-Space> "compe#complete()" {:expr true}) (set vim.g.AutoPairsShortcutBackInsert "<M-b>")
;(utils.keymap :i :<esc> "compe#close('<esc>')" {:expr true})
(utils.keymap :i :kj "compe#close('<esc>')" {:expr true})
(utils.keymap [:n] :<C-p> "<cmd>Telescope find_files<cr>") (utils.keymap [:n] :<C-p> "<cmd>Telescope find_files<cr>")
(utils.keymap :n :K "<Nop>") (utils.keymap :n :K "<Nop>")
@ -22,13 +19,6 @@
(utils.keymap :n :MN "<cmd>lua require('nvim-gehzu').show_definition()<CR>" {}) (utils.keymap :n :MN "<cmd>lua require('nvim-gehzu').show_definition()<CR>" {})
; TODO let's see if i want these
; (utils.keymap :n :<C-h> "<C-w><C-h>")
; (utils.keymap :n :<C-j> "<C-w><C-j>")
; (utils.keymap :n :<C-k> "<C-w><C-k>")
; (utils.keymap :n :<C-l> "<C-w><C-l>")
(fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc]) (fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc])
(fn rebind [s desc] [s desc]) (fn rebind [s desc] [s desc])

View file

@ -22,6 +22,9 @@
:run ":TSUpdate"} :run ":TSUpdate"}
:nvim-treesitter/playground {} :nvim-treesitter/playground {}
:jiangmiao/auto-pairs {}
; :code-biscuits/nvim-biscuits {} ; show opening line after closing curly ; :code-biscuits/nvim-biscuits {} ; show opening line after closing curly
:folke/which-key.nvim {} :folke/which-key.nvim {}
@ -91,8 +94,8 @@
:justinmk/vim-sneak {:mod "plugins.sneak"} :justinmk/vim-sneak {:mod "plugins.sneak"}
:psliwka/vim-smoothie {} :psliwka/vim-smoothie {}
:editorconfig/editorconfig-vim {} :editorconfig/editorconfig-vim {}
:honza/vim-snippets {}
:tommcdo/vim-exchange {} :tommcdo/vim-exchange {}
;:frazrepo/vim-rainbow {} ;:frazrepo/vim-rainbow {}
;:bhurlow/vim-parinfer {:ft ["fennel" "carp" "lisp" "elisp"]} ;:bhurlow/vim-parinfer {:ft ["fennel" "carp" "lisp" "elisp"]}
@ -124,7 +127,7 @@
:simrat39/rust-tools.nvim {:ft ["rust"]} :simrat39/rust-tools.nvim {:ft ["rust"]}
:qnighy/lalrpop.vim {} :qnighy/lalrpop.vim {}
;:ray-x/lsp_signature.nvim {} :ray-x/lsp_signature.nvim {}
:vmchale/ats-vim {:ft ["ats"]} :vmchale/ats-vim {:ft ["ats"]}

View file

@ -1,5 +1,11 @@
(module plugins.compe (module plugins.compe
{require {compe compe}}) {require {utils utils
compe compe}})
(utils.keymap :i :<C-Space> "compe#complete()" {:expr true})
(utils.keymap :i :kj "compe#close('<esc>')" {:expr true})
;(utils.keymap :i :<esc> "compe#close('<esc>')" {:expr true})
(defn result-formatter [items] (defn result-formatter [items]
@ -35,6 +41,7 @@
:calc true :calc true
:nvim_lsp true :nvim_lsp true
:nvim_lua true :nvim_lua true
:emoji false
:vsnip false :vsnip false
:conjure true}}) :conjure true}})

View file

@ -8,7 +8,12 @@
(fn on_attach [client bufnr] (fn on_attach [client bufnr]
(pkg lsp_signature.nvim [lsp_signature (require "lsp_signature")] (pkg lsp_signature.nvim [lsp_signature (require "lsp_signature")]
(lsp_signature.on_attach)) (lsp_signature.on_attach {:bind true
:hint_scheme "String"
:hint_prefix "ƒ "
:handler_opts {:border "single"}
:use_lspsaga false
:decorator ["`" "`"]}))
(if client.resolved_capabilities.document_highlight (if client.resolved_capabilities.document_highlight
(do (do
@ -30,11 +35,15 @@
(when (not ((lsp.util.root_pattern except-patterns) path)) (when (not ((lsp.util.root_pattern except-patterns) path))
((lsp.util.root_pattern patterns) path)))) ((lsp.util.root_pattern patterns) path))))
; advertise snippet support
(def default-capabilities
(let [capabilities (vim.lsp.protocol.make_client_capabilities)]
(set capabilities.textDocument.completion.completionItem.snippetSupport true)
capabilities))
(fn init-lsp [lsp-name ?opts] (fn init-lsp [lsp-name ?opts]
"initialize a language server with defaults" "initialize a language server with defaults"
(let [merged-opts (a.merge {:on_attach on_attach} (or ?opts {}))] (let [merged-opts (a.merge {:on_attach on_attach :capabilities default-capabilities} (or ?opts {}))]
((. lsp lsp-name :setup) merged-opts))) ((. lsp lsp-name :setup) merged-opts)))
; Added capabilities for rust-analyzer with nvim-compe ; Added capabilities for rust-analyzer with nvim-compe