From 991091228f9e403015edd0106ccfc3a0ce62e304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Vulquin?= Date: Wed, 24 Jul 2024 22:10:02 +0200 Subject: 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. --- dot_config/nvim/fnl/plugins/lsp/attach.fnl | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 dot_config/nvim/fnl/plugins/lsp/attach.fnl (limited to 'dot_config/nvim/fnl/plugins/lsp/attach.fnl') 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 (.. : (. $ 1))) ll)] + (vim.api.nvim_buf_set_option b :omnifunc :v:lua.vim.lsp.omnifunc) + (recc :which-key :add + (tbl (insert ll + (tbl :F #(vim.lsp.buf.format {:async true}) & + :desc "run format")) & + :buffer b)))) -- cgit v1.2.3