Devlog :: And Wizardry

Thu, 03 Nov 2011

Vim just turned 20 and I just learned a new vim trick

It was 20 years ago, November second 1991. George H. W. Bush was president, the Soviet Union was dissolving, the World Wide Web barely existed, and the vim text editor was first released publicly, originally for the Amiga, on Fred Fish floppy disk #591. Twenty years is a hell of a long time in computer years but Vim is still going strong. During the celebrations today (ongoing, although it's now after midnight) I stumbled on the Vim session feature. It lets you save the state of a editing session with all the open files, tabs, layout, and history. You can pick up where you left off with just one command. I've been living without this since Vim 7 came out with tab pages (in 2006). I got by mostly because I worked on always-on workstations or hibernate and restore laptops. I tend to keep editing sessions open through a whole project. It was always a hassle to shut down and start up again, but no more! It's basicly simple. In Vim you can check out ":help session". To save a session use ":mks[ession] name-of-session-file". To open the session again in your shell type "vim -S name-of-session-file". I created an alias in my cygwin .bashrc to open my current project session and mapped F2 in my .vimrc to the command to save the current session. Not only that, but today I also discovered the fabulous new mintty terminal for cygwin. It's been a double awesome day. Happy Vim day! [/items/hacks] permanent link