mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-25 21:52:23 +00:00
Improve nvim lsp hover popup, add difftastic
This commit is contained in:
parent
1d20c25d24
commit
38d010650f
5 changed files with 35 additions and 7 deletions
|
@ -6,12 +6,15 @@
|
||||||
helper = store
|
helper = store
|
||||||
[core]
|
[core]
|
||||||
autocrlf = input
|
autocrlf = input
|
||||||
pager = delta
|
;pager = delta
|
||||||
[pull]
|
[pull]
|
||||||
rebase = false
|
rebase = false
|
||||||
[github]
|
[github]
|
||||||
user = ElKowar
|
user = ElKowar
|
||||||
|
|
||||||
|
[diff]
|
||||||
|
external = "difft"
|
||||||
|
|
||||||
|
|
||||||
[delta]
|
[delta]
|
||||||
syntax-theme = gruvbox
|
syntax-theme = gruvbox
|
||||||
|
@ -37,3 +40,6 @@
|
||||||
dn = diff --numstat
|
dn = diff --numstat
|
||||||
ss = status
|
ss = status
|
||||||
a = add
|
a = add
|
||||||
|
[push]
|
||||||
|
autoSetupRemote = true
|
||||||
|
default = current
|
||||||
|
|
|
@ -57,7 +57,6 @@ in
|
||||||
ripgrep
|
ripgrep
|
||||||
fd
|
fd
|
||||||
jq
|
jq
|
||||||
nodejs
|
|
||||||
nodePackages.bash-language-server
|
nodePackages.bash-language-server
|
||||||
nodePackages.dockerfile-language-server-nodejs
|
nodePackages.dockerfile-language-server-nodejs
|
||||||
cargo-outdated
|
cargo-outdated
|
||||||
|
|
|
@ -102,6 +102,13 @@
|
||||||
; >>>
|
; >>>
|
||||||
|
|
||||||
; git stuff <<<
|
; git stuff <<<
|
||||||
|
:ldelossa/gh.nvim {:config #(do ((. (require "litee.lib") :setup))
|
||||||
|
((. (require "litee.gh") :setup)))
|
||||||
|
:requires [:ldelossa/litee.nvim]}
|
||||||
|
:pwntester/octo.nvim {:requires [:nvim-lua/plenary.nvim
|
||||||
|
:nvim-telescope/telescope.nvim
|
||||||
|
:kyazdani42/nvim-web-devicons]
|
||||||
|
:config #((. (require "octo") :setup))}
|
||||||
:sindrets/diffview.nvim {:cmd ["DiffviewOpen" "DiffviewToggleFiles"]
|
:sindrets/diffview.nvim {:cmd ["DiffviewOpen" "DiffviewToggleFiles"]
|
||||||
:config #(require "dots.plugins.diffview")}
|
:config #(require "dots.plugins.diffview")}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
(def default-capabilities
|
(def default-capabilities
|
||||||
(let [capabilities (vim.lsp.protocol.make_client_capabilities)]
|
(let [capabilities (vim.lsp.protocol.make_client_capabilities)]
|
||||||
(set capabilities.textDocument.completion.completionItem.snippetSupport true)
|
(set capabilities.textDocument.completion.completionItem.snippetSupport true)
|
||||||
(cmp_nvim_lsp.update_capabilities capabilities)))
|
(cmp_nvim_lsp.default_capabilities 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"
|
||||||
|
@ -102,10 +102,10 @@
|
||||||
:less {:validate true}
|
:less {:validate true}
|
||||||
:scss {:validate true}}})
|
:scss {:validate true}}})
|
||||||
|
|
||||||
;(lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json")
|
(lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json")
|
||||||
;:on_attach (fn [client bufnr]
|
:on_attach (fn [client bufnr]
|
||||||
;(set client.resolved_capabilities.document_formatting false)
|
(set client.resolved_capabilities.document_formatting false)
|
||||||
;(on_attach client bufnr))})
|
(on_attach client bufnr))})
|
||||||
|
|
||||||
|
|
||||||
(let [rust-tools (require "rust-tools")
|
(let [rust-tools (require "rust-tools")
|
||||||
|
@ -232,6 +232,21 @@
|
||||||
|
|
||||||
(set vim.opt.signcolumn "yes")
|
(set vim.opt.signcolumn "yes")
|
||||||
|
|
||||||
|
; Cleanup links in markdown documentation
|
||||||
|
(defn- cleanup-markdown [contents]
|
||||||
|
(if (= contents.kind "markdown")
|
||||||
|
(tset contents :value (string.gsub contents.value "%[([^%]]+)%]%(([^%)]+)%)" "[%1]")))
|
||||||
|
contents)
|
||||||
|
|
||||||
|
(let [previous-handler (. vim.lsp.handlers :textDocument/hover)]
|
||||||
|
(tset vim.lsp.handlers :textDocument/hover
|
||||||
|
(fn [a result b c]
|
||||||
|
(if (not (and result result.contents))
|
||||||
|
(previous-handler a result b c)
|
||||||
|
(let [new-contents (cleanup-markdown result.contents)]
|
||||||
|
(tset result :contents new-contents)
|
||||||
|
(previous-handler a result b c))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; vim:foldmarker=<<<<<,>>>>>
|
; vim:foldmarker=<<<<<,>>>>>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
abbr cvim="cd ~/.config/nvim && nvim && cd -"
|
abbr cvim="cd ~/.config/nvim && nvim && cd -"
|
||||||
|
abbr cnt="cargo nextest run"
|
||||||
abbr cnix="cd ~/.config/nixpkgs && nvim && cd -"
|
abbr cnix="cd ~/.config/nixpkgs && nvim && cd -"
|
||||||
abbr cxmonad="cd ~/.xmonad && nvim lib/Config.hs && cd -"
|
abbr cxmonad="cd ~/.xmonad && nvim lib/Config.hs && cd -"
|
||||||
abbr ra="ranger"
|
abbr ra="ranger"
|
||||||
|
|
Loading…
Reference in a new issue