vimrc: add keybind for formatting JSON with jq
This commit is contained in:
parent
2662865051
commit
b08fb429e5
@ -874,6 +874,15 @@ nmap <silent> <leader>tl :TestLast<CR>
|
||||
nmap <silent> <leader>g :TestVisit<CR>
|
||||
|
||||
|
||||
""" formatingt with jq as per https://davidisaksson.dev/posts/format-json-in-vim/
|
||||
" Whole buffer
|
||||
nnoremap <silent> <Leader>fj <Cmd>%!jq<CR>
|
||||
nnoremap <silent> <Leader>fcj <Cmd>%!jq --compact-output<CR>
|
||||
" Visual selection
|
||||
vnoremap <silent> <Leader>fj :'<,'>!jq<CR>
|
||||
vnoremap <silent> <Leader>fcj :'<,'>!jq --compact-output<CR>
|
||||
|
||||
|
||||
" partially superseded by jasonccox/vim-wayland-clipboard (for "+)
|
||||
" still keeping the "* mappings
|
||||
" it however breaks <c-r>
|
||||
|
Loading…
Reference in New Issue
Block a user