Closed daliusd closed 5 years ago
Assuming this comparison is pretty quick, it's probably good to have regardless.
However, if the concern is the cursor position, we could add some additional logic to try and return to the last cursor position if possible:
Option 1:
Option 2:
import
or from
.Neither of these account for pushing imports from deeper in the code up to the top though.
Honestly, I have found out that ale (https://github.com/w0rp/ale) has isort fixer and does everything what I need. Meanwhile this project actually looks dead.
Thanks for the work on this! and really sorry for the time this has been dead, personal things getting in the way of me contributing too much to OSS. Getting back to it :)
I want to use isort on each save/write to file therefore I use following configuration:
:autocmd BufWritePre *.py :Isort
This has one problem however. Even if nothing is changed my cursor jumps back to the beginning of file. This is not ideal fix but it is better than nothing. I think ideal fix would save and restore cursor position.