mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-06-01 14:43:14 +02:00
nvim-telescope: add mappings for opening lsp stuff separately
This commit is contained in:
parent
bfe11b70bf
commit
d0c33ded0a
|
@ -24,21 +24,37 @@
|
||||||
(set utils.transform_path
|
(set utils.transform_path
|
||||||
(mztenv.telescope.makePathTransformer utils.transform_path))
|
(mztenv.telescope.makePathTransformer utils.transform_path))
|
||||||
|
|
||||||
(let [mopt mztenv.utils.map_opt
|
(macro nmap [map action opt]
|
||||||
lsp-opts {:fname_width 80 :show_line false}]
|
`(vim.keymap.set :n ,map #(,action (themes.get_ivy ,opt))
|
||||||
(macro nmap [map action opt]
|
mztenv.utils.map_opt))
|
||||||
`(vim.keymap.set :n ,map #(,action (themes.get_ivy ,opt)) mopt))
|
|
||||||
;; resume search
|
(macro lsp-map [suffix action extra-opts]
|
||||||
(nmap :fr builtin.resume)
|
(local opt {:fname_width 80 :show_line false})
|
||||||
;; file finding mappings
|
(each [k v (pairs (or extra-opts {}))]
|
||||||
(nmap :ff builtin.find_files)
|
(tset opt k v))
|
||||||
(nmap :fg builtin.live_grep)
|
`(do
|
||||||
;; LSP mappings
|
(nmap ,(.. :g suffix) ,action ,opt)
|
||||||
(nmap :gd builtin.lsp_definitions lsp-opts)
|
(nmap ,(.. :gt suffix) ,action
|
||||||
(nmap :gi builtin.lsp_implementations lsp-opts)
|
,(doto (collect [k v (pairs opt)] k v)
|
||||||
(nmap :gr builtin.lsp_references lsp-opts)
|
(tset :jump_type :tab)))
|
||||||
(nmap :gs builtin.lsp_dynamic_workspace_symbols lsp-opts)
|
(nmap ,(.. :gs suffix) ,action
|
||||||
(nmap :gp builtin.diagnostics {:bufnr 0})
|
,(doto (collect [k v (pairs opt)] k v)
|
||||||
(nmap :gP builtin.diagnostics)
|
(tset :jump_type :split)))
|
||||||
;; harpoon
|
(nmap ,(.. :gv suffix) ,action
|
||||||
(nmap :gm ext.harpoon.marks))
|
,(doto (collect [k v (pairs opt)] k v)
|
||||||
|
(tset :jump_type :vsplit)))))
|
||||||
|
|
||||||
|
;; resume search
|
||||||
|
(nmap :fr builtin.resume)
|
||||||
|
;; file finding mappings
|
||||||
|
(nmap :ff builtin.find_files)
|
||||||
|
(nmap :fg builtin.live_grep)
|
||||||
|
;; LSP mappings
|
||||||
|
(lsp-map :d builtin.lsp_definitions)
|
||||||
|
(lsp-map :i builtin.lsp_implementations)
|
||||||
|
(lsp-map :r builtin.lsp_references)
|
||||||
|
(lsp-map :s builtin.lsp_dynamic_workspace_symbols)
|
||||||
|
(lsp-map :p builtin.diagnostics {:bufnr 0})
|
||||||
|
(lsp-map :P builtin.diagnostics)
|
||||||
|
;; harpoon
|
||||||
|
(nmap :gm ext.harpoon.marks)
|
||||||
|
|
Loading…
Reference in a new issue