You are not logged in.

#1 2015-10-15 00:50:28

nbd
Member
Registered: 2014-08-04
Posts: 389

[SOLVED] 'syntax on' in Vim causes cursor line moving on file write

I observe strange behaviour in Vim: the command

:syntax on

causes that on every executing the ":write" command, the cursor line is get centered on the screen just like with ":zz" command. The command

:syntax off 

executed after that, doesn't remove the glitch. What can cause such behaviour? Maybe some "FileWrite*" autocommand? How one can trace what additional mappings and hooks are performed on executing a command?

Last edited by nbd (2015-10-15 01:35:49)


bing different

Offline

#2 2015-10-15 00:52:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] 'syntax on' in Vim causes cursor line moving on file write

Please paste your .vimrc


Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-10-15 01:33:52

nbd
Member
Registered: 2014-08-04
Posts: 389

Re: [SOLVED] 'syntax on' in Vim causes cursor line moving on file write

Well, after narrowing down the problem, the cause really turned out to be an autocommand in .vim/ftdetect/filetype.vim: "au bufwritepre,filewritepre" which writes the "last edited" date to a file on write.


bing different

Offline

Board footer

Powered by FluxBB