Vim Tips Wiki


13 Edits since joining this wiki
December 28, 2007

Willkommen, bienvenue, welcome, welkomEdit

Welcome to the Vim tips wiki! We hope you can make continuing contributions of articles and/or discussion and other improvements.

If you are new to Wikia or wikis in general, be sure to visit the "Community portal" for an outline of some of the main parts of the site and a link to pages that tell you how to edit.

Do keep an eye on the "recent changes" page, where all edits and their authors (anonymous or signed-in) are listed. Bookmark it, maybe. (And help delete spam - unpleasant but a fact of life.)

If you want to get involved, check out Project:Policy and if you like, join the mailing list.



Hi Shii – It's great to get some new activity here, particularly from a Wikipedia sysop, so welcome. I see you've found stuff like Template:Duplicate, which you used in VimTip89. Excellent!

I hope to make the Main Page a bit clearer and more helpful for people arriving here. If you have any thoughts, please let me know. I started a discussion about that near the bottom of User_talk:Fritzophrenic. Prety dumb place – I should have put the ideas on Talk:Main_Page, but I didn't feel like archiving the old stuff on that page, and Fritzophrenic was the only other really active person here at the time. Also, Fritzophrenic had the idea for featured tips, which I want as the focus for a new Main Page, so I was replying to his ideas started at Featured Tip on the vim-l mailing list.

You might like to comment about the Main Page at User_talk:Fritzophrenic (I hope Fritzophrenic is taking a holiday and will be back soon), or reply here.

--JohnBeckett 00:37, 29 December 2007 (UTC)

Heh...yeah, vacation tends to put a damper on my usual activities. I'll be back in the swing of things in a few days...though I need to cut back a little bit (I spend a little too much time working on the wiki while I'm at my job...I need to change that). Welcome, Shii! I'd love to see your thoughts on the featured tip page, if you get a chance.

--Fritzophrenic 17:11, 31 December 2007 (UTC)

Discussion page for 1440 Launch files in new tabs under WindowsEdit

I see you've commented on the "Talk:Launch_files_in_new_tabs_under_Windows" page that the tip doesn't seem to work.

Of course what you've done is correct, and is the standard wiki procedure, however, FYI I'm encouraging people to avoid discussion pages for a few more months. User:Bastl imported over 1200 tips, with VimTipNumber, navigation pages in June 2007. Many navigation pages were broken (for example, next would go to a missing tip), and most tip pages had broken formatting and a ton of junk comments. While we are completing the transition from the old web site to the wiki, I think it would be helpful if all comments were kept on the main page. I started explaining this at Vim_Tips_Wiki:Discussion_guidelines.

For example, I am using a bot to download 100 tips at a time, then edit the tips in local files, then upload the cleaned pages. I have processed tips 1 to 1315 so far. I won't see any comments on talk pages.

Even when I've finished my main clean up (in a few days), there will be lots more clean up to do. It's simply too hard to work with the tip page and its discussion page. Also, a lot of the tips are obsolete or have other defects. We should alert readers by putting comments on the main page.

I'm not complaining – you did the right thing. I'm just hoping you will make more contributions here, and I wanted to explain my opinion in some detail.

BTW I have finished fixing the navigation – pretty well all previous/next links should now do something sensible (although navigation on tips from 1316 to 1504 may be slightly wrong until I've finished upgrading them).

--JohnBeckett 00:37, 29 December 2007 (UTC)

1440 Launch files in new tabs under WindowsEdit

I've just tried this tip in a Virtual PC running Windows XP and Vim 7.1. It worked well. Of course you would have to change the path from "C:\Program Files\Vim\vim71\gvim.exe" to whatever is valid on your system. Step 2 of "Using Windows Send To Menu" is garbled (I don't see what the "Click 'OK' to open a shortcut folder" stuff means). However, the tip does work.

If you want to make it work (it's pretty clever), reply here and explain what problem you saw, and maybe we can figure out what happened, and clarify the tip.

--JohnBeckett 02:43, 29 December 2007 (UTC)

Oh, the shortcut works properly, it just opens in a new window ("GVIM1") instead of a new tab. Shii 06:20, 3 January 2008 (UTC)

If you want to pursue it, here is what happens on my test machine (Windows XP with a new gvim 7.1 install + VimTip1440).

At command prompt, check the settings:

C:\>ftype code
code="C:\Program Files\Vim\vim71\gvim.exe" --remote-tab-silent "%1"

C:\>assoc .c

With no gvim running, I use Explorer to double-click file one.c. It starts gvim and displays the file; no tab is visible. In Explorer, I then double-click file two.c. The first instance of gvim now shows two tabs with files one.c and two.c. Only one gvim is running.

In Explorer, I can select and open several .c files in one step. Each file is displayed in a new tab in the same instance of gvim.

--JohnBeckett 09:43, 29 December 2007 (UTC)

This is Windows 2000 with a vim install edited as you see in my userpage:
C:\Shii>ftype vim
vim="D:\Files\Programs\Vim\vim71\gvim.exe" --remote-tab-silent "%1"
C:\Shii>assoc .txt
Two files open in two separate windows. Shii 19:12, 29 December 2007 (UTC)

I just installed Vim 7.1.175 in a Windows 2000 machine and applied VimTip1440. It worked fine, as I described above. I then replaced the default _vimrc with the commands from User:Shii, and entered the 'ftype vim' and 'assoc .txt' settings you have above. Again, it worked fine: In Explorer, I could open files a.txt and b.txt and c.txt. Only one gvim was running, and it showed the three files, each in a separate tab. Pressing Ctrl-Tab and Ctrl-Shift-Tab selected next/prev tab, as per your _vimrc, confirming that it had been loaded.

Maybe there is something strange about your version of Vim. Tip 1440 requires the "+clientserver" feature (you should see that text, with "+", when you use :version in Vim). However, you must have that feature because if you don't, Vim gives a big error message when you use tip 1440.

The Vim I used is the best way to get Vim for Windows:

The web site is "Cream (for Vim)", but the files on this page are for pure Vim (no Cream).

Click gvim-7-1-175.exe (setup program) to download it. When downloaded, run it to install. It installs console Vim and GUI Vim (gvim), "big" version 7.1.175 (that is, 7.1 with patches 1 to 175).

--JohnBeckett 05:09, 30 December 2007 (UTC)

I ran the --remote-tab-silent comamnd itself and it worked fine. I guess the extension handler in my copy of Windows is glitched up. I'll look into it. [edit: It seems to have started working now for no apparent reason.] Thanks for your help. Shii 05:48, 30 December 2007 (UTC)

I'm glad this tip started working for you; it's one of my favorites. Eventually we'll want to clean out that discussion page. I fixed some of the wording on the tip page to make it a bit clearer...feel free to fix it up more if it still needs work!

By the way, you can actually take advantage of the multi-window thing by specifying differnet "server names" for different file types. In your case, GVIM1 was spawned can manually specify something else if you want using --servername (see :help --servername). For example, I open one Vim instance for all binary files (with servername HEXVIM), another for html and css files (WEBVIM, I think), and another for everything else (using the default GVIM). I thought about another for just code, but it got a bit excessive.

--Fritzophrenic 17:11, 31 December 2007 (UTC)

Also on Fandom

Random Wiki