Linux - GeneralThis forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If I manually an indenting with the TAB key a few times and then hit CTRL-S, there are no problems.
But, I use C-indention (set cindent), so when I am writing code and I hit ENTER on certain lines, Vim will automatically indent me several tabs appropriately. When I have been indented automatically by Vim, and then I press CTRL-S, it will save but then Vim unindents my cursor.
I want to find a way to keep my cursor indented I hit save (after I have been auto-indented by Vim).
Last edited by sadarax; 01-16-2008 at 09:43 PM..
Reason: Solved
Ctrl-s is usually bound in most terminals to xoff, which means it stop outputs in the terminal (actually comes from modems and serial line terminals - data off). Ctrl-q is bound to xon and restarts output. Useful if you have a lot of output scrolling by - you use ctrl-s to freeze output so it can be read.
To be able to bind ctrl-s to a command in vim I would have thought you would have to be able to turn off this behaviour, unless you are using a terminal that doesn't support xon/xoff. Most do but I'm not sure about konsole or gnome terminal. I know rxvt, mrxvt, xterm do.
Ctrl-s is usually bound in most terminals to xoff, which means it stop outputs in the terminal (actually comes from modems and serial line terminals - data off). Ctrl-q is bound to xon and restarts output. Useful if you have a lot of output scrolling by - you use ctrl-s to freeze output so it can be read.
To be able to bind ctrl-s to a command in vim I would have thought you would have to be able to turn off this behaviour, unless you are using a terminal that doesn't support xon/xoff. Most do but I'm not sure about konsole or gnome terminal. I know rxvt, mrxvt, xterm do.
That is interesting because I have never encountered that before. I normally use the /dev/ttys or Konsole. I did nothing special. I just bound the key and it seemed to work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.