For the last couple of years now, I have been making use of TwitVim to twitter from within vim. Seeing how much time I actually spend on twitter, it has been a good fit and enables me to help maintain focus without getting drowned out by the twitterverse. Plus I’m a vim freak, so the more I can use it for the better.
I often have to switch between posting/reading from multiple twitter accounts. In order to do this effectively, I came up with a quick hack to allow me to switch rapidly.
Under my [devtools] folder I have an automation folder that contains a bunch of automation scripts that I have accumulated over the years. Under there I have my vim folder, here is the screenshot:
Uploaded with Skitch!
As you can see, each of my OAuth tokens for the respective user accounts is stored in this folder. The twitvim script, is trivial ruby script to copy the appropriate token into the place where TwitVim looks for the token to do Twitter authentication:
1 2 3 4 5 6 7
Currently I can run this script passing in the account I want to switch to and startup vim and twitter using that account!!
What I want to be able to do is call this script from inside of Vim as so:
1 2 3 4 5 6
Only problem I am having is a bit of trouble with the last line of the function (shelling out with the command, I can’t seem to get the substitution working correctly). I am just blasting this down right now, so, if anyone knows it would be greatly appreciated. That is literally the first vim script method I have written!!
That small wrinkle aside. You can be inside vim issue the ResetLoginTwitter command and then manually shell out to the twitvim script passing the correct username and you can carry on twittering on the different account.
Hope this helps!!