Recently I find the RangeJsBeautify() function and it's really handy. However, I think it may even be nicer if we can bind an operator on it. Basically what I want is to map "=" to the ranged beautifier instead of (broken) js indenter:
When press == current line is formatted, just like calling RangeJsBeautify when selecting current line.
When press =2j current line with next 2 lines will be formatted.
When visual select some text and press =, the part will be formatted.
Currently 3 needs just a key binding. 1 and 2 are a little tricky. I'm trying to use operatorfunc and g@ in my vimrc but haven't got it to work since I'm not very familiar with vimscript. Is it possible to add an option like g:js_beautify_omap_key so that I can just add
let g:js_beautify_omap_key = '='
to my vimrc? Or offering a variation of RangeJsBeautify() which is compatible with operatorfunc is equally good.
Hi,
Recently I find the RangeJsBeautify() function and it's really handy. However, I think it may even be nicer if we can bind an operator on it. Basically what I want is to map "=" to the ranged beautifier instead of (broken) js indenter:
Currently 3 needs just a key binding. 1 and 2 are a little tricky. I'm trying to use operatorfunc and g@ in my vimrc but haven't got it to work since I'm not very familiar with vimscript. Is it possible to add an option like g:js_beautify_omap_key so that I can just add
let g:js_beautify_omap_key = '='
to my vimrc? Or offering a variation of RangeJsBeautify() which is compatible with operatorfunc is equally good.