Monday, May 2, 2005, 7:48:52 AM, you wrote:
p> I'm using Vim6.3. I had look through quite a number of FAQs and have not
p> found the answer to the following question, please help
p> How do I
p> 1. filter out lines in a file that does not match a certain regex? No
p> change is made to the file, I only want to look at content that matches
p> the regex
How about "global" command? I think it is what you want.
p> 2. How can I beautify code automatically(like EMACs)? I believe every
p> language would requires some kind of rule set for this. Beautify
p> includes: indentation, code alignment, comment alignment, trailing space
p> removal, etc.
For automatic indentation there is
'smartindent','autoindent','cindent' options try them.
And yet there is "=" normal command, hence try "gg=G" this will
reindent the hole file.
p> 3. How can I insert a comment block? For example, EMACs's VHDL mode can
p> into the code with a couple keystroke. So it's quite easy to create this
p> -- comment here
p> It will also take indentation into account, so the lines always extend
p> from the indentation to end of line.
try the folowing mapping:
:noremap t :execute "normal ".(&columns-virtcol('$'))."A*"<cr>
p> 4. This one might be a little bit fishy. At my company people have
p> different tab/space preferences(including use of softab)... and some of
p> them ended up editing the same python script(the horror!). Is there a
p> way to fix the tab issue inside a file? I always want to pull my hair
p> out when a block of code is has 4 spaces while another block use tabs.
try to use modeline feature:
At the end or the beginning of the file type:
for more information
p> 5. What's the keyboard shortcut to copy and paste from different vim
p> session? By copy and paste I mean the copy and paste button in Gvim's
p> window. I don't want to open multiple files in the same session.
Try the way you do it in a normal aplication(I mean you Windows or
Xwindow application) with mouse it might work.
p> That's all for now