Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Jont828/c39726659b96e81d03451157c2885217 to your computer and use it in GitHub Desktop.
Save Jont828/c39726659b96e81d03451157c2885217 to your computer and use it in GitHub Desktop.
[vim] skip over closing parenthesis with tab button
inoremap <expr> <Tab> SkipClosingParentheses()
function! SkipClosingParentheses()
let line = getline('.')
let current_char = line[col('.')-1]
"Ignore EOL
if col('.') == col('$')
return "\t"
end
return stridx(']})', current_char)==-1 ? "\t" : "\<Right>"
endfunction
@Jont828
Copy link
Author

Jont828 commented May 21, 2017

This is exactly what I've been looking for! By the way, I added " to the stridx(']})"' part so tab would escape double quotes as well.

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