From eb60df190398c5145dcc8bb8e792147a485e3f32 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Tue, 7 Mar 2023 09:50:29 +0100 Subject: [PATCH] Add simple formatting tools --- vimrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/vimrc b/vimrc index 17dccc6..6388d35 100644 --- a/vimrc +++ b/vimrc @@ -261,6 +261,22 @@ augroup vimrc autocmd! BufNewFile,BufRead crontab.* setl nobackup | setl nowritebackup " Fix for crontab -e augroup END +" Formatting +function! FormatJSON() + execute ":'<,'>! jq" +endfunction +map fj :call FormatJSON() + +function! FormatColumnize() + execute "'<,'>! column -t" +endfunction +map fc :call FormatColumnize() + +function! FormatSort() + execute "'<,'>! sort" +endfunction +map fs :call FormatSort() + " Go tools path let g:go_bin_path = expand('$HOME') . "/.local/libexec/go/bin"