Various updates

This commit is contained in:
Alexander Rosenberg 2023-08-19 11:31:27 -07:00
parent a6a553c6b0
commit c670bf843f
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
3 changed files with 20 additions and 13 deletions

View File

@ -88,7 +88,8 @@
`(use ,output))
;; Call a plugin's `setup function'
(lambda setup! [pkg ...] (local output [ ])
(lambda setup! [pkg ...]
(local output [ ])
(var last_key nil)
(each [_ val (ipairs [...])]
(if last_key
@ -116,16 +117,10 @@
`(let [save# (vim.fn.winsaveview)]
,(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!
: hook!
: use!
: setup!
: module-call!
: module-fn!
: save-excursion!
: keys!}
: save-excursion!}

View File

@ -85,6 +85,7 @@
:TroubleToggle
:TroubleClose
:TroubleRefresh ]
:module :trouble
:config
(setup! :trouble))
@ -176,9 +177,9 @@
; oil (file manager)
(use! :stevearc/oil.nvim
:config
:confi
(setup! :oil
:columns { :icon :permissions :size: :mtime }))
:columns [ :icon :permissions :size: :mtime ]))
;; guess style from buffer
(use! :NMAC427/guess-indent.nvim
@ -211,7 +212,7 @@
; :config
; (setup! :formatter
; :logging true
; :log_level _G.vim.log.levels.WARN
; :log_level _G.vim.log.levels.WA;RN
; :filetype {
; :c [ (module-fn! :formatter.filetypes.c :astyle) ]
; :cpp [ (module-fn! :formatter.filetypes.cpp :astyle) ]

View File

@ -44,10 +44,21 @@
(bind! :n :gd "<cmd>Telescope lsp_definitions<cr>" buf)
(bind! :n :gI "<cmd>Telescope lsp_implementations<cr>" buf)
(bind! :n :D "<cmd>Telescope lsp_type_definitions<cr>" buf)
(bind! :n :<leader>fq "<cmd>Telescope diagnostics<cr>" buf)
;; Some trouble commands
(bind! :n :<leader>q "<cmd>TroubleToggle document_diagnostics<cr>")
(bind! :n :<leader>Q "<cmd>TroubleToggle workspace_diagnostics<cr>"))
(bind! :n :<leader>q (fn []
(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]
(let [resolved_path (vim.fn.resolve root)