hardscrabble 🍫

By Max Jacobson

Psst. Check out my RubyConf 2017 talk, There are no rules in Ruby.

blog posts

Ambiguous use of user-defined command

18 Jan 2015

I wish Vim plugin authors would stop exposing commands that start with E. Is that a reasonable thing to feel? I do feel it.

I use netrw to browse files in vim, and I enter netrw by writing :E. I do this all the time. :E is short for :Explore. I could type :Ex, :Exp, :Expl, :Explo, :Explor as well, but I type :E. This is what my fingers remember.

Sometimes I install a plugin, and that plugin exposes another command which starts with :E, and suddenly I get this vim error message:

Ambiguous use of user-defined command

What! I’m the user, and I didn’t even define these commands! I just installed a plugin. This is bull! Recently I installed a plugin which, very sensibly, exposes a command called :Errors. Except, like, now I can’t type :E because that’s ambiguous, I could just as easily mean either of those commands, so vim does neither. Now I need to type :Ex to disambiguate. I could cry.

So anyway, I was about to uninstall the plugin, but then I realized I can just edit my local copy of it and comment out the line that exposes the :Errors command, which I didn’t particularly want to use anyway, and now I’m kind of happy. I would prefer if I could un-register the command in my .vimrc (is it possible? I couldn’t find how in my few minutes of searching), because this solution is kind of fragile; next time I install the plugin on some other computer, it won’t include my fix.

Edit April 2015: I’ve sort of solved this problem by no longer typing :E, and instead adding this line to my vimrc:

nmap <silent> <Leader>e :Explore<CR>

Which lets me type ,e to jump right to netrw (, is my Leader character. By default, the Leader character is \.)`

unpairing bluetooth devices is annoying

18 Jan 2015

I don’t use that many bluetooth products. Bluetooth kind of confuses me, to be honest.

Five months ago I bought this:

a red speaker

It’s the AmazonBasics Ultra-Portable Mini Bluetooth Speaker - Red. It’s like one of those cool Jawbone speakers but cheaper and probably not as good.

I love it. I use it to listen to podcasts in the shower or while doing dishes. It’s louder than my phone’s speakers and lets me keep my phone away from water. It’s perfect.

The other bluetooth product I use regularly is the Apple Magic Trackpad, which I also love (I love swiping around to do things). Sometimes, though, I find myself wanting to unpair the trackpad with one computer so I can pair it with a different one and this is so unnecessarily hard.

Before I can use the trackpad with the second computer, I need to open the Bluetooth preferences in system preferences, find the device, and tell the computer to forget about this device (so dramatic!) before it will show up as pairable to the other computer. Honestly this isn’t that hard, but it takes a few seconds, and I almost always forget to do it before I’ve already put away or turned off the first computer.

Amazon’s cheap little speakers do it so much better. See that middle button? If you hold it down for a few seconds, it unpairs from whatever, and becomes available to whatever. That’s great! Because what if it was paired to something and you left that something at home? I could be wrong, but with most Bluetooth devices I think you just wouldn’t be able to use it.

Having this extra button feels to me like a correct design, with the responsibilities where they belong.