View previous topic :: View next topic |
Author |
Message |
TheHaas n00b
Joined: 13 Jun 2002 Posts: 61
|
Posted: Wed Jul 03, 2002 6:02 pm Post subject: commenting out large masks in package.mask with vim |
|
|
To comment out large blocks of masks in the package.mask file:
1.) make sure you have Vim 6.1 emerged in.
2.) As root:
Code: |
mkdir ~/.vim
mkdir ~/.vim/plugin
|
3.) Download EnchanceCommentify.vim from this link:
http://vim.sourceforge.net/scripts/download.php?src_id=879
and save it to ~root/.vim/plugin
Now, every time you want to edit package.mask:
1.) Add the following to the top of the file:
than type:
This will fool vim into thinking that package.mask is a shell script.
(if you don't like the syntax coloring, you can do ":syn off" to turn it off).
2.) on a line, hit "\c", which will toggle the line into a comment or uncomment.
To do a group of lines, hit "v", move the cursor to highlight the lines, than do a "\c", which will toggle all the lines (ie, if it was a comment, now it's not. If it was active, now it's a comment). Obviously, care should be used when doing groups of lines.
This probably sounds more complicated than it is. Just try it and find out! |
|
Back to top |
|
|
Scandium Retired Dev
Joined: 22 Apr 2002 Posts: 340 Location: Germany
|
Posted: Thu Jul 04, 2002 9:40 am Post subject: |
|
|
Although I am not using vim (although I have emerged it ^_^) this sounds cool |
|
Back to top |
|
|
hilker n00b
Joined: 26 Jun 2002 Posts: 3
|
Posted: Fri Jul 05, 2002 5:42 pm Post subject: Another way in vim: |
|
|
Move the cursor to the first line you want you comment out, using hjkl keys, the mouse, searching with / or ?, whatever.
Mark that line:
Move the cursor to the last line you want to comment out. Mark that line:
Use the :substitute command on that range:
If you prefer, you can use any letters you wish, case-sensitive, in place of a and b when marking lines.
I'm not a vim wizard by any stretch; I won't be surprised if someone with more skills than me suggests a simpler method. |
|
Back to top |
|
|
TheHaas n00b
Joined: 13 Jun 2002 Posts: 61
|
Posted: Sat Jul 06, 2002 4:16 am Post subject: |
|
|
that's even better.
thanks |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|