Created
November 6, 2019 11:02
-
-
Save stayradiated/4d648963ace52eb8f894364f6fa233b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Dab() | |
let [line_start, column_start] = getpos("'<")[1:2] | |
let [line_end, column_end] = getpos("'>")[1:2] | |
if line_end - line_start > 0 | |
" collapse | |
normal va{J | |
else | |
" expand | |
normal va{ | |
s/[{,]/\0 | |
normal ==jw | |
endif | |
endfunction | |
nnoremap t :<C-u>call Dab()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@peterheesterman this is for you!