summaryrefslogtreecommitdiff
path: root/dot_config/nvim/fnl/plugins/lsp
diff options
context:
space:
mode:
authorChloƩ Vulquin <code@toast.bunkerlabs.net>2024-07-24 22:10:02 +0200
committerChloƩ Vulquin <code@toast.bunkerlabs.net>2024-07-24 22:10:02 +0200
commit991091228f9e403015edd0106ccfc3a0ce62e304 (patch)
tree44aa6357e395766f1a340fee08aea546ae69c16c /dot_config/nvim/fnl/plugins/lsp
parentnvim: add empty? and update group (diff)
nvim: continue fennel porting
Yeah I'm lazy but these are my dotfiles. A quick summary: * plugins.lsp.attach is now ported * toast.core is reorganized * new nil? and number? checks * new assoc function * new toast.table.unpack function (cross lua compat) * toast.macros.tbl now uses assoc instead of from-pairs and group * apparently I had forgotten to add {pre,post,init}.fnl before, so that's done now Still todo: ftplugin, colors.
Diffstat (limited to '')
-rw-r--r--dot_config/nvim/fnl/plugins/lsp/attach.fnl31
1 files changed, 31 insertions, 0 deletions
diff --git a/dot_config/nvim/fnl/plugins/lsp/attach.fnl b/dot_config/nvim/fnl/plugins/lsp/attach.fnl
new file mode 100644
index 0000000..1f23015
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/lsp/attach.fnl
@@ -0,0 +1,31 @@
+(import-macros {: tbl : recc} :toast.macros)
+(local {: assoc : map} (require :toast.core))
+(local {: insert} (require :toast.table))
+
+(fn [c b]
+ (let [lsp vim.lsp
+ lbf lsp.buf
+ ll [(tbl "" & :group :+lsp)
+ (tbl :w & :group :+workspace)
+
+ (tbl :D lbf.declaration & :desc "goto declaration")
+ (tbl :d lbf.definition & :desc "goto definition")
+ (tbl :k lbf.hover & :desc "hover")
+ (tbl :K lbf.signature_help & :desc "signature help")
+ (tbl :i lbf.implementation & :desc "goto implementation")
+ (tbl :t lbf.type_definition & :desc "goto type definition")
+ (tbl :r lbf.rename & :desc "rename")
+ (tbl :c lbf.code_action & :desc "code action")
+ (tbl :R lbf.reference & :desc "list references")
+
+ (tbl :wa lbf.add_workspace_folder & :desc "add folder")
+ (tbl :wr lbf.remove_workspace_folder & :desc "remove folder")
+ (tbl :wl #(print (vim.inspect (lbf.list_workspace_folders))) &
+ :desc "list folders")]
+ ll (map #(assoc $ 1 (.. :<localleader><localleader> (. $ 1))) ll)]
+ (vim.api.nvim_buf_set_option b :omnifunc :v:lua.vim.lsp.omnifunc)
+ (recc :which-key :add
+ (tbl (insert ll
+ (tbl :<leader>F #(vim.lsp.buf.format {:async true}) &
+ :desc "run format")) &
+ :buffer b))))