plaintext

Why Plaintext?

According to the Life Hacks research done by Danny O’Brien, Unix geeks uniformly prefer using plain text files to track their to-do lists. In a computing era when beautiful GUI applications will perform innumerable activities to keep track of you and your data, why would anybody still poke at plain text files, especially on the utilitarian command line of all things?

The question contains the answer: the geeks don’t want feature-bloated programs performing innumerable activities to their data. They want to pick and choose what they write down (or rather, type in), how they manipulate it, what has access to it, and when something gets changed. And they also want to be able to see the trees for the forest, so to speak, without the GUI getting in the way of their work.

See our Plaintext category for a list of posts on the topic.

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.

Linux Tools for Writers

linux_gvim.png

Aaron Peters of The Writer’s Technology Companion posted “Moving to Linux: Tools for Writers” last year, covering the basic text editors, word processors, and desktop publishing options in an article for beginning Linux users.

As an avid free and open source software (FOSS) advocate, I’ve spent some time over the last few years writing on the Linux platform. I’ve come to discover that it’s still an immature platform for certain folks, such as hardcore gamers or multimedia professionals. But for those who have their fun (or make their living) by putting words on (e-)paper, Linux offers a perfectly usable platform for doing everything a writer needs to do.

This was the first in a series of “Moving to Linux” articles, all applicable to writers:

  1. Moving to Linux: Tools for Writers
  2. Moving to Linux: Working with Text (Part 1)
  3. Moving to Linux: Working with Text (Part 2)
  4. Moving to Linux: The New OpenOffice
  5. Moving to Linux: Scribus for Writers
  6. Moving to Linux: The Netbook is Your New Best Friend
  7. Moving to Linux: Working with the Netbook

If you’re still using a Mac, most of the tools Linux users enjoy are available, either as separate binaries, compile-it-yourself source, or via package managers like MacPorts.

Vim a la TextMate

Alex Young posted “Vim for TextMate fans” a couple of years back, in which he ponders how to get the best of both worlds:

I’ve used vim a lot over the years, mainly because I spent a long time using Linux and it was there so I used it. The choice was obvious: vim or vi were on almost every machine I had access to, and worked excellently both locally and remotely. Once I’d learnt the basics I was set, I knew enough to get my work done.

Then I found TextMate for Mac OS. The immediacy of TextMate made it easy to get started with, and it has many excellent features. The problem is, I’m not always using a Mac. But you know who’ll follow me around to every platform I use? Good old vim! So I started thinking, how could I make vim feel more like TextMate?

Check out his screencast for more.

Using vim as a personal wiki

Abhijit Nadgouda over at iface thoughts describes a method of using vim as a simple wiki system, utilizing its built-in “tags” capability.

One thing I have learnt from experience is that the tool to collect and organize our information must be easily available and easy to use. And that is where vim scores higher than any other tool to build a wiki.[…]

Nowadays I use the vim as a combination of wiki and outliner to record my ideas and thoughts, documentation, tasks and even contacts.

Looks very easy to set up and use — I think I’ll give it a try.

Syndicate content