Vim Tips Wiki
Register
Line 188: Line 188:
 
----
 
----
 
CloseScratch is in one of the tips above. I like this tip...probably never will use it, but it's a cool way to remap keys without losing functionality. That way I can stop complaining about people remapping , and ; all the time. _ I can understand, because it's really only useful on a Dvorak keyboard where it appears on the home row. Anyway...keep! --[[User:Fritzophrenic|Fritzophrenic]] 13:50, 6 May 2008 (UTC)
 
CloseScratch is in one of the tips above. I like this tip...probably never will use it, but it's a cool way to remap keys without losing functionality. That way I can stop complaining about people remapping , and ; all the time. _ I can understand, because it's really only useful on a Dvorak keyboard where it appears on the home row. Anyway...keep! --[[User:Fritzophrenic|Fritzophrenic]] 13:50, 6 May 2008 (UTC)
  +
----
  +
Very nice tip.
  +
However, I really have troubles with [[:Category:Map]]
  +
BTW, IIRC, there are a few other tips about scratch buffers.
  +
--[[User:Luc Hermitte|Luc Hermitte]] 12:04, 7 May 2008 (UTC)
   
 
==[[Provide script-accessible version info in your plugins]]==
 
==[[Provide script-accessible version info in your plugins]]==

Revision as of 12:04, 7 May 2008

New tips April 2008

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
Comfortable handling of registers discuss -
Creating new text objects discuss -
Creating your own syntax files discuss -
Filter buffer on a search result discuss -
IPython integration discuss -
Launch files in new tabs under Unix discuss -
Mapping keys in Vim - Tutorial (Part 3) discuss -
Move current window between tabs discuss -
Open content of website in new buffer (using elinks text web browser) discuss -
Open file in new tab if current buffer is non-empty discuss -
Overload a key with multiple handlers discuss -
Provide script-accessible version info in your plugins discuss -
Remap join to merge comment lines discuss -
Using bash completion with ctags and Vim discuss -

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

General comments (not for a specific tip)

Comfortable handling of registers

Keep. Think about a better title later (unless someone can suggest a better title now). --JohnBeckett 11:19, 6 May 2008 (UTC)


Keep, rename later. FIRST though, use a different key for the mapping! 's' is a command that many people use quite frequently! While we're at it, use nnoremap instead of map. --Fritzophrenic 13:50, 6 May 2008 (UTC)

Creating new text objects

