Skip to content

Instantly share code, notes, and snippets.

@stayradiated
Created November 6, 2019 11:02
Show Gist options
  • Save stayradiated/4d648963ace52eb8f894364f6fa233b9 to your computer and use it in GitHub Desktop.
Save stayradiated/4d648963ace52eb8f894364f6fa233b9 to your computer and use it in GitHub Desktop.
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>
@stayradiated
Copy link
Author

@peterheesterman this is for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment