Skip to content

Derek Wyatt's Blog

Vim, OO Design and Piles of Uselessness

Archive

Category: Vim

I’ve had a number of people ask me when my next Vim Video is going to go online… I know it’s been a while since I put one up, and unfortunately it’s going to be a while longer.

Work has picked up in the last little while and on top of that, I’m buying a new house and am preparing for the move. After the move finishes I should be able to do another one. The only real problem is that the new videos are going to be of the intermediate and advanced quality and those take a lot more thought and time :)

I appreciate all the great responses, encouragement and all the interest! Keep reading those help files and stay tuned…

If you want to change settings / options based on the filetype there are a couple of ways you can do it.

Using an Autocommand

You can do this with an autocmd in your vimrc. Let’s assume you want to change some of the indenting rules for perl and html.

augroup indent_settings
    au!
    au BufEnter *.pl setl autoindent smartindent
    au BufEnter *.html setl noautoindent nosmartindent
augroup END

The above will do a setlocal when entering a perl or html file. It will turn autoindent to ‘on’ and smartindent to ‘on’ when you enter a buffer containing a perl file, and will turn them off when entering a buffer containing an html file.

Dropping the commands in a filetype file

You can also choose to organize things into separate ftplugin files in your runtime directory. If we want to continue with the perl and html examples above, you would do the following:

In ftplugin/perl.vim:

setl autoindent
setl smartindent

In ftplugin/html.vim:

setl noautoindent
setl nosmartindent

I’ve managed to throw together a video on Insert Mode today. I’m not supremely happy with this one… it was a bit rushed as I only had a short amount of time between the moments when my daughter pulls on my pant-leg asking me to do “something”.

I may redo this one, not sure yet – it’ll just depend on how much time I’ve got.

I’ve managed to cobble together a video that introduces Vim’s modes.

Have a look at it right here.

I just happened to see this story at engadget and dug a little deeper to find the EigenHarp at EigenLabs. This is possibly the coolest friggin’ MIDI Controller (almost) on the market today. It’s ridiculously expensive – way out of my price range at close to $7000 (it is just a controller after all – you still gotta have a computer and some soft synths, I believe) but that doesn’t diminish it’s complete and utter coolness!

I play an EWI 4000s which is a wicked cool super powerhouse MIDI Controller, but compred to the EigenHarp it looks like it was invented over 20 years ago (which it was :D). The EigenHarp is like some sort of psychedelic Bassoon with its LEDs, tons of keys, and insane levels of control – well, it’s just a beast of a controller.

I can’t wait to see what happens with this thing over the next few years.

I put up a new video that describes the vimrc and the Vim runtime directories.

You can have a look right here.

How to use the Help System is now online, and I think this may finish off the “Novice” set of videos. We’ve done a lot of good work moving forward with “How to use Vim”, and this video will give you some assistance with helping yourself using Vim’s superb help system.

I think the next video on the agenda will cover the runtime directory so that we can start dealing with plugins and customization a bit better before we dive back in to some more esoteric editing concepts.

I’ve just made a few updates to the vimrc section of this site to describe a bit more about what the vimrc is, where it can be found, etc… As well, I updated the bare minimum to include ‘wildmenu’ – an absolute must!

Well, it took quite a while but I’ve finally made the Novice Tutorial Prequel – Welcome to Vim. For most of you this won’t be very informative but I really felt that these Novice videos needed a true introduction, and this is it :)

I’ve been trying to put together the next Vim video most of the day. It’s actually going to be the prequel video that introduces Vim. To do it, I’ve dusted off my copy of BoinxTV that I got from the last Macheist and, while a very cool app, it’s causing me some issues that I’m trying to get worked out with the Boinx guys. Hopefully it will be solved soon so that I can get back to publishing these things. I’ve had a very busy month that made it very difficult to do anything but work, travel and take care of my adorable little two year old :). I got to clean up strawberry juice out of the carpet today and of course, the poop – oh the poop…

So this video will attempt to truly introduce Vim and give a springboard to the novice videos. Once that’s in the can I’ll move on to continue where we left off by describing how to install plugins and work with file types. We need to start looking at Vim’s extensibility through plugins and so I need to lay some foundation for that.