voku / dotfiles

:bookmark_tabs: .dotfiles for Bash (Linux) / ZSH (Linux) / Git Bash (Windows) / Cygwin (Windows) / Bash on Ubuntu on Windows
MIT License
214 stars 49 forks source link

git commit: Vi's cursor often somewhere inbetween #22

Closed DrVanScott closed 8 years ago

DrVanScott commented 8 years ago

Since i merged your recent modifications i often observe that the cursor is not placed on first row/column in commit message editor (vi). Did you notice this too? (Maybe an cygwin issue?)

voku commented 8 years ago

Maybe it's only a feature? (Return to last edit position when opening files) https://github.com/voku/dotfiles/blob/master/.vimrc#L589

DrVanScott commented 8 years ago

Yes, you are right. Would it be possible to define some exceptions for this feature? E.g. it does not make sense for ".git/COMMIT_EDITMSG".

BTW i realized another problem: if i open any ".git/COMMIT_EDITMSG" there is no cursor visible at first. After i press a key it appears... This problem is solved if disable "lazyredraw" in .vimrc

voku commented 8 years ago

fixed -> https://github.com/voku/dotfiles/commit/763c510f411cfaf5c710374cd0a769f338d9411e#diff-4e12c6a37ff2cbb2c93d1b33324a6051R174

info: http://vim.1045645.n5.nabble.com/autocmd-pattern-exclusion-td5712330.html

DrVanScott commented 8 years ago

thanks for the autocmd fix!

you also changed the lazyredraw behaviour, but only for windows systems? I am quite sure that i also have it on linux systems. Unfortunately i am not able to recheck before Sunday.

Or did you change anything else which made this windows only?

voku commented 8 years ago

"lazyredraw" is recommended by some users e.g. http://stackoverflow.com/a/378967/1155858 ... but I will also test it! :)

DrVanScott commented 8 years ago

i also often notice that the bottom status line (mode, file name, EOL, cursor position etc.) is only visible after first key press. This is also fixed by (not lazyredraw)...

DrVanScott commented 8 years ago

I can reproduce it on linux. I opened an empty file many times and got the following impression:

95%: cursor not blinking (starts to blink after first key press) 10%: bottom status line not showing (appears after first keypress)

Without "lazyredaw" i never got any of these problems.

Maybe it's a timing problem?