151
rated 0 times
[
155]
[
4]
/ answers: 1 / hits: 27931
/ 16 Years ago, fri, march 6, 2009, 12:00:00
I can't seem to get inline Javascript indenting properly in Vim. Consider the following:
$(document).ready(function() {
// Closing brace correctly indented
$(input).focus(function() {
$(this).closest(li).addClass(cur-focus);
}); // <-- I had to manually unindent this
// Closing brace incorrectly indented
$(input).blur(function() {
$(this).closest(li).removeClass(cur-focus);
}); // <-- This is what it does by default. Argh!
});
Vim seems to insist on automatically indenting the closing brace shown in the second case there. It does the same if I re-indent the whole file. How do I get it to automatically indent using the more standard JS indenting style seen in the first case?
More From » vim