vim

vifm

An alternative to the Midnight Commander file manager utility. It’s available in the Ubuntu repositories (sudo apt-get install vifm) and via MacPorts (sudo port install vifm).

Vifm is a ncurses based file manager with vi like keybindings. If you use vi, vifm gives you complete keyboard control over your files without having to learn a new set of commands.

http://vifm.sourceforge.net/

While you’re getting in touch with your inner geek, don’t forget vimwiki, the personal wiki also based on vim:

http://code.google.com/p/vimwiki/

TextMate to Vim transition resources

Articles for people looking to transition from TextMate to Vim.

Arthur Debert (Stimuli): “Hello VIM, or quitting TextMate cold turkey”

In my last post I’ve mentioned my way through VIM. Quiting TextMate cold turnkey wasn’t easy. But fear not: there are a bunch of plugins that will make it a breeze.

Jeff Ober (Artful Code): “From TextMate to Vim”

TextMate is an excellent editor, but it is beginning to show its age. It has a few squeaky wheels that have yet to be oiled, and it looks as though the author may be getting bogged down in the minutiae of his next release. With the next version apparently due sometime after the colonization of Mars, it seemed an auspicious time to try out another editor.

Jamis Buck (the buck blogs here): “Coming home to Vim”

Fast forward three years. The vim landscape is different now. There is actually a Mac-friendly GUI version of vim now, MacVim, which actually looks like it belongs on OS X. Vim 7 supports UI tabs, and a much more powerful auto-completion mechanism than before. And plugins like rails.vim and fuzzyfinder.vim mean that TextMate no longer has a corner on powerful project navigation.

On Reddit: “Ask /r/vim: How do you work with a project in vim?”

What I love about TextMate is that I can open a directory and it will list its hierarchy in a drawer, making it very easy to navigate files. Add to that the wonderful Cmd+T which incrementally lets me search for files within this hierarchy and quickly open one in a new tab.

I’m looking for something like this in vim. Or I’m wondering how other people solve the problem of working on a project which requires quickly opening different files and navigating within a hierarchy?

Also useful for those switching from Mac to Linux. ;)

Switching: Linux App Equivalents

I have been in the process of planning out switching to Linux in 2010 for my main development computer (a laptop), as well as for various web and database servers I am responsible for at work.

I’ve been making good use of Sun’s awesome (and free) VirtualBox program, which allows me to create any number of virtual computers to experiment on. I’ve had a couple of CLI-only server versions running (Debian and Ubuntu), as well as what amounts to a desktop system for the last three Ubuntu releases: 8.10, 9.04, and the just-issued 9.10.

tron.jpg

My User has information that could… that could make this a free system again! No, really! You’d have programs lined up just to use this place, and no MCP looking over your shoulder.

I’ll cover the whys and wherefores of switching in the future. For now, suffice to say that the ever-increasing commercialization of Mac OS X, with accompanying restrictions, has been grating on me for some time now. I am also attracted to the notion of software freedom (having been a huge fan of the original Tron movie ;) and of course the cost savings can be dramatic. And since I work primarily in education, I think we would be neglecting our duty by not exploring the open-source world.

dumont.jpg

All that is visible must grow beyond itself, and extend into the realm of the invisible.

One of the first and ongoing steps is compiling a list of application equivalents to programs I am need of.

Still looking:

  • Time Machine (backup) -> roll-my-own or manual?
  • Bluetooth File Exchange -> built into Gnome?

Stuff that exists in both places:

If you’re looking into switching as well, or just are looking for new apps to try out whatever your platform, check out AlternativeTo, which provides alternatives for Linux, Mac, and Windows programs.

Note: Written before the current cold whacked me in the head and upper respiratory tract. Bits are incomplete. Suggestions are welcome.

End of line.

How to edit remote files with local vim

So I finally got around to looking up how to edit remote files with local vim[1]. You do need to have an ssh public/private key set up[2] for the server in question.

On the command line, use the format:

vim scp://username@example.com//path/to/document

Note the double // after the domain name — this gives you an absolute path on the remote box.

This technique works with the GUI gvim or MacVim applications too by using the :e command inside the program. Open up a new window and type

:e scp://lisa@example.com//www/docs/bleeding_gums.html

Bonus Tip #1

If your local username is the same as your remote username, you can eliminate it in your command. So, for example, if you were username “frink” in both places, you could use something like

vim scp://example.com//Users/frink/Documents/frogexaggerator.py

to access and edit your Frog Exaggerator controller script in your remote Documents folder.

Bonus Tip #2

Can’t remember the name of your remote file? Don’t worry — open a directory instead!

:e scp://example.net//Library/WebServer/Documents

You’ll see a list of the directory’s contents. Move the cursor to your desired file (or subdirectory) and hit return to open it. Naturally, this also works on local items.

Give me more!

You can read more in depth info at the appropriately titled Vim Tips Wiki article “Editing remote files via scp in vim”.


[1] Or gvim, MacVim, etc.

[2] Actually, you can use several different methods in addition to scp — ftp, http, etc. — but I had the automatic ssh login in place already.

Get your favorite IDE features in Vim

vi man

Ryan Paul at Ars Technica has a offers a tutorial on adding features to make it friendlier for those who are used to using IDEs*.

“Vim made easy: how to get your favorite IDE features in Vim”

The open source Vim text editor offers a significant amount of power and flexibility, but it can be difficult to configure properly. In this tutorial, we will show you several easy ways to make Vim behave more like a conventional integrated development environment.

The Vim text editor is a favorite of many programmers and system administrators. Although it provides an exceptional amount of power and flexibility, it can be somewhat intimidating for new users. Programmers who transition to Vim from a conventional integrated development environment (IDE) tend to find the paradigm shift a bit disorienting.

Of course, Vim is like the old saying about Unix: it’s user friendly, but it’s choosy about who its friends are. :)

* Read more about integrated development environments at Wikipedia.

Syndicate content