From ef4d8da354c539dfd6a40e4c2ba08cec5e753d8b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 30 Jul 2024 09:57:59 -0300 Subject: Feat: buffer cleansing --- vim.dot.link/plugin/key_mappings.vim | 9 +++++---- vim.dot.link/plugin/lib.vim | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/vim.dot.link/plugin/key_mappings.vim b/vim.dot.link/plugin/key_mappings.vim index ceb1a51..03a3b51 100644 --- a/vim.dot.link/plugin/key_mappings.vim +++ b/vim.dot.link/plugin/key_mappings.vim @@ -237,6 +237,11 @@ vmap s (simple-todo-mark-switch) "nnoremap c :call ToggleCheckbox() " }}} +"" Leader behavior {{{ +" Cleanup the buffer {{{ +noremap c :call BufferCleansing() +" }}} + " Insert the current date in ISO format {{{ " " Thanks https://vimtricks.com/p/insert-the-current-date-or-time/ @@ -245,8 +250,4 @@ nnoremap d i=strftime('%Y-%m-%d') inoremap d =strftime('%Y-%m-%d') map e :put =strftime('## %Y-%m-%d') " }}} - -" Remove trailing whitespaces {{{ -noremap w :call TrimWhitespace() " }}} -" diff --git a/vim.dot.link/plugin/lib.vim b/vim.dot.link/plugin/lib.vim index f1b2a30..1c3212e 100644 --- a/vim.dot.link/plugin/lib.vim +++ b/vim.dot.link/plugin/lib.vim @@ -32,3 +32,14 @@ endfun command! TrimWhitespace call TrimWhitespace() " }}} + +" Cleanup the buffer {{{ +" +" Implement miscelaneous buffer cleansing procedures +function BufferCleansing() + " Trim white spaces + call TrimWhitespace() +endfunction + +command! BufferCleansing call BufferCleansing() +" }}} -- cgit v1.2.3