Vim – a first

I just edited my first ever file using Vim. Not a lot I know, but I didn’t break anything in the process. Worth noting :) Next up is deleting stuff. rm * or something similar I believe … (I forgot to add – I mean command line stuff, not editing stuff)

Edit: How damn cool is rm -rf ? Bloody marvellous stuff, saves years of ftp waiting for deleting stuff. Now.. what next ?

5 thoughts on “Vim – a first

  1. *twitch* Vim! *twitch*

    The horror… the horror. Vim is pretty much my entire argument for a GUI ;)

    I like the Unix commandline. SSH access to my host is invaluable, but I’ll be damned if I edit anything in VIM. I’ll just SFTP into my account with WinSCP and edit it on the server using my favourite windows gui texteditor (atm Editpad). It was slightly easier on a mac (Fugu and SubEthaEdit) but still… screw a bunch of Vim.

    but yeah.. rm -rf, really useful.

  2. you might want to try emacs / pico / whatever other editors are on your system, but it’s probably too late (I stumbled on vim first and have never been able to get on with another equivalent since ;)

    so … you’re discovering the shell, eh? Found out about the Real Ultimate Power(tm) of pipes yet? Read on …

    Here’s a quick example … you might not know the command “less” which is just a little ‘output pager’ thing. Less lets you page through a large amount of text. You can use less on a text file to view it:

    less myfile.txt

    And, if the file contents are long enough, less will let you page up and down. Now consider this:

    ls myDirWithHundredsOfFiles

    This will list the directory contents, but there are hundreds of them and they whizz by too fast! You could limit ls’s output incrementally and repeat the command which would effectively let you see all the files (eventually):

    ls -n 20 myDirWithHundredsOfFiles
    ls -n 40 myDirWithHundredsOfFiles
    ls -n 60 myDirWithHundredsOfFiles

    But that’s crap, right? How about we *combine* the ls command with less? We use a pipe for that:

    ls myDirWithHundredsOfFiles | less

    Now less will happily page back and forward through the output from the ls command (rather than the content of a text file as in the original example).

    Hope that helps!


    (ps – “less” is so called because there was an older version called “more” …. it’s a joke, see?)

  3. Justin – the first livecd that has the new broadcom code in it will certainly have me there.

    Pete – complex…. but I need to play and Gregory – I’ve got pspad around somewhere and that can edit directly so I ought to try that I suppose.

    Oh – on the main index page, refresh, then type drunk


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.