Clean up names and make spellcheck default for text bufs

This commit is contained in:
Alexander Rosenberg 2022-12-02 19:22:59 -08:00
parent 77e6a35fa1
commit ea3ef70214
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
4 changed files with 34 additions and 29 deletions

View File

@ -116,12 +116,12 @@
:h [ "c" "C" "cpp" "cxx" "c++" "cc" ]
:cpp [ "hpp" "hxx" "h++" "hh" "h" "H" ]
:hpp [ "cpp" "cxx" "c++" "cc" ])
(let [find_other (require :nvim-find-other)]
(let [find-other (require :nvim-find-other)]
(vim.api.nvim_create_user_command
"FindOtherFile"
find_other.find_other_current_buffer
find-other.find_other_current_buffer
{})
(bind! :n :go find_other.find_other_current_buffer))))
(bind! :n :go find-other.find_other_current_buffer))))
(use! :RRethy/vim-illuminate
:config (fn []

View File

@ -4,17 +4,17 @@
(fn configure []
(hook! :FileType :java
#(let [root_dir (module-call! :jdtls.setup :find_root
#(let [root-dir (module-call! :jdtls.setup :find_root
[ ".git" "mvnw" "gradlew" "build.gradle" ])
lsp_cap (module-call! :cmp_nvim_lsp :default_capabilities)]
lsp-cap (module-call! :cmp_nvim_lsp :default_capabilities)]
(module-call! :jdtls :start_or_attach
{ :capabilities lsp_cap
{ :capabilities lsp-cap
:on_attach (module-fn! :plugin.lsp :on-attach)
:root_dir root_dir
:root_dir root-dir
:cmd [ "jdtls"
"-data"
(module-call! :plugin.lsp
:get-data-dir
:jdtls root_dir) ]}))))
:jdtls root-dir) ]}))))
{: configure}

View File

@ -39,24 +39,24 @@
(fn configure []
(let [lsp (require :lspconfig)
configs (require :lspconfig.configs)
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
:capabilities `lsp_cap }]
(var last_key nil)
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
:capabilities `lsp-cap }]
(var last-key nil)
(each [_ val (ipairs [...])]
(if last_key
(do (tset opts last_key val)
(set last_key nil))
(set last_key val)))
(if last-key
(do (tset opts last-key val)
(set last-key nil))
(set last-key val)))
`((. (. lsp ,name) :setup) ,opts)))
(setup_server! :ccls)
(setup_server! :cmake)
(setup_server! :gopls)
(setup_server! :rust_analyzer)
(setup_server! :texlab)
(setup_server! :sumneko_lua
(setup-server! :ccls)
(setup-server! :cmake)
(setup-server! :gopls)
(setup-server! :rust_analyzer)
(setup-server! :texlab)
(setup-server! :sumneko_lua
:settings {
:Lua {
:runtime {
@ -82,6 +82,6 @@
:globals [ "vim" ] }}}}})
; needed to make it not complain about a nil setup function
(if configs.fennel_language_server.setup
(setup_server! :fennel_language_server))))
(setup-server! :fennel_language_server))))
{ : configure : on-attach : get-data-dir }

View File

@ -1,6 +1,6 @@
;;; init.fnl - primary init file
(import-macros {: bind! : module-call!} :macros)
(import-macros {: bind! : module-call! : hook!} :macros)
;; Make space leader
(set vim.g.mapleader " ")
@ -70,12 +70,17 @@
;; Spell keybindings
(bind! :n :<leader>l (fn []
(let [new_spell (not (vim.opt_local.spell:get))]
(set vim.opt_local.spell new_spell)
(print (if new_spell
(let [new-spell (not (vim.opt_local.spell:get))]
(set vim.opt_local.spell new-spell)
(print (if new-spell
"Enabled Spellcheck"
"Disabled Spellcheck")))))
;; Enable spell in certian buffers
(hook! :FileType [ :text :markdown :tex :bib ]
#(if (= (vim.fn.buflisted (vim.api.nvim_get_current_buf)) 1)
(set vim.opt_local.spell true)))
(fn jump-or-open-terminal []
"If no terminal buffer exists, create one. Otherwise, open new one."
(var term_count 0)