Vim Tips Wiki
(more tip feedback)
(More comments - see "General comments" section)
Line 58: Line 58:
 
| [[Displaying the current Vim environment]]
 
| [[Displaying the current Vim environment]]
 
|align="center"| [[#Displaying the current Vim environment|''discuss'']]
 
|align="center"| [[#Displaying the current Vim environment|''discuss'']]
|align="center"| Probably keep
+
|align="center"| Keep
 
|-
 
|-
 
| [[Dosini folding]]
 
| [[Dosini folding]]
 
|align="center"| [[#Dosini folding|''discuss'']]
 
|align="center"| [[#Dosini folding|''discuss'']]
|align="center"| -
+
|align="center"| Dodgy; add explanation or delete
 
|-
 
|-
 
| [[Easy Buffer Switching Without a Plugin]]
 
| [[Easy Buffer Switching Without a Plugin]]
 
|align="center"| [[#Easy Buffer Switching Without a Plugin|''discuss'']]
 
|align="center"| [[#Easy Buffer Switching Without a Plugin|''discuss'']]
|align="center"| -
+
|align="center"| Keep
 
|-
 
|-
 
| [[Exchanging adjacent words]]
 
| [[Exchanging adjacent words]]
Line 78: Line 78:
 
| [[Fix errors that relate to reading or creating files in the temp or tmp environment on an MS Windows PC]]
 
| [[Fix errors that relate to reading or creating files in the temp or tmp environment on an MS Windows PC]]
 
|align="center"| [[#Fix errors that relate to reading or creating files in the temp or tmp environment on an MS Windows PC|''discuss'']]
 
|align="center"| [[#Fix errors that relate to reading or creating files in the temp or tmp environment on an MS Windows PC|''discuss'']]
|align="center"| -
+
|align="center"| Dodgy; add explanation or delete
 
|-
 
|-
 
| [[Format javadoc]]
 
| [[Format javadoc]]
Line 90: Line 90:
 
| [[Get the most out of the latest Vim Editor with Hacking Vim!]]
 
| [[Get the most out of the latest Vim Editor with Hacking Vim!]]
 
|align="center"| [[#Get the most out of the latest Vim Editor with Hacking Vim!|''discuss'']]
 
|align="center"| [[#Get the most out of the latest Vim Editor with Hacking Vim!|''discuss'']]
|align="center"| Dodgy
+
|align="center"| Move content; delete
 
|-
 
|-
 
| [[Hide dos lineends]]
 
| [[Hide dos lineends]]
Line 126: Line 126:
 
| [[Make MRU plugin open files in tabs]]
 
| [[Make MRU plugin open files in tabs]]
 
|align="center"| [[#Make MRU plugin open files in tabs|''discuss'']]
 
|align="center"| [[#Make MRU plugin open files in tabs|''discuss'']]
|align="center"| -
+
|align="center"| Delete
 
|-
 
|-
 
| [[Making CapsLock work in Vim]]
 
| [[Making CapsLock work in Vim]]
Line 220: Line 220:
   
 
==General comments (not for a specific tip)==
 
==General comments (not for a specific tip)==
  +
'''Fritzophrenic – Please consider my comments here, then delete them.'''
  +
  +
It's getting too hard to follow a conversation, and we're almost finished, so I intend putting anything I would like you to act on here.
  +
  +
*Re [[#Make MRU plugin open files in tabs|''Make MRU plugin open files in tabs - discuss'']]: Yegappan replied that he is soon releasing a version of his plugin that obsoletes the tip, so I have flagged it "Delete".
  +
  +
*I don't understand your thoughts on [[#Hide dos lineends|''Hide dos lineends - discuss'']]. Are you saying the tip should be deleted ''without'' merging the content anywhere? Or, it should be merged, but not into [[VimTip27]]? I will agree with either interpretation. If you think delete, just update the status to "Delete".
  +
  +
*Please edit the "Author" field of [[Improved Hex editing]] to your name, if you want. I think the login-timeout might have bitten you because only an IP address was listed as the creator.
  +
  +
*Please look through the above table, and look at ''discuss'' for the items with '-' for the status. See if you agree with what I've written. If you do, you could just update the status. Thanks!
  +
  +
--[[User:JohnBeckett|JohnBeckett]] 01:16, 12 January 2008 (UTC)
   
 
==[[$ instead of 4]]==
 
==[[$ instead of 4]]==

Revision as of 01:16, 12 January 2008

New tips June to December 2007

For each proposed new tip:

  • Is it worth keeping as a separate tip?
  • Should it be merged into an existing tip? Which?
  • If it should be kept, is it ready for release? Which points need fixing? Should it be renamed?

Please edit this page (not the talk page) in the appropriate section below the following table.
Alternatively, comments can be posted on the mailing list.

Proposed new tip Link Current consensus
$ instead of 4 discuss Keep
Automatic Commenting of Preprocessor Directives in C discuss Keep
Automatically Update Copyright Notice in Files discuss Keep
Automatically add ifndef ... to a C header file discuss Merge to VimTip514
Automatically create and update cscope database discuss Keep
Automatically fitting a quickfix window height discuss Keep
Changing all HTML tags to lowercase discuss Keep
Check your syntax files for configurable options discuss Keep
Create patch for currently editing file discuss Fix, then keep
Decrease chances of file corruption in case of computer crash discuss Keep
Displaying the current Vim environment discuss Keep
Dosini folding discuss Dodgy; add explanation or delete
Easy Buffer Switching Without a Plugin discuss Keep
Exchanging adjacent words discuss Fix, then keep
Fast jump to next variable on the same line (php programmers ) discuss Probably keep
Fix errors that relate to reading or creating files in the temp or tmp environment on an MS Windows PC discuss Dodgy; add explanation or delete
Format javadoc discuss Dodgy
Formatting paragraphs in LaTeX: an "environment-aware gqap" discuss Keep
Get the most out of the latest Vim Editor with Hacking Vim! discuss Move content; delete
Hide dos lineends discuss -
Icomplete discuss Delete
Improved Hex editing discuss Keep
In line copy and paste to system clipboard discuss Dodgy
Increase/decrease fontsize using a map ala FireFox discuss -
Keep your vimrc file clean discuss Keep
Key maps using the Alt modifier discuss -
Learn to do it by hand! discuss -
Make MRU plugin open files in tabs discuss Delete
Making CapsLock work in Vim discuss -
Map cut copy and paste to Windows defaults discuss -
Mapping keys in Vim - Tutorial (Part 1) discuss -
Mapping keys in Vim - Tutorial (Part 2) discuss -
Mkdir on edit if needed discuss -
Open Filename with "gf" discuss Delete
Search and replace in all buffers discuss -
Search keywords in c function discuss -
Search keywords in c++ function discuss -
Set gvim window size discuss -
Set options or named registers with let discuss -
Short help for PHP functions inside of Vim discuss -
Show parts of line that make it longer than 80 chars discuss Keep
Swap LHS and RHS of an Assignment statement discuss -
Swap file "..."already exists! - so diff it discuss -
To switch back to normal mode automatically after inaction discuss -
Use :next to search for files in the current directory discuss -
Version Control for Vimfiles discuss Keep
Vim Doclet discuss -
Vim On Vista discuss Probably delete
Word frequency statistics for a file discuss -
X11-clipboard support in terminal discuss -

Please add your comment (sign with --~~~~) below the appropriate heading. Use ---- between comments.

General comments (not for a specific tip)

Fritzophrenic – Please consider my comments here, then delete them.

It's getting too hard to follow a conversation, and we're almost finished, so I intend putting anything I would like you to act on here.

  • I don't understand your thoughts on Hide dos lineends - discuss. Are you saying the tip should be deleted without merging the content anywhere? Or, it should be merged, but not into VimTip27? I will agree with either interpretation. If you think delete, just update the status to "Delete".
  • Please edit the "Author" field of Improved Hex editing to your name, if you want. I think the login-timeout might have bitten you because only an IP address was listed as the creator.
  • Please look through the above table, and look at discuss for the items with '-' for the status. See if you agree with what I've written. If you do, you could just update the status. Thanks!

--JohnBeckett 01:16, 12 January 2008 (UTC)

$ instead of 4

Simple tip with a simple mapping. It's useful and adaptable enough to be not TOO bad, though. It does need to be fixed - the imap given will just insert some text - but other than that, I'd probably keep it.

--Fritzophrenic 15:29, 8 January 2008 (UTC)


Keep this. It's cute. Have you got enough time to fix the imap? --JohnBeckett 02:14, 9 January 2008 (UTC)


Automatic Commenting of Preprocessor Directives in C

Very clever and well-commented function - the author can be proud. It could prove very useful, and illustrates some clever things you can do with the :s command used inside a function. I'm a little worried that it may not be very adaptable to other ideas, and that the illustration of Vim concepts may be hidden by the script, but I'd keep this one. It is not overly complex, and the code is well-explained enough through comments that people may be able to glean some new ideas out of it as well as using it as-is for a useful tool.

--Fritzophrenic 15:29, 8 January 2008 (UTC)


Keep this. I have to note that I hate the kind of superfluous comments created by the tip! However, it's a big world and I know some like them, particularly on long ifdef/endif. --JohnBeckett 02:14, 9 January 2008 (UTC)

Automatically Update Copyright Notice in Files

Disclaimer: I submitted this tip.

I like this tip a lot and it has proved very useful to me. It does a good job highlighting use of the :g and :s commands, strftime function, BufWritePre autocmd event, and use of an option's value in an if statement (&modified, to be exact). Unlike other complex regular expression example tips, this tip explains in detail exactly what each part of the regex does.

However, I can see why somebody might not like it, because it is fairly complex, probably not very commonly needed, and there are already similar tips:

This tip should probably be merged into one of these, because it does do a much better job explaining the regex, and I really like the use of the :g command.

--Fritzophrenic 19:19, 7 January 2008 (UTC)


Keep this. Merge 97 and 890, but don't merge this with them (result would be too complex). Include a link "See also" (not "See Also") in each.

--JohnBeckett 02:14, 9 January 2008 (UTC)


Automatically add ifndef ... to a C header file

More explanation for the implementation needs to be given, but assuming it works, this tip could be very useful. It looks fairly simple, using mostly basic commands, so explaining it shouldn't be difficult. As noted on the tip, however, a better thing to do would probably be to merge it into VimTip514.

--Fritzophrenic 15:29, 8 January 2008 (UTC)


Let's be brutal and delete this. Add its content (which I haven't checked) to VimTip514. BTW this tip is not "automatic" - you have to press a key (a good thing IMHO). --JohnBeckett 02:14, 9 January 2008 (UTC)


Automatically create and update cscope database

Keep this. Haven't checked it, but it has history and looks good. --JohnBeckett 02:40, 9 January 2008 (UTC)


Keep, if it works. I don't use cscope so I'm probably not going to check it. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Automatically fitting a quickfix window height

Keep this. I edited the tip to put Fritzophrenics' arguments in (min,max) order. Change if you like. --JohnBeckett 02:40, 9 January 2008 (UTC)


Keep this. It works and is pretty useful, especially if you use vimgrep. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Changing all HTML tags to lowercase

This tip lists 2 complex regexes with no explanation that are simple enough to be written from scratch when needed. I think this tip is an excellent example of a useful application of the substitute command, but I don't think it teaches anything new. I remember seeing the exact same sort of thing in another tip, used as an example to illustrate a point, though I can't remember where I saw it, and it converted to uppercase rather than lowercase.

I recommend deleting this one.

--Fritzophrenic 19:19, 7 January 2008 (UTC)


I think you underestimate your regex ability. I imagine there are many Vimmers who would struggle to reproduce this tip, and since it does something that at least sounds useful, I'm inclined to keep it. I totally agree that the tip is horrible with no explanation. However, we've got plenty of mystery tips, so I would just add a todo to this, and hope that one day I could get someone from vim_use to add a brief explanation. --JohnBeckett 02:14, 9 January 2008 (UTC)


Hmm...I've taken a closer look. The first regex is (in my opinion) overly complex for what it accomplishes, but still fairly simple. This is where I stopped looking the first time - my mistake, because the second one is where things get interesting. It is complex enough that I had to try it out to convince myself that it actually works (which it does, although the description is slightly misleading). I can certainly see your point...it would probably take me some time to reproduce these, and they use some advanced concepts that many Vimmers would not think to use or even know how to use. If these concepts were brought to the foreground of the tip, I'd probably like it better.

So, here's my take:

I don't like tips that simply post a clever regex or script, with no real explanation. I especially don't like such tips when the problem solved by the regex or script is a simple one that doesn't really need a complicated solution, or if the problem is a very specific one. This particular tip is probably useful to many people, and the problem solved is much more complicated than it first appears, so after a more complete look I actually kind of like it. I can certainly see the value in keeping it, especially when the regular expressions are explained, simplified, and improved (as they will be - this is a wiki!), but this and other similar tips have the potential to become VERY widespread. I can't count the number of times I've written a complex regular expression to accomplish a complicated task. But, the true value isn't the final regex, it's knowing how to write it. So, what if we create a category to contain tips such as this one that are primarily just examples of complicated regular expressions? It would be a place to go to look for specific pre-solved problems, a place to browse a bunch of examples of advanced concepts to spark your own ideas, and a place for people like me to shuffle new tips off to so that we don't immediately cry "delete!" for a tip that many would see value in. We have a "searching" category, but I think this category is better used for very general tips about searching, perhaps with specific illustrative examples. I think that an "Advanced Regex" category or a "Regular Expressions" category would be a good place for tips like this one, that give regular expressions for a very specific purpose, probably constructed over a long period of time and tweaked again and again, intended for later reuse.

--Fritzophrenic 15:52, 9 January 2008 (UTC)


Good idea (to create a suitable category). I agree with your point that a tip with nothing but a regex is pretty useless and irritating. I added your "Advanced Regex" or "Regular Expressions" category to my local todo file and intend looking at it further. You can do it now if you like, but I was going to think a bit more about what tips would go in which of these. The "Regular Expressions" doesn't quite sound right because such a category should probably be about explaining regexs in some detail. So I favour "Advanced Regex" but was going to look for some more examples before implementing it. --JohnBeckett 03:36, 10 January 2008 (UTC)


I agree with your distinction between an "advanced regex" and a "regular expressions" category. I'm going to go ahead and implement the "advanced regex" category - there are a few tips I want to add to it already. We can sort out the details later. I also like the idea of a "regular expressions" category to include tips with more general help with regular expressions, but that is a category that warrants further discussion.

--Fritzophrenic 17:42, 10 January 2008 (UTC)


Excellent - I think it's a good result. --JohnBeckett 04:13, 11 January 2008 (UTC)


Check your syntax files for configurable options

Disclaimer: this a tip I submitted!

I wrote this tip when I learned about it from the unrelated Auto-fold Perl subs tip. Somebody wrote a complex function for doing syntax folding of Perl scripts, which (although clever) is completely unnecessary because the functionality is built-in already. It just happens to be disabled by default, and the author (and myself) did not realize that it was there, because they did not first check the syntax file for configurable options!

--Fritzophrenic 19:19, 7 January 2008 (UTC)


Keep this. --JohnBeckett 02:14, 9 January 2008 (UTC)


Create patch for currently editing file

Probably keep. --JohnBeckett 02:40, 9 January 2008 (UTC)


I'm not entirely sure what this tip is for, but I understand it enough to know it could be useful. I say, fix it up to explain what it does better, comment the script better, and improve the title, then keep it.

--Fritzophrenic 19:59, 11 January 2008 (UTC)


Decrease chances of file corruption in case of computer crash

Keep. Needs a comment about the OS, but if Yakov thinks it's ok, I would keep it (but what a hack!). --JohnBeckett 02:40, 9 January 2008 (UTC)


This sure is a clever one! Definitely keep. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Displaying the current Vim environment

Keep. This was discussed on vim_use. --JohnBeckett 02:40, 9 January 2008 (UTC)


Not sure how useful this tip is, but if it has been discussed, I won't argue. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Dosini folding

Flag to fix later (add explanation or delete). --JohnBeckett 02:40, 9 January 2008 (UTC)


Agreed. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Easy Buffer Switching Without a Plugin

Dodgy. Surely there's a better way of doing this? I've forgotten the name of what I use, but it's better than this. --JohnBeckett 02:40, 9 January 2008 (UTC)


I think keep. I just use the buffer menu in gvim for this, but if you want a keyboard-only solution this works fine. Tip needs cleanup but I think it is okay. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Exchanging adjacent words

Let's keep this. Delete most of the comments. Add "See also" to/from VimTip47. --JohnBeckett 02:40, 9 January 2008 (UTC)


Agreed, but let's put it in the "Advanced Regex" category. Now that there is a good explanation of how it works, I suppose it could go in "Regular Expressions" since the only really advanced thing in it is the %# atom (which I learned from this tip!) --Fritzophrenic 19:59, 11 January 2008 (UTC)


Fast jump to next variable on the same line (php programmers )

Probably keep. Maybe rename to "Fast jump to next PHP variable on the same line". --JohnBeckett 02:40, 9 January 2008 (UTC)


I don't like it, but I guess it's not a bad tip, so go ahead and keep it. The keys used are already mapped, as mentioned, but that can be fixed. For myself, I just use f$ the first jump, then ; and , for any subsequent jumps. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Fix errors that relate to reading or creating files in the temp or tmp environment on an MS Windows PC

Flag to fix later (add explanation or delete). --JohnBeckett 02:40, 9 January 2008 (UTC)


Agreed. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Format javadoc

This was originally not a tip, but a request for help. I know the usual policy would be to delete this, but I made a comment that almost fixes the problem brought up. If somebody can fix up my general method, it might make a good tip.

--Fritzophrenic 19:19, 7 January 2008 (UTC)


I think there's too much work required to fix this, and would be inclined to terminate it. Perhaps, with the large number of new tips we are currently trying to sort out, we need a way to flag a tip as "not yet ready to be made a full tip; may delete if it's not fixed before May 2008". Then we could apply that to this tip, move on, and satisfy us both. --JohnBeckett 02:14, 9 January 2008 (UTC)


Agreed. Flag to fix or mark dodgy. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Formatting paragraphs in LaTeX: an "environment-aware gqap"

Keep this. No idea if it is valid, but it looks good. --JohnBeckett 04:13, 10 January 2008 (UTC)


I think this tip should be fixed to use options to control what counts as a paragraph, rather than using a mapping. Fix and keep. I don't know anything about LaTeX though, so I'm not the guy for it... --Fritzophrenic 19:59, 11 January 2008 (UTC)

Get the most out of the latest Vim Editor with Hacking Vim!

Put this on a "dodgy" list. I think there is a list of Vim books somewhere (if not, we should make one). We could move some brief content from this tip to that page. After a couple of months, this tip is going to be useless and should be deleted without first being given a tip id. Hmmm, I'll even put a link to the "Vim books" page on the Main Page. --JohnBeckett 05:00, 10 January 2008 (UTC)


Agreed. It's practically an advertisement. --Fritzophrenic 19:59, 11 January 2008 (UTC)


Hide dos lineends

Merge any useful content into VimTip27. Delete. --JohnBeckett 04:13, 10 January 2008 (UTC)


I agree with the deletion, not with the merge destination. There are probably some "get rid of DOS linefeed" tips out there to merge to, but even those are suspect. See my comment in the tip. --Fritzophrenic 23:47, 11 January 2008 (UTC)


Icomplete

Delete. I was going to suggest keeping it, but the URL leads to the author's site which says that the utility is no longer supported and one of the vim.org scripts should be used. --JohnBeckett 04:13, 10 January 2008 (UTC)


Agreed.--Fritzophrenic 23:47, 11 January 2008 (UTC)


Improved Hex editing

Keep this. Haven't checked it, but it looks good and we don't have an xxd tip. --JohnBeckett 04:13, 10 January 2008 (UTC)


Agreed. I actually made this one, and can vouch that it works. Haven't found anything screwy with it so far (though I'm not guaranteeing that there isn't anything). --Fritzophrenic 23:47, 11 January 2008 (UTC)


In line copy and paste to system clipboard

Put on dodgy list? I can't bring myself to study the tip at the moment, but surely its content should be merged into one of the other attempts to subvert Vim's copy/paste? Note that VimTip1199 and VimTip1306 claim to be related to character-wise pasting. --JohnBeckett 04:13, 10 January 2008 (UTC)


I'd agree to the dodgy, but this tip concerns Mac OS X copy/paste. Apparently this user has trouble integrating with the system clipboard for that OS. I'm guessing there's an easier, option-setting way to do this, since Vim integrates so well with every other OS I know of, but I can't be sure. The tip needs some major cleanup to better explain what it is useful for (it isn't until the end of the tip that OS X is mentioned). This tip needs to be verified to see if it is necessary and working as well. --Fritzophrenic 23:47, 11 January 2008 (UTC)


Increase/decrease fontsize using a map ala FireFox

These are similar: VimTip414, VimTip760. Not sure. --JohnBeckett 04:13, 10 January 2008 (UTC)

Keep your vimrc file clean

I like this tip a lot. I didn't write it, but I could have! It gives good advice about keeping your settings for your vimrc file in places that make sense, making your changes modular, and keeping your vimrc nice and uncluttered.

Keep it!

--Fritzophrenic 19:19, 7 January 2008 (UTC)


Keep this. --JohnBeckett 02:14, 9 January 2008 (UTC)


Key maps using the Alt modifier

Keep, I suppose. --JohnBeckett 05:00, 10 January 2008 (UTC)

Learn to do it by hand!

Please make the first comment, replacing this line. --JohnBeckett 10:14, 10 January 2008 (UTC)

Make MRU plugin open files in tabs

We'll have to keep this in view of the author! But shouldn't there be a link to MRU? Also, fix typo "auther" to "author". --JohnBeckett 05:00, 10 January 2008 (UTC)


If you don't like this tip, I would not be sorry to see it go. It is something I stripped out of the comments from another tip that I was cleaning up. I couldn't find a place to put it in the tip itself, so I created a new tip to hold it. I have never used the MRU plugin and have no desire to use it, but I imagine that it has been fixed by now to handle tabs. If not, this tip may be useful with some cleanup. But don't keep it on account of me.

--Fritzophrenic 15:11, 10 January 2008 (UTC)


OK I see how it happened. I have just emailed Yegappan (author of MRU.vim) to ask if he would comment on the idea in this tip. Subject to Yegappan's thoughts, I'm inclined to delete the tip. --JohnBeckett 04:13, 11 January 2008 (UTC)

Making CapsLock work in Vim

Good grief! Surely no one has to write that much uppercase text that they need 26 mappings? I hate the idea of deleting a tip that has been written in English, is properly formatted, and has an author. Maybe label it dodgy? BTW I suspect the "Mixed" function should just unmap the keys rather than mapping them again (I wonder what Vim does with 'imap a a'?). --JohnBeckett 05:00, 10 January 2008 (UTC)

Map cut copy and paste to Windows defaults

We need to do a proper tip on this. See VimTip960, VimTip1387. I don't like this new tip. It's just a q&d workaround for those not familiar with how to use Vim. I guess we could just mark it dodgy as a reminder that we need a tip with a sensible discussion of the fact that there are good alternatives in Vim to Notepad style editing, with good advice on mappings for those that want a Notepad life. Or just delete the tip? --JohnBeckett 10:14, 10 January 2008 (UTC)

Mapping keys in Vim - Tutorial (Part 1)

Keep. --JohnBeckett 05:00, 10 January 2008 (UTC)

Mapping keys in Vim - Tutorial (Part 2)

Keep. --JohnBeckett 05:00, 10 January 2008 (UTC)

Mkdir on edit if needed

Dodgy. I didn't study it, but I suspect any modern Windows would work simply with mkdir and no '-p'. It's a cute tip, but it worries me. At first it sounds clever, but in practice you would end up making typos and creating directories when you thought you were doing something totally different. In fact, I'm inclined to delete it, but a "dodgy" status would give the author some notice of my concern. --JohnBeckett 05:00, 10 January 2008 (UTC)

Open Filename with "gf"

This tip needs to be removed. First of all, there are already 2 tips (marked as duplicate on this tip) which highlight the same functionality. Secondly, it accomplishes with a mapping something already built-in to Vim. Third, it overrides a common function with this mapping.

Let's get rid of this one.

--Fritzophrenic 19:19, 7 January 2008 (UTC)


Agreed. Delete this. --JohnBeckett 02:14, 9 January 2008 (UTC)


Search and replace in all buffers

Keep. Tips is a bit simple, and is probably covered elsewhere, but we need something on bufdo, and this is a start. I added the comment about how I think you need "bar" rather than pipe. I would prefer using 'hidden' rather than the misguided :update, but it's a big world. --JohnBeckett 10:14, 10 January 2008 (UTC)

Search keywords in c function

Keep, assuming it works. --JohnBeckett 10:14, 10 January 2008 (UTC)

Search keywords in c++ function

Merge into above Search keywords in c function tip. Pointless having two tips. BTW I was amazed when this tip appeared because it successfully uses "C++" in a title. When I tried that (to rename the tips broken by the import) I got a complete disaster. Maybe it works now. --JohnBeckett 10:14, 10 January 2008 (UTC)

Set gvim window size

Delete. Should improve VimTip88 by clearly stating that you can control the initial size of the gvim window with a simple command in vimrc. Also, maybe rename tip 88 to make it clear the content discusses more than just maximizing the gvim window. There is an official todo link under Recent changes and Categories in the Participate frame which appears on the left in the monobook skin. Maybe we should add all these "should do this and that" notes to the todo page, possibly with content from the tip, then delete the tip. --JohnBeckett 10:14, 10 January 2008 (UTC)

Set options or named registers with let

I'm going to keep any tip by Fritzophrenic, but I don't get the point of this one, although that doesn't matter. The tip might be tweaked: In the "duplicate the setreg function" code, I think there should one example showing a register being set to "example". I would replace "E.g." with "For example,". Why does " = 1" have spaces but "=0" doesn't? How about a reason for why "Setting Options" uses let rather than set and setlocal. --JohnBeckett 10:14, 10 January 2008 (UTC)


I agree we should keep this one, but I think it certainly needs cleanup. Here's why I made it:

I was just starting my Vim use, and discovered that macros can not only be recorded, but also constructed and shoved into a register. I searched long and hard for a way to initialize a few registers to contain prebuilt macros from my vimrc file. Finally, I stumbled on the setreg function, only to find to my dismay that setreg does not exist in Vim 6, which is the version on a Unix server I use every so often, with the same vimrc files. After you pointed out that "let" can be used to set register values, I investigated further, and figured out that "let" can also be used to set options, which I had until then only set with "set." Armed with this knowledge, I was able to create far more advanced scripts, constructing option values dynamically, setting options to the value of variables, etc. It was a tidbit of information that I just had to share - surely, there were others like me that just assumed "set" was for options, "let" for variables, and that was the end of the story. Could the tip have been better named? Could it include better examples? Most definitely. But I think it could prove very useful for beginning Vim users...possibly even a good addition to your "did you know..." section. Like, "Did you know...you can modify the value of almost everything with the 'let' command?" That's what I was trying to get across...proper use of 'let' can be very useful in any advanced script, and Vim, while a great editor with spectacular help files, is unfortunately so full of commands that it is hard to master more than a very small subset of them unless someone points you in the right direction.

--Fritzophrenic 15:44, 10 January 2008 (UTC)


Quite an inspiring explanation! When you have time, please see if you can tweak the tip a bit and remind me to add it to "did you know". --JohnBeckett 04:13, 11 January 2008 (UTC)


Short help for PHP functions inside of Vim

Delete. I would want a good reason to keep this tip. I'm not happy about deleting it, because it may be useful to someone. But should each of the 2,000 scripts have a tip that is nothing more than a link to the script? --JohnBeckett 10:14, 10 January 2008 (UTC)

Show parts of line that make it longer than 80 chars

Disclaimer: I heavily edited this tip at one point (though I had forgotten this until I checked the page history).

This tip is a great example of fixing a common problem as well as highlighting an uncommon Vim command. I may have been over-zealous in my editing, so somebody may want to restore some of the previous content, but I'd say KEEP THIS TIP!

--Fritzophrenic 19:19, 7 January 2008 (UTC)


Keep this. --JohnBeckett 02:14, 9 January 2008 (UTC)


Swap LHS and RHS of an Assignment statement

Dodgy or delete? I have probably never wanted to change "alpha = beta" to "beta = alpha". Does someone really need this sufficiently often to make a mapping? Maybe add content as a note in Exchanging adjacent words. Or maybe include content in a tip "Amazing regexs with no explanation". --JohnBeckett 10:14, 10 January 2008 (UTC)

Swap file "..."already exists! - so diff it

Keep. Should fix title – maybe "Handling the Swap File Exists error". We do need a tip on this, so this is a good start. If anyone remembers, I notice that "If there where" should be "If there were". --JohnBeckett 10:14, 10 January 2008 (UTC)

To switch back to normal mode automatically after inaction

Keep for its cuteness. Rename (at least omit "To"). Maybe "Automatically switch back to normal mode" (is "after inaction" needed?). --JohnBeckett 10:14, 10 January 2008 (UTC)

Use :next to search for files in the current directory

I suppose this should be kept, although I'm doubtful. I would never use a command like this because the alternative tools are so good, starting with the built-in :Explore. Sure, if I want to open *.h in one directory I might use a Vim command, but I can't imagine in practice wanting to open all matching files in a tree without actually using a tool better suited to the job. Anyway, if there's no better place to put this content, I suppose we can keep it.

To fix the tip: The help should be to :next_f rather than :next. The "for example" confuses me. For one thing, there is no reason to have an example with "vim" in the path. Also, delete the "d:" – it serves no purpose. Does the command really search the parent directory like the words suggest? --JohnBeckett 10:14, 10 January 2008 (UTC)

Version Control for Vimfiles

This tip is a good idea, and something I hadn't thought of even though it may be obvious to some. But, it doesn't really have much to do with Vim. I'd keep it, but wouldn't be heartbroken to see it go.

--Fritzophrenic 19:19, 7 January 2008 (UTC)


Keep this (although I agree that it would be no loss to see it go). --JohnBeckett 02:14, 9 January 2008 (UTC)


Vim Doclet

Keep. --JohnBeckett 10:14, 10 January 2008 (UTC)

Vim On Vista

I have Vim installed on Vista, and it seems to be working fine with none of the hacking this tip suggests. It may be useful for others (I certainly wouldn't want to figure all of that stuff out) but someone needs to find out:

  1. Is this tip needed? Does this problem actually happen on a regular basis?
  2. Does this tip work?
  3. Is there a better way? Preferably a simpler one?

--Fritzophrenic 19:19, 7 January 2008 (UTC)


I'm a bit worried about this tip. It starts by explaining that some unknown problem occurred, and then lists the fairly extreme steps taken to recover. My worry is that the tip could be interpreted as advice that should be followed by general Vista users. I know the first para is intended so readers should not reach that conclusion, but it would be an understandable mistake.

In fact, it's not clear if the author ever established what the problem was, or which of the listed steps were necessary. In these kind of confusing one-off situations, it's not clear to me that the steps taken by one person are of much value to general readers, unless some explanation is provided (a particular problem was noted, and its cause was found to be X, and because of reason Y, the workaround was Z). Pretty well all of the steps look dangerous to me, starting with the source chosen to download Vim.

Also, George Reilly just confirmed Fritzophrenic's point that installing Vim on Vista does not require any of the steps in the tip. See the vim_use archive.

--JohnBeckett 09:36, 8 January 2008 (UTC)


If no one supports this tip soon, I'm inclined to delete it. --JohnBeckett 02:14, 9 January 2008 (UTC)


Word frequency statistics for a file

Keep. A pointless but truly amazing tip! Put it in the proposed "Advanced regex" category. --JohnBeckett 10:14, 10 January 2008 (UTC)

X11-clipboard support in terminal

Keep. I don't want to take the time to think much now, but I note that VimTip984 is related.

Interesting how the http link to sad.png now shows up as a link, whereas when the tip was created it showed the actual image. We should delete that link. BTW I am deleting smileys from tips and comments, when I find them. --JohnBeckett 10:14, 10 January 2008 (UTC)