Clean up names and make spellcheck default for text bufs

This commit is contained in:
2022-12-02 19:22:59 -08:00
parent 77e6a35fa1
commit ea3ef70214
4 changed files with 34 additions and 29 deletions
+9 -4
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)