this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ft: add Lexical as LS for Elixir

+55 -32
+53 -29
vim/.config/nvim/fnl/langclient.fnl
··· 1 1 (import-macros {: use} :relude) 2 2 3 - (use nvim {: cmd : opt :buf-map bmap}) 3 + (use nvim {: fun : cmd : opt :buf-map bmap}) 4 4 (use picker) 5 5 (use lspconfig) 6 + (use lspconfig.configs) 6 7 (import-macros logger :nvim.logger) 7 8 (import-macros {: augroup} :nvim) 8 9 ··· 11 12 (tset (require :lspconfig.ui.windows) :default_options {:border border}) 12 13 (set lsp.handlers.textDocument/hover (lsp.with lsp.handlers.hover {:border border})) 13 14 (set lsp.handlers.textDocument/signatureHelp (lsp.with lsp.handlers.signature_help {:border border})) 14 - (vim.diagnostic.config {:float {:border border} :virtual_text false}) 15 - ) 15 + (vim.diagnostic.config {:float {:border border} :virtual_text false})) 16 16 17 - (fn on_attach [client] 18 - (cmd.packadd! :fidget.nvim) 19 - ((. (require :fidget) :setup) {}) 20 - (logger.inspect client) 21 - (local capable? 22 - (fn [capability] 23 - (. client.server_capabilities capability))) 24 - (augroup lsp-diagnostics 25 - (on CursorHold "*" (vim.diagnostic.open_float {:focus false})) 26 - (on BufEnter,CursorHold,InsertLeave "*" (vim.lsp.codelens.refresh))) 27 - (when (capable? :hoverProvider) 28 - (bmap :n :K #(vim.lsp.buf.hover))) 29 - (when (capable? :declarationProvider) 30 - (bmap :n :gD #(vim.lsp.buf.declaration))) 31 - (when (capable? :referencesProvider) 32 - (bmap :n :gr #(picker.lsp_references))) 33 - (when (capable? :documentFormattingProvider) 34 - (bmap :n :Q #(vim.lsp.buf.format))) 35 - (when (capable? :documentSymbolProvider) 36 - (bmap :n :gO #(picker.lsp_document_symbols)))) 17 + ; workaround for Lexical to not spit out the snippets params 18 + (let [old vim.lsp.util.parse_snippet] 19 + (set vim.lsp.util.parse_snippet (fn [input] 20 + (let [result (fun.match input "[^[:keyword:]]")] 21 + (print result) 22 + (input:sub 1 result))))) 23 + 24 + (augroup hauleth-lsp 25 + (on LspAttach "*" 26 + (let [bufnr args.buf 27 + client (vim.lsp.get_client_by_id args.data.client_id)] 28 + (cmd.packadd! :fidget.nvim) 29 + ((. (require :fidget) :setup) {}) 30 + (logger.inspect client) 31 + (local capable? 32 + (fn [capability] 33 + (. client.server_capabilities capability))) 34 + (augroup lsp-diagnostics 35 + (on CursorHold "*" (vim.diagnostic.open_float {:focus false})) 36 + (on BufEnter,CursorHold,InsertLeave "*" (vim.lsp.codelens.refresh))) 37 + (when (capable? :hoverProvider) 38 + (bmap :n :K #(vim.lsp.buf.hover))) 39 + (when (capable? :declarationProvider) 40 + (bmap :n :gD #(vim.lsp.buf.declaration))) 41 + (when (capable? :referencesProvider) 42 + (bmap :n :gr #(picker.lsp_references))) 43 + (when (capable? :documentFormattingProvider) 44 + (bmap :n :Q #(vim.lsp.buf.format))) 45 + (when (capable? :documentSymbolProvider) 46 + (bmap :n :gO #(picker.lsp_document_symbols)))))) 47 + 48 + 49 + 50 + (set configs.lexical { 51 + :default_config { 52 + :autostart false 53 + :filetypes ["elixir" "eelixir" "heex"] 54 + :root_dir (fn [fname] 55 + (let [project ((lspconfig.util.root_pattern ".git") fname)] 56 + project))} 57 + }) 37 58 38 59 (set lspconfig.util.default_config 39 60 (vim.tbl_extend :force lspconfig.util.default_config 40 - {:autostart false : on_attach})) 61 + {:autostart false})) 62 + 41 63 42 64 (vim.diagnostic.config {:virtual_text false}) 43 65 ··· 47 69 (setup :rust_analyzer 48 70 {:settings {:rust-analyzer {:files {:excludeDirs [".direnv"]}}}}) 49 71 50 - (setup :elixirls 51 - {:cmd [:elixir-ls] 52 - :settings {:elixirLS {:dialyzerEnabled false}}}) 72 + ; (setup :elixirls 73 + ; {:cmd [:elixir-ls] 74 + ; :settings {:elixirLS {:dialyzerEnabled false}}}) 75 + (setup :lexical 76 + {:cmd [:lexical :start]}) 53 77 54 78 (setup :erlangls 55 79 {:cmd [:erlang_ls]}) 56 80 57 - (setup :rnix 58 - {:autostart true}) 81 + ; (setup :rnix 82 + ; {:autostart true}) 59 83 60 84 (augroup lsp-direnv (on User :DirenvLoaded (cmd.LspStart)))
+2 -3
vim/.config/nvim/fnl/nvim/macro-init.fnl
··· 2 2 3 3 (fn on [event pattern ...] 4 4 "Run command on `event`" 5 - (let [body (if (list? ...) 6 - `(fn [] ,...) 7 - ...)] 5 + (let [args (sym :args) 6 + body `(fn [,args] ,...)] 8 7 `(vim.api.nvim_create_autocmd ,(view event) 9 8 {:pattern ,pattern 10 9 :callback ,body