There is some text in my buffer
[{(lorem) ipsum <cursor here>
How can I insert closing brace }, then type something, and then insert ] matching with opening braces { and [
Let me explain why I need this.
For example I have to type some pure javascript code (because the coffee machine is out of order at the moment)
$(document).ready(function(){
var classA = (function(){
function classA(){}
<100 lines of code here>
return classA;
-->oh, which closing brace should I insert here....!
Another case
[theWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", HostName, @"some/path/here"]] -> huh, what next? How many closing braces am I missing?
And why I clarify MANUALLY in the question title. Because there are some key bindings to automatically insert closing braces. For example in ( ()<Left>. However, I want to insert closing brace only when I need.
I know there is i_<C-x>_<C-o> to insert closing xml tag. But I don't know how to deal with these ones.
Thank you in advance.