]> gitweb.fluxo.info Git - rhatto/dotfiles/vim.git/commitdiff
Feat: buffer cleansing
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 30 Jul 2024 12:57:59 +0000 (09:57 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 30 Jul 2024 12:57:59 +0000 (09:57 -0300)
vim.dot.link/plugin/key_mappings.vim
vim.dot.link/plugin/lib.vim

index ceb1a51720ccd2bd441fa8550836eaae2adeaee8..03a3b51aa5e241bbd57e4a6f097ca6853daa2d39 100644 (file)
@@ -237,6 +237,11 @@ vmap <Leader>s <Plug>(simple-todo-mark-switch)
 "nnoremap <Leader>c :call ToggleCheckbox()<CR>
 " }}}
 
+"" Leader behavior {{{
+" Cleanup the buffer {{{
+noremap <leader>c :call BufferCleansing()<CR>
+" }}}
+
 " Insert the current date in ISO format {{{
 "
 " Thanks https://vimtricks.com/p/insert-the-current-date-or-time/
@@ -245,8 +250,4 @@ nnoremap <leader>d i<C-R>=strftime('%Y-%m-%d')<CR>
 inoremap <leader>d <C-R>=strftime('%Y-%m-%d')<CR>
 map <leader>e :put =strftime('## %Y-%m-%d')<CR>
 " }}}
-
-" Remove trailing whitespaces {{{
-noremap <leader>w :call TrimWhitespace()<CR>
 " }}}
-"
index f1b2a3083eac4500df5b81eb5669b968297f8462..1c3212e2b378fa093c9043f3136f0b36a8978a2f 100644 (file)
@@ -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()
+" }}}