Various updates
This commit is contained in:
parent
a6a553c6b0
commit
c670bf843f
@ -88,7 +88,8 @@
|
|||||||
`(use ,output))
|
`(use ,output))
|
||||||
|
|
||||||
;; Call a plugin's `setup function'
|
;; Call a plugin's `setup function'
|
||||||
(lambda setup! [pkg ...] (local output [ ])
|
(lambda setup! [pkg ...]
|
||||||
|
(local output [ ])
|
||||||
(var last_key nil)
|
(var last_key nil)
|
||||||
(each [_ val (ipairs [...])]
|
(each [_ val (ipairs [...])]
|
||||||
(if last_key
|
(if last_key
|
||||||
@ -116,16 +117,10 @@
|
|||||||
`(let [save# (vim.fn.winsaveview)]
|
`(let [save# (vim.fn.winsaveview)]
|
||||||
,(unpack args))))
|
,(unpack args))))
|
||||||
|
|
||||||
;; Returns the keys for table
|
|
||||||
;; Careful, this finds them will a loop every time it is called!
|
|
||||||
(lambda keys! [table]
|
|
||||||
`(icollect [key# _# (pairs ,table)] key#))
|
|
||||||
|
|
||||||
{: bind!
|
{: bind!
|
||||||
: hook!
|
: hook!
|
||||||
: use!
|
: use!
|
||||||
: setup!
|
: setup!
|
||||||
: module-call!
|
: module-call!
|
||||||
: module-fn!
|
: module-fn!
|
||||||
: save-excursion!
|
: save-excursion!}
|
||||||
: keys!}
|
|
||||||
|
@ -85,6 +85,7 @@
|
|||||||
:TroubleToggle
|
:TroubleToggle
|
||||||
:TroubleClose
|
:TroubleClose
|
||||||
:TroubleRefresh ]
|
:TroubleRefresh ]
|
||||||
|
:module :trouble
|
||||||
:config
|
:config
|
||||||
(setup! :trouble))
|
(setup! :trouble))
|
||||||
|
|
||||||
@ -176,9 +177,9 @@
|
|||||||
|
|
||||||
; oil (file manager)
|
; oil (file manager)
|
||||||
(use! :stevearc/oil.nvim
|
(use! :stevearc/oil.nvim
|
||||||
:config
|
:confi
|
||||||
(setup! :oil
|
(setup! :oil
|
||||||
:columns { :icon :permissions :size: :mtime }))
|
:columns [ :icon :permissions :size: :mtime ]))
|
||||||
|
|
||||||
;; guess style from buffer
|
;; guess style from buffer
|
||||||
(use! :NMAC427/guess-indent.nvim
|
(use! :NMAC427/guess-indent.nvim
|
||||||
@ -211,7 +212,7 @@
|
|||||||
; :config
|
; :config
|
||||||
; (setup! :formatter
|
; (setup! :formatter
|
||||||
; :logging true
|
; :logging true
|
||||||
; :log_level _G.vim.log.levels.WARN
|
; :log_level _G.vim.log.levels.WA;RN
|
||||||
; :filetype {
|
; :filetype {
|
||||||
; :c [ (module-fn! :formatter.filetypes.c :astyle) ]
|
; :c [ (module-fn! :formatter.filetypes.c :astyle) ]
|
||||||
; :cpp [ (module-fn! :formatter.filetypes.cpp :astyle) ]
|
; :cpp [ (module-fn! :formatter.filetypes.cpp :astyle) ]
|
||||||
|
@ -44,10 +44,21 @@
|
|||||||
(bind! :n :gd "<cmd>Telescope lsp_definitions<cr>" buf)
|
(bind! :n :gd "<cmd>Telescope lsp_definitions<cr>" buf)
|
||||||
(bind! :n :gI "<cmd>Telescope lsp_implementations<cr>" buf)
|
(bind! :n :gI "<cmd>Telescope lsp_implementations<cr>" buf)
|
||||||
(bind! :n :D "<cmd>Telescope lsp_type_definitions<cr>" buf)
|
(bind! :n :D "<cmd>Telescope lsp_type_definitions<cr>" buf)
|
||||||
|
(bind! :n :<leader>fq "<cmd>Telescope diagnostics<cr>" buf)
|
||||||
|
|
||||||
;; Some trouble commands
|
;; Some trouble commands
|
||||||
(bind! :n :<leader>q "<cmd>TroubleToggle document_diagnostics<cr>")
|
(bind! :n :<leader>q (fn []
|
||||||
(bind! :n :<leader>Q "<cmd>TroubleToggle workspace_diagnostics<cr>"))
|
(let [trouble (require :trouble)]
|
||||||
|
(if (trouble.is_open)
|
||||||
|
(trouble.close)
|
||||||
|
true
|
||||||
|
(trouble.open :document_diagnostics)))))
|
||||||
|
(bind! :n :<leader>Q (fn []
|
||||||
|
(let [trouble (require :trouble)]
|
||||||
|
(if (trouble.is_open)
|
||||||
|
(trouble.close)
|
||||||
|
true
|
||||||
|
(trouble.open :workspace_diagnostics))))))
|
||||||
|
|
||||||
(fn get-data-dir [server root]
|
(fn get-data-dir [server root]
|
||||||
(let [resolved_path (vim.fn.resolve root)
|
(let [resolved_path (vim.fn.resolve root)
|
||||||
|
Reference in New Issue
Block a user