vim: mark end-of-line? trim blank lines?
I'm wondering if I can convince vim to do either of the following:
Does anyone know? Thanks for taking the time to read! |
Here is a quick reference link to vim, maybe it will be helpful.
http://www.vim.org/htmldoc/quickref.html |
I did some searching around once I realized that what I really wanted was a global replace, and I just knew that vim must have macros with bindings for different states of the application, and with much persistence I was proven correct! Check it out:
Code:
autocmd BufWritePre * :%s/\s*$// Code:
autocmd BufWritePre *.c :%s/\s*$// |
Does anyone know, off the top of their head, how to make this restore the cursor position after completion? I know vi commands to do that but I don't know that I could include them in one line, or perhaps as an addendum to that regex or something.
|
All times are GMT -5. The time now is 06:13 PM. |