t9md/vim-textmanip

Auto-Indent

orbisvicis opened this issue · 3 comments

I'd like an option to re-indent code automatically during movement. I think this only makes sense in non-block (entire line) non-replace (move) mode. Perhaps something like:

" allow binding to force automatic re-indent
" Only available linewise, falls back to default behaviour blockwise
xmap <C-j> <Plug>(textmanip-move-down-indent)
xmap <C-k> <Plug>(textmanip-move-up-indent)

" toggle auto/manual indent for:
"    textmanip-move-down
"    textmanip-move-up
nmap <S-F10> <Plug>(textmanip-move-toggle-ident)
xmap <S-F10> <Plug>(textmanip-move-toggle-indent)

My jaw dropped when I found this plug-in. Vastly superior - should be more popular.

t9md commented

Your suggestion make sense for me, it is the feature I too considered before.
OK I recently didn't actively touching this plugin, so what I have to do is first to remember codebase of this plugin, its tough for me in this time.
Anyway, I will keep open this issue till I implement this feature one day.
Thanks,

I understand. If I had time to go through a large unfamiliar code base, this issue would instead have been a pull request.

t9md commented

Now I can support auto-indent feature you suggested, after I tried auto-indent, I'm not sure its really helpful feature.
So I chose to provide as experimental hook.

See Experimental hook/helper if you are interested.