-
-
Save Jont828/c39726659b96e81d03451157c2885217 to your computer and use it in GitHub Desktop.
[vim] skip over closing parenthesis with tab button
This file contains hidden or 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.