Keep, excellent. Don't merge with Indent text object which uses tricky code that obscures the fundamental issues. I'll put a "See also" to "Indent text object" and to VimTip1516 (I'll look later to figure out where). I might mention what the <C-U> does in the vnoremap. --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. --Fritzophrenic 13:50, 6 May 2008 (UTC)

Creating your own syntax files

Keep, good tip. I will clean up the comments. --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. --Fritzophrenic 13:50, 6 May 2008 (UTC)

Filter buffer on a search result

Keep. Has some interesting points, although I'm beginning to strongly dislike tips where you have to guess what they do. Also, I don't understand that stuff at the end where the author uses nmap ,f ... instead of nmap <Leader>f ... although there is some complex stuff mentioned about g:mapleader. If someone can briefly enlighten me please do so. Also, I'm beginning to think we should change all tips (where appropriate) with 'nmap' to 'nnoremap' (no-remap, and spell it in full). --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. I actually like the "see also" links better than the tip itself, but whatever. Also, here be the mysterious "CloseScratch" function mentioned in another tip. --Fritzophrenic 13:50, 6 May 2008 (UTC)


We should indeed just use <Leader>f (I don't see the point in the discussion about g:mapleader ; I suspect the author didn't fully understand how <leader> is meant to be used).

I also have trouble with tips (or whatever) that don't start by explaining in two sentences max what they are all about. Isn't this tip about another way to do a :vimgrep ? --Luc Hermitte 11:42, 7 May 2008 (UTC)

IPython integration

Keep, but with changes:

I removed the autosaving stuff, we already have a tip for that: Auto save files when focus is lost.

I don't have KDE so I can't test this, but it looks like it send a command to konsole from vim?
This would seem useful, but this would of course work for more stuff than just IPython, IMO this page should be renamed to something more general like 'Launch commands in konsole', examples with IPython and other applications can be added at the bottom.

-- User:Carpetsmoker 21:09, 15 April 2008 (UTC)


I'd suggest making a "see also" section then, with a link to the auto-save tip and other python integration tips (I think there was an omnicomplete python tip recently, among others).

--Fritzophrenic 15:15, 15 April 2008 (UTC)


I don't see why the auto-save tip should be linked, it's a very separate subject/tip.

I also don't see the relevance of other python tips if we would make this a general 'Launch commands in konsole' tip.

-- User:Carpetsmoker 21:09, 15 April 2008 (UTC)


I agree with Carpetsmoker (don't bother linking). I don't like the fact that the reader is expected to guess what the tip is all about, but I don't think we're going to be able to fix it now. So keep it, and hope it is fixed later. --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. --Fritzophrenic 13:50, 6 May 2008 (UTC)


Is it meant for the Category:Integration ? (I have no idea what IPython is) --Luc Hermitte 11:46, 7 May 2008 (UTC)

Launch files in new tabs under Unix

I was thinking of merging all the "Launch files in new tabs" tips, there are now about 5, and 80% is the same... -- Carpetsmoker (Talk) 18:41, 1 May 2008 (UTC)


That would be great. I've make a todo list of tips on launching Vim in case it is any help. Please add anything I've missed. I put whatever I could find so some may not be completely applicable. Perhaps move them to another list, or just delete them. --JohnBeckett 06:04, 2 May 2008 (UTC)


I actually disagree. While it is certainly a good idea to merge tips that have redundant content, in some cases I believe it is much better to have several smaller tips, each covering a small aspect of some greater whole, possibly each referencing each other, than one huge tip that covers everything. For example, the new tip about creating text objects could be covered (and is briefly mentioned) in the "Mapping keys in Vim" pages. However, I think it is much nicer to be able to view a short, simple, to-the-point tip that covers exactly what you want to do, rather than needing to wade through one big tip that covers everything remotely connected with what you are trying to do. If I wanted one big resource, I'd just use the Vim help files. I think the point of a tip is to be simple, not encyclopedic.

I think we should have several tips about launching Vim. Perhaps (and I'm doubtful about this) we could merge all the "launch in new tabs" tips to cover all OSes. Personally I don't think we should, simply because there are so many OS-specific tweaks to cover that will be totally useless to people with other OSes. We certainly should NOT, in my opinion, merge in tips about hacking the Windows registry to get the context menu to work, or using the SendTo menu, or other topics that (while related) are a separate enough topic to deserve another tip. Obviously it is a good idea to link to these other tips, but again, this is a collection of tips, not an encyclopedia.

--Fritzophrenic 14:20, 2 May 2008 (UTC)


Keep, although I haven't tried it. I will fix the spelling. Presumably the line "Be aware that the desktop file are exchanged every time you install a new version of Gvim" should be "Installing a new version of gvim will probably overwrite the gvim.desktop file, so you will need to repeat the following change".

I agree with Fritzophrenic that we should not merge tips unless there is a real benefit. I'm pretty sure that a tip on this topic for Windows would not nicely integrate with a similar tip for Linux. Such integration would just give a complex mess. The list I made on Vim_Tips_Wiki:Todo was intended only to help merge tips that are essentially duplicates, where you would only need to take a couple of paras from one tip and put it in the other, and that change would not greatly expand the scope of the merged tip. So this new tip for Unix should not be merged with the existing tips. --JohnBeckett 11:19, 6 May 2008 (UTC)


If the tips are not mergerd, at least they shoyld have a very close title. (Integration category is missing) --Luc Hermitte 11:56, 7 May 2008 (UTC)

Mapping keys in Vim - Tutorial (Part 3)

Keep, great stuff. --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. Perhaps rename to get rid of "tutorial" as suggested in the comments for one of these tips? I think "Guide" would be a better description than "Tutorial". --Fritzophrenic 13:50, 6 May 2008 (UTC)


"guide" is a good suggestion. May be we should see this with Yegappan. --Luc Hermitte 11:59, 7 May 2008 (UTC)

Move current window between tabs

Keep. Potentially useful and shows some interesting code that is not too long. --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. This is fairly cool. --Fritzophrenic 13:50, 6 May 2008 (UTC)

Open content of website in new buffer (using elinks text web browser)

Merge to one of the tips I listed in "See also", probably VimTip127 (Paluh, the author of the new tip, seems to agree that would be best). When it is merged, need to copy in the "See also", with a todo that more merging is needed. --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. --Fritzophrenic 13:50, 6 May 2008 (UTC)


Hi,
I've added comment to the 127 Preview HTML files quickly which is my proposition of merge. I've got one additional proposition: after merge this tip should have new title (maybe "Open html file/website in new buffer (using snapshots from elinks or lynx)" but I'm not sure if it's not to long ;-)).
--Paluh 11:01, 7 May 2008 (UTC)

Open file in new tab if current buffer is non-empty

Delete? It was good of Fritzophrenic to keep the info somewhere while cleaning up VimTip1285, but I don't think this merits a separate tip (unless Fritzophrenic can explain further). --JohnBeckett 11:19, 6 May 2008 (UTC)


Go ahead and delete it. I was just cleaning up the other tip and really didn't find this functionality useful, advisable, or even correct. --Fritzophrenic 13:50, 6 May 2008 (UTC)

Overload a key with multiple handlers

Keep, I suppose. It's good to have a tip on the concept of chaining handlers, although I'm not sure that I'll ever need it. OTOH it's irritating how the tip refers to "the CloseScratch function used in another tip of mine", and the author hasn't responded to my request to clarify what that means. --JohnBeckett 11:19, 6 May 2008 (UTC)


CloseScratch is in one of the tips above. I like this tip...probably never will use it, but it's a cool way to remap keys without losing functionality. That way I can stop complaining about people remapping , and ; all the time. _ I can understand, because it's really only useful on a Dvorak keyboard where it appears on the home row. Anyway...keep! --Fritzophrenic 13:50, 6 May 2008 (UTC)


Very nice tip. However, I really have troubles with Category:Map BTW, IIRC, there are a few other tips about scratch buffers. --Luc Hermitte 12:04, 7 May 2008 (UTC)

Provide script-accessible version info in your plugins

Keep. It's a very simple tip (simple for those who write plugins), but it's a good idea, and may be expanded with more relevant info later. --JohnBeckett 11:19, 6 May 2008 (UTC)


I agree. Very simple, but a subtle difference from the norm that lets you write plugins that can be far more useful. --Fritzophrenic 13:50, 6 May 2008 (UTC)

Remap join to merge comment lines

Keep, good stuff. I'd need to have a lot of comment joining to do before I went to the trouble of applying this tip, but it does have some good ideas that will be useful to someone. --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. I have been doing a lot of comment joining...that's why I wrote the tip. A nice side-effect was realizing I could use it for line continuations in Vim as well. --Fritzophrenic 13:50, 6 May 2008 (UTC)

Using bash completion with ctags and Vim

Keep (not tested). It's more of a bash tip than a Vim tip, but it may be helpful to readers, and I'm happy for a few tips to deal with specialist topics. --JohnBeckett 11:19, 6 May 2008 (UTC)


Agreed. --Fritzophrenic 13:50, 6 May 2008 (UTC)