Archived
A bunch of changes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
;;; init.fnl - primary init file
|
||||
|
||||
(import-macros {: bind! : module-call! : hook!} :macros)
|
||||
(import-macros {: bind! : module-call! : hook!
|
||||
: save-excursion! } :macros)
|
||||
|
||||
;; Make space leader
|
||||
(set vim.g.mapleader " ")
|
||||
@@ -61,8 +62,9 @@
|
||||
;; Remove trailing whitespace
|
||||
(fn remove-trailing-whitespace []
|
||||
"Remove trailing whitespace from the whole file."
|
||||
(pcall vim.cmd "%s/ \\+$//")
|
||||
(vim.cmd.nohlsearch))
|
||||
(save-excursion!
|
||||
(vim.api.nvim_exec "keepjumps keeppatterns silent! %s/ \\+$//" false)
|
||||
(vim.api.nvim_exec "keepjumps keeppatterns silent! 0;/^\\%(\\n*.\\)\\@!/,$d_" false)))
|
||||
(vim.api.nvim_create_user_command :RemoveTrailingWhitespace
|
||||
remove-trailing-whitespace {})
|
||||
(hook! [ :BufWritePre ] "*" remove-trailing-whitespace)
|
||||
|
||||
Reference in New Issue
Block a user