67 Comments
- riah, on 10/12/2007, -3/+15Kind of like a taskbar.
- narula, on 10/12/2007, -3/+11hasn't anyone ever heard of screen?
- bradwich, on 10/12/2007, -0/+7I had a buddy of mine that used to do the same thing. How come so few have ever heard of :bp, :bn, or even :split and :vsplit? Every time you :vi another file in vim, it opens it in a new buffer. At that point you can switch between them or create new windows (split screen, even in a normal terminal). Long before vim supported tabs, it supported multiple buffers and split windows in the same instance (no background jobs, no screen command, no need for multiple shell sessions in your konsole/gnome-terminal/whatever, etc.). And of course, you can yank/put across buffers. Tabs in vim don't allow you to do anything new in vim--it's simply a different face on the same functionality.
- bart9h, on 10/12/2007, -0/+5The Fluxbox window manager does this.
Drag the window title with the middle mouse button into another window title, and the windows will merge, and the title bar will be split as tabs.
Here are some (quite outdated, but still valid) screenshots:
http://fluxbox.org/screenshots-dev.php
I'm eagerly awaiting for the Fluxbuntu release. - mapkinase, on 10/12/2007, -0/+4Dugg without reading for the word "vim" in the title
- prockcore, on 10/12/2007, -1/+4I honestly don't know of a better editor that's available over ssh.
- OrangeTide, on 10/12/2007, -0/+3I've used window managers that just make every application full screen and you select them with tabs. It's called Ion (and version 2 is nicer than version 3, imo). http://modeemi.fi/~tuomov/ion/
- Leviathan777, on 10/12/2007, -0/+3this is nice! i never knew about it. and i use vim daily.
sure, i use screen as well - but tabs keep the names of the sessions visible. and i use multiple buffers all the time. but having the tabs visible is nice... - fancypants, on 10/12/2007, -1/+4Ah, but with vim you can very easily copy and paste text between the tabs. Plus some people like to use screen to divide up their work session (vim; server shell; local shell) -- this way vim is neatly contained in one screen and you don't have to hunt around through multiple screen instances.
- Gerikes, on 10/12/2007, -2/+5:next
- Lobosch, on 10/12/2007, -0/+3If somebody wants to have a visual tab for each buffer in vim, here's a plugin:
http://www.vim.org/scripts/script.php?script_id=159 - counterplex, on 10/12/2007, -1/+4Nice try mentioning emacs ;)
While I respect the editor, I fear I haven't yet mastered it enough to justify launching it. This attitude will probably mean I'll never master it enough :-/ But the fact remains, vi is available on practically every *nix and whether or not I switch to emacs in the future, vi skills always come in handy :)
And yes, I realize vim is optional on most *nixes ... just like emacs. - freddo, on 10/12/2007, -0/+3I've not yet looked at the tab feature of vim 7, but i never felt it was a necessity. One way to use vim, which is not frequently mentioned, is to run it in server mode. Add the following alias to your .bashrc:
export PROJECT=`id -un`
alias e='vim --servername $PROJECT --remote-silent'
This tells vim to look for an already running instance (named with your username in this case), if it exits the filenames you supplied will be opened there. If it doesnt it will create one and open the files, all your subsequent editing will happen there. Use :bnext and :bprev mapped to you favourite keys to switch between buffers as usual. Changing the environment variable PROJECT let you easily group the files you edit within various running instances. You can list running instances with: vim --serverlist.
Personally, I start a vim instance from my .screenrc and all my editing happen there. - Drealoth, on 10/12/2007, -1/+3ed! It's the standard text editor!
- packetlock, on 10/12/2007, -1/+3Screen is not always installed. Screen also is another process that runs and sometime on shell accounts you have a limited number of processes you are allowed to run. Having this built into VI or VIM would be very nice. One less process running is always good.
- ellisgl, on 10/12/2007, -1/+3I haven't used this - but my neighbor does: http://cream.sourceforge.net/home.html
- bart9h, on 10/12/2007, -0/+2Another nice way to edit multiple files, that was avaiable before v7, is to split them.
To open from cmdline:
vi -o file1 ... fileN
Or, inside vim:
:sp otherfile
To split a new (blank, unamed) buffer:
:new
I made maps to easily navigate the windows. The defaults are:
and to jump to the upper and lower window;
and to grow and shrink current window;
to maximize current window;
to make all windows the same height.
Splits can also be vertical, with the command :vsp, or the cmdline argument -O - geronimo, on 10/12/2007, -1/+3with emacs you use buffers to do this.
- lordie, on 10/12/2007, -0/+2Why not:
- vim file_1.c
- edit edit edit save
- :e /path/to/file2.c
- edit edit edit save
- :e#
- (you're in file_1.c!)
- :e#
- (you're in file2.c!)
Also, once you read the keystrokes for windowed buffers, you'll never go back. Everything starts with ^w (for window). The following 3 key combinations changed my development habits forever:
- ^ws splits the window horizontally
- ^ww moves the cursor from one window to the next, as does ^wUP ^wDOWN, etc.
- ^wc closes the active window - Etaoin, on 10/12/2007, -1/+3You can sort of do this with Beryl on Linux (as of the 0.2.0 betas), but it's a bit weird for the moment. It's a new feature, though, so I imagine it'll get cleaned up in the next release or two.
- OrangeTide, on 10/12/2007, -0/+2if you really want to be universal run 'nvi', which is installed as 'vi' on non-linux systems. it's the real deal in old school text editing, unlike vim.
- OrangeTide, on 10/12/2007, -0/+2pico is good at wasting gobs of memory loading semi-large text files. nano is okay (in terms of memory usage), joe is better in terms of being easy to use and powerful.
vi is popular among programmers because the primary task of programming is manipulating lots of tedious and esoteric text files. - GMorgan, on 10/12/2007, -0/+1Mindless heretic. You will be purged along with all the malformed, RSI crippled, servants of the church of Emacs. I can honestly say that I've never pressed ++++++ just to perform a search. All must aspire to such purity of function.
My feature request for adding '#emerge -C emacs' to the Gentoo crontab as default keeps getting rejected so I must assume that they have succumbed to this evil editor as well.
In all fairness Emacs is an interesting piece of technology but they badly need to change that default editor. - counterplex, on 10/12/2007, -1/+2I've found the best way to deal with multiple editors is using background jobs. A typical session goes like this:
1. Open file1.c in vim (vim file1.c)
2. You need to go to the command prompt - Ctrl-Z. This stops vim and sends it into the background. You're at the command prompt - do what you want to do.
3. While at the command prompt, you want to edit another file, start up another vim session (vim Makefile)
4. You want to switch to the other file? Ctrl-Z to stop the second editor, 'fg 1' to bring the file1.c editor into the foreground. Continue work.
The one benefit of tabs that comes to mind is a shared yank buffer. - aylons, on 10/12/2007, -2/+3In fact, up to the 97 version, Word used to have tabs... actually, MDI, which means full windows inside the software main window, just like Opera does (or not, depending on the user configuration).
It's more flexible than tabs, and I thought, at that time, that changing this approach to the independent windows approach as a regression. Now, I'm yet more sure it was. - GMorgan, on 10/12/2007, -0/+1Why would you not have tab completion in your shell. Typing everything out is a waste of time when I can just hit tab.
Of course Solaris 10 is mildly insane by default and doesn't have tab completion or a command history which is rather gay. - jonathan95060, on 10/12/2007, -4/+5sort of like emacs. Cool!
- moronpatrol, on 10/12/2007, -2/+3the keyboard is always faster than mouse...except maybe in the case of using an ide on large product development. Once the commands are memorized its at least twice as fast. mousers make me want to stab myself in the eye with a pencil they are so slow..
however i admit i've gotten lazy with using gui editors. i'm also alot slower because of that. Same goes for latex vs gui,etc - swedegeek, on 10/12/2007, -0/+1Tabs are a nice (and possibly overdue) feature in Vim 7, but I can see why they have not been an essential addition. Buffers have been available for quite some time, and they allow you nearly the same effect, minus actually seeing a tab for each file. For quite some time, I've had my Windows Vim installs map C-Tab/C-S-Tab to next/previous buffer commands that let me scroll through all my open files with ease.
I'm all for the update to actual tabs, but I can see why Bram and co. haven't bothered with them until now. Viva la Vim! - BlackAdderIII, on 10/12/2007, -0/+1@mercurysquad
When you just want text editing and not the full emacs suite, that's what zile is for.
Zile is very fast, very light and very quick to use.
...not gainsaying, just info in case you ever avoided editing in vanilla emacs because it's heavy.. - hackwrench, on 10/12/2007, -2/+3I keep thinking it would be nice if there was some way to make tabs application agnostic. You could have each tab be a separate program, grouping tabs purely by task.
- counterplex, on 10/12/2007, -0/+1This is awesome :) These kind of alternatives is exactly what I was looking for. Keep them coming folks!
- OrangeTide, on 10/12/2007, -0/+1every *nix does not have "Vim 7" and if you can't install "screen" then you cannot upgrade vim. It is nice that you can just apply the plug-ins though.
Many *nix systems do not ship with vim installed, it's an optional package outside of the Linux world. - GMorgan, on 10/12/2007, -0/+1Most have VI though.
- mercurysquad, on 10/12/2007, -0/+1^[ gt
- mercurysquad, on 10/12/2007, -0/+1@Black: Thanks for the heads up, I'll check Zile out. Although I'm pretty happy with Vim right now. Actually I don't like the hundreds of funky keyboard shortcuts that Emacs has (I use a laptop). I prefer the single-letter keystrokes of vi, and modal editing just started feeling natural within a week.
- geronimo, on 10/12/2007, -1/+2"Ah, but with vim you can very easily copy and paste text between the tabs. Plus some people like to use screen to divide up their work session (vim; server shell; local shell) -- this way vim is neatly contained in one screen and you don't have to hunt around through multiple screen instances."
You can do these things with screen. You can copy and paste easily (^a [, move around, space bar, select region, space bar , ^a ] to paste). You can put multiple windows on one terminal then you can cycle through them. Name a window, list them by name. Not to take anything away from vim, I just wanted to set the record straight. Another option is emacs with multiple buffers with each buffer containing a shell [esc]-x shell
Talk about a lot of ways to do the same thing... - jerrro, on 10/12/2007, -0/+1:hide edit foo
:ls
:buffer bar - mercurysquad, on 10/12/2007, -0/+1Name one editor better than vim. pico? nano? hahaha
Emacs doesn't count, it's a quasi-OS, not an editor. I don't give a ***** about an editor which can play mp3s. - TheBarge, on 10/12/2007, -0/+1I just use "screen" to edit multiple files at the same time, but this is definitely an interesting new feature.
- MrTea, on 10/12/2007, -0/+1Strange, the tutorial never mentioned this.
- diecastbeatdown, on 10/12/2007, -0/+1open multiple files.
:next
:first
:last
etc.. this has been around since the dawn of vi so i'm not seeing anything new or excitingly useful. i'm not expecting the lastest installation of VIM on most of the systems I log into and you shouldn't either. heaven forbid you not have tab completion in your shell. - RedLion, on 10/12/2007, -3/+4I believe that a better solution would be to use virtual desktops.
- BlackAdderIII, on 10/12/2007, -0/+1^ Dugg for mentioning Ion, which I was just about to when I saw your comment.
What you're asking for sounds very like Ion to me.
Also, the comment about konqy was fairly valid, lots and lots of tasks can be "adopted" by it and placed in a tab. - 0KonTroL0, on 10/12/2007, -0/+1tabs are the bomb.
- JASPER200, on 10/12/2007, -0/+1Nice Microsoft add claiming to be more secure than Linux.
- beermad, on 10/12/2007, -0/+1...and if you're REALLY feeling lazy,
:n
:-) - xamox, on 10/12/2007, -1/+1Although I like vim for editing scripts or doing quick editing I have found jEdit (http://jedit.org) to offer way more features. It's open source and cross platform with TONS of plugins. Give it a try.
- InferiorWang, on 10/12/2007, -0/+0I used to use MGT to get vim in tabs.
-
Show 51 - 68 of 68 discussions



What is Digg?
Digg is coming to a city (and computer) near you! Check out all the details on our