Clean up fennel function names
This commit is contained in:
parent
043d485629
commit
77e6a35fa1
@ -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}
|
||||
|
@ -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 :<leader>fd fzf.lsp_document_symbols buf)
|
||||
(bind! :n :<leader>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 }
|
||||
|
10
init.fnl
10
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 :<leader>ws remove_trailing_whitespace)
|
||||
remove-trailing-whitespace {})
|
||||
(bind! :n :<leader>ws remove-trailing-whitespace)
|
||||
|
||||
;; Spell keybindings
|
||||
(bind! :n :<leader>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 :<leader>t jump_or_open_terminal)
|
||||
(bind! :n :<leader>t jump-or-open-terminal)
|
||||
|
||||
;; Some keybindings for diagnostics
|
||||
(bind! :n :<leader>e vim.diagnostic.open_float)
|
||||
|
Reference in New Issue
Block a user