diff --git a/fnl/plugin/jdtls.fnl b/fnl/plugin/jdtls.fnl index 52b3d49..2fb3de5 100644 --- a/fnl/plugin/jdtls.fnl +++ b/fnl/plugin/jdtls.fnl @@ -9,12 +9,12 @@ lsp_cap (module-call! :cmp_nvim_lsp :default_capabilities)] (module-call! :jdtls :start_or_attach { :capabilities lsp_cap - :on_attach (module-fn! :plugin.lsp :on_attach) + :on_attach (module-fn! :plugin.lsp :on-attach) :root_dir root_dir :cmd [ "jdtls" "-data" (module-call! :plugin.lsp - :get_data_dir + :get-data-dir :jdtls root_dir) ]})))) {: configure} diff --git a/fnl/plugin/lsp.fnl b/fnl/plugin/lsp.fnl index 1ca1951..ca50ad1 100644 --- a/fnl/plugin/lsp.fnl +++ b/fnl/plugin/lsp.fnl @@ -2,7 +2,7 @@ (import-macros {: bind!} :macros) -(fn on_attach [_ buf] +(fn on-attach [_ buf] (bind! :n :gD vim.lsp.buf.declaration buf) (bind! :n :gd vim.lsp.buf.definition buf) (bind! :n :K vim.lsp.buf.hover buf) @@ -28,7 +28,7 @@ (bind! :n :fd fzf.lsp_document_symbols buf) (bind! :n :cn fzf.lsp_code_actions buf))) -(fn get_data_dir [server root] +(fn get-data-dir [server root] (let [resolved_path (vim.fn.resolve root) joined_path (vim.fn.substitute resolved_path "\\/" "@" :g)] (.. (vim.fn.fnamemodify (.. "~/.local/nvim/lsp-cache/" @@ -42,7 +42,7 @@ lsp_cap ((. (require :cmp_nvim_lsp) :default_capabilities)) lsp_utils (require :plugin.lsp)] (macro setup_server! [name ...] - (let [opts { :on_attach `lsp_utils.on_attach + (let [opts { :on-attach `lsp_utils.on_attach :capabilities `lsp_cap }] (var last_key nil) (each [_ val (ipairs [...])] @@ -84,4 +84,4 @@ (if configs.fennel_language_server.setup (setup_server! :fennel_language_server)))) -{ : configure : on_attach : get_data_dir } +{ : configure : on-attach : get-data-dir } diff --git a/init.fnl b/init.fnl index 8206c1d..f325d8f 100644 --- a/init.fnl +++ b/init.fnl @@ -58,15 +58,15 @@ (set vim.g.loaded_netrwPlugin 1) ;; Remove trailing whitespace -(fn remove_trailing_whitespace [] +(fn remove-trailing-whitespace [] "Remove trailing whitespace from the whole file." (let [res (pcall vim.cmd "%s/ \\+$//gc")] (vim.cmd.nohlsearch) (when (not res) (print "File is clean")))) (vim.api.nvim_create_user_command :RemoveTrailingWhitespace - remove_trailing_whitespace {}) -(bind! :n :ws remove_trailing_whitespace) + remove-trailing-whitespace {}) +(bind! :n :ws remove-trailing-whitespace) ;; Spell keybindings (bind! :n :l (fn [] @@ -76,7 +76,7 @@ "Enabled Spellcheck" "Disabled Spellcheck"))))) -(fn jump_or_open_terminal [] +(fn jump-or-open-terminal [] "If no terminal buffer exists, create one. Otherwise, open new one." (var term_count 0) (var last_id 0) @@ -96,7 +96,7 @@ (fn [choice] (when choice (vim.cmd.buffer choice)))))) -(bind! :n :t jump_or_open_terminal) +(bind! :n :t jump-or-open-terminal) ;; Some keybindings for diagnostics (bind! :n :e vim.diagnostic.open_float)