sponsor Vim development Vim logo Vim Book Ad

TwitVim : Twitter client for Vim

 script karma  Rating 552/259, Downloaded by 7998    Comments, bugs, improvements  Vim wiki

created by
Po Shan Cheah
 
script type
utility
 
description
===========================================================
Note: Twitter will phase out Basic authentication on August 16, 2010. At that time, TwitVim versions earlier than 0.5.0, which do not support OAuth, will gradually encounter lower rate limits until they stop working completely on August 31. Please upgrade prior to that date. However, TwitVim 0.4.x will continue to work with identi.ca, which will still support Basic authentication.

TwitVim OAuth support requires a Vim binary compiled with either Perl or Python. See :help TwitVim-install for more details.
===========================================================

TwitVim is a Vim plugin that allows you to post to Twitter and view Twitter timelines. It is an enhancement of vimscript #2124 by Travis Jeffery. Credit goes to Travis for the original script concept and implementation.

TwitVim supports most of the features of a typical Twitter client, including:
- Friends, User, Direct Message, and Mentions timelines
- Twitter Search
- Replies and retweets
- Hashtags (jump to search timeline)
- In reply to (See which tweet an @-reply is for.)
- Opening links in a browser
- User profile display
- Twitter Lists
- URL shortening and expansion

TwitVim uses cURL to communicate with Twitter. Alternatively, you can configure TwitVim to use Vim's Perl, Python, Ruby, or Tcl interfaces for faster network I/O.

Usage:

:PosttoTwitter - This command will prompt you for a message to send to Twitter.
:CPosttoTwitter - This command posts the current line in the current buffer to Twitter.
:BPosttoTwitter - This command posts the current buffer to Twitter.

Alt-T - In Visual select mode, the Alt-T key posts the selected text to Twitter.
  (use Ctrl-T instead if menu bar is enabled)
NOTE: The T mapping was changed to Alt-T to avoid overriding the T search command.

Alt-R - Starts a @-reply. (from timeline buffer)
Alt-D - Starts a direct message. (from timeline buffer)

:FriendsTwitter - View friends timeline.
:UserTwitter - View your timeline.
:RepliesTwitter - View @-replies.
:PublicTwitter - View public timeline.
:DMTwitter - View direct messages.

:Tweetburner - Shorten a URL with Tweetburner and insert at cursor.
:ATweetburner - Same as above but insert after cursor.
:PTweetburner - Same as above but start tweet on cmdline with short URL.

And similar commands for TinyURL, SnipURL, Metamark, bit.ly, is.gd, urlBorg, tr.im, Cligs, and zi.ma.

:SearchTwitter - Use Twitter Search.

Many more commands and mappings are available. See TwitVim's help documentation for full details.

Contact me on Twitter at http://twitter.com/mortonfox
Get TwitVim announcements at http://twitter.com/twitvim
 
install details
===========================================================
For newer versions that are packaged as Vimball archives, open the vba file and then source it.

    vim twitvim.vba
    :source %

Then see :help TwitVim-install for further instructions.
===========================================================

The instructions below are for older non-vba versions:

First, you need to install cURL if it isn't already installed. Download cURL from here: http://curl.haxx.se/

Next, add the script to your Vim plugins directory. The location is platform-dependent. See :help add-plugin for details.

Next, add the following to your .vimrc or _vimrc:

      let twitvim_login = "USER:PASS"

Replace USER and PASS with your Twitter username and password.

If you access the web through a HTTP proxy, add the following line:

      let twitvim_proxy = "proxyhost:proxyport"

Replace proxyhost and proxyport with your HTTP proxy address and port number.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
twitvim-0.7.3.vmb 0.7.3 2012-01-25 7.0 Po Shan Cheah * Switched to JSON API for Twitter Search so that TwitVim can support t.co URL expansion and in-reply-to in search results.
* Made the URL-matching pattern more accurate.
twitvim-0.7.2.vmb 0.7.2 2011-11-16 7.0 Po Shan Cheah * Allow users to use their own consumer key and secret. See twitvim_consumer_key and twitvim_consumer_secret.
* Added t.co URL expansion for media URLs too.
* Added confirmation prompt before new-style retweet.
* Added a fix for :TrendTwitter and :SetTrendLocationTwitter because Twitter removed support for XML format in those APIs.
* Read token file before first invocation of :SwitchLoginTwitter to ensure it has the list of logins ready. (@mattn_jp)
twitvim-0.7.1.vmb 0.7.1 2011-09-21 7.0 Po Shan Cheah * Added trending topics. :TrendTwitter and :SetTrendLocationTwitter
* Some fixes for browser-launching issues.
* Fix for quoting issue when doing goo.gl URL shortening with cURL network interface under Windows.
* Support for HTML hex entities.
* Show 'follow request sent' in user profile display if that is the case.
twitvim-0.7.0.vba 0.7.0 2011-07-06 7.0 Po Shan Cheah * Faster XML parser.
* Replaced deprecated Twitter API calls with updated versions.
* OAuth multi-login feature. Added :SwitchLoginTwitter command.
twitvim-0.6.3.vba 0.6.3 2011-05-13 7.0 Po Shan Cheah Auto-expand t.co URLs in timeline displays.
Added timeline filtering.
twitvim-0.6.2.vba 0.6.2 2011-04-01 7.0 Po Shan Cheah * Added more user relationship info to :ProfileTwitter.
* Added :EnableRetweetsTwitter and :DisableRetweetsTwitter.
* Switch to new (documented) goo.gl API.
* Added :ListInfoTwitter.
twitvim-0.6.1.vba 0.6.1 2011-01-06 7.0 Po Shan Cheah * Fix for buffer stack bug if user closes a window manually.
* Use https OAuth endpoints if user has set up https API root.
* Match a URL even if prefix is in mixed case.
twitvim-0.6.0.vba 0.6.0 2010-10-27 7.0 Po Shan Cheah * Added :FollowingTwitter, :FollowersTwitter.
* Added :MembersOfListTwitter, :SubsOfListTwitter, :OwnedListsTwitter, :MemberListsTwitter, :SubsListsTwitter, :FollowListTwitter, :UnfollowListTwitter.
* Added support for goo.gl :Googl and Rga.la. :Rgala
* Extended TwitVim-Leader-g to support Name: lines in user profile and following/followers lists.
* Added history stack for info buffer.
* Added :BackInfoTwitter, :ForwardInfoTwitter, :RefreshInfoTwitter, :NextInfoTwitter, :PreviousInfoTwitter for the info buffer. Also added support for TwitVim-C-PageDown and TwitVim-C-PageUp in info buffer.
* Added twitvim filetype for user customization via autocommands.
* Changed display of retweets to show the full version instead of the truncated version when the retweeted status is near the character limit.
* :ProfileTwitter with no argument now shows info on logged-in user.
* Made TwitVim-Leader-@ work on new-style retweets by showing the retweeted status as the parent.
twitvim-0.5.6.vba 0.5.6 2010-09-26 7.0 Po Shan Cheah * Exception handling for Python net interface.
* Added converter functions for non-UTF8 encoding by @mattn_jp.
* Convert entities in profile name, bio, and location. (Suggested by code933k)
* Fix for posting foreign chars when encoding is not UTF8 and net method is not Curl.
* Support twitvim_count in :DMTwitter and :DMSentTwitter.
* Added :FavTwitter and mappings to favorite and unfavorite tweets.
twitvim-0.5.5.vba 0.5.5 2010-08-23 7.0 Po Shan Cheah Added a way to compute HMAC-SHA1 digests using openssl command line utility.
twitvim-0.5.4.vba 0.5.4 2010-08-14 7.0 Po Shan Cheah * Added Ruby and Tcl versions of HMAC-SHA1 digest code.
* Improved error messages for cURL users.
* Code fix to keep 'nomodifiable' setting from leaking out into other buffers.
* Support Twitter SSL via Tcl interface.
twitvim-0.5.3.vba 0.5.3 2010-07-03 7.0 Po Shan Cheah * Improved error messages for most commands if using Perl, Python, Ruby, or Tcl interfaces.
* Added :FollowTwitter, :UnfollowTwitter, :BlockTwitter, :UnblockTwitter, :ReportSpamTwitter, :AddToListTwitter, :RemoveFromListTwitter.

twitvim-0.5.2.vba 0.5.2 2010-06-22 7.0 Po Shan Cheah More fixes for Twitter OAuth.
twitvim-0.5.1.vba 0.5.1 2010-06-19 7.0 Po Shan Cheah * Shorten auth URL with is.gd/Bitly if we need to ask the user to visit it manually.
* Fixed the :PublicTwitter invalid request error.
* Include new-style retweets in user timeline.
twitvim-0.5.0.vba 0.5.0 2010-06-17 7.0 Po Shan Cheah Switched to OAuth for user authentication on Twitter.
Added more information to :ProfileTwitter output.
twitvim-0.4.7.vba 0.4.7 2010-03-13 7.0 Po Shan Cheah * Added :MentionsTwitter as an alias for :RepliesTwitter.
* Support twitvim_count in :MentionsTwitter.
* Fixed twitvim_count bug in :ListTwitter.
* Fixed Ruby interface problem with Vim patch 7.2.374.
* Fixed :BackTwitter behavior when timeline window is hidden by user.
* Handle SocketError exception in Ruby code.
twitvim-0.4.6.vba 0.4.6 2010-02-14 7.0 Po Shan Cheah Added twitvim_show_header config to allow user to hide the timeline header.
Minor fix to normal commands to avoid inadvertently triggering user mappings.
twitvim-0.4.5.vba 0.4.5 2009-12-31 7.0 Po Shan Cheah Prompt user for Twitter login if not configured in vimrc. Reintroduced old-style retweets via user option.
twitvim-0.4.4.vba 0.4.4 2009-12-17 7.0 Po Shan Cheah Added some support for Retweet API.
Fixed :BackTwitter behavior with lists.
Upgraded bit.ly API support to version 2.0.1.
Added support for Zi.ma URL shortener.
twitvim-0.4.3.vba 0.4.3 2009-11-27 7.0 Po Shan Cheah * Added |:ListTwitter|
* Fixed some minor breakage in LongURL support.
* Omit author's name from the list when doing a reply to all.
twitvim-0.4.2.vba 0.4.2 2009-07-10 7.0 Po Shan Cheah * Bugfix: Reset syntax items in Twitter window.
* Bugfix: Show progress message before querying for in-reply-to tweet.
* Added reply to all feature.
twitvim-0.4.1.vba 0.4.1 2009-03-30 7.0 Po Shan Cheah Fixed a problem with usernames and search terms that begin with digits.
twitvim-0.4.0.vba 0.4.0 2009-03-09 7.0 Po Shan Cheah Many changes. See release notes at http://mortonfox.livejournal.com/654033.html
twitvim-0.3.5.vba 0.3.5 2009-02-04 7.0 Po Shan Cheah * Added support for pagination and page length to :SearchTwitter.
* Shortened default retweet prefix to "RT".
twitvim-0.3.4.vba 0.3.4 2008-11-14 7.0 Po Shan Cheah Added twitvim_count option to allow user to configure the number of tweets returned by :FriendsTwitter and :UserTwitter.
twitvim-0.3.3.vba 0.3.3 2008-10-09 7.0 Po Shan Cheah * Added support for Cligs. |:Cligs|
* Fixed a problem with not being able to unset the proxy if using Tcl http.
twitvim-0.3.2.vba 0.3.2 2008-10-01 7.0 Po Shan Cheah * Added command to display rate limit info.
* Improved error reporting for :UserTwitter.
* Added command and mapping to display user profile information.
* Added command for updating location.
* Added support for tr.im.
* Error reporting fix for Tcl http code.
twitvim-0.3.1.vba 0.3.1 2008-09-22 7.0 Po Shan Cheah * Added support for http networking through the Vim Perl, Python, Ruby, and Tcl interfaces, as alternatives to cURL. See :help TwitVim-non-cURL for setup details.
* Removed UrlTea support.
* Added support for posting Unicode tweets.
* Added support for LongURL.
* Remove newlines from tweets before retweeting.

twitvim-0.2.24.vba 0.2.24 2008-08-29 7.0 Po Shan Cheah Added retweet feature.
twitvim-0.2.23.vba 0.2.23 2008-08-26 7.0 Po Shan Cheah * Support in_reply_to_status_id parameter.
* Added tip on line length in statusline.
* Report browser launch errors.
* Set syntax highlighting on every timeline refresh.
twitvim-0.2.22.vba 0.2.22 2008-08-13 7.0 Po Shan Cheah Rewrote date/time formatting code in pure Vim script so it should now work on almost any Vim installation without requiring if_perl or if_python.
twitvim-0.2.21.vba 0.2.21 2008-08-12 7.0 Po Shan Cheah * Added tips section to documentation.
* Use create_or_reuse instead of create in UrlBorg API so that it will always generate the same short URL for the same long URL.
* Added support for highlighting #hashtags and jumping to Twitter Searches for #hashtags.
* Added Python code to convert Twitter timestamps to local time and simplify them.
twitvim-0.2.20.vba 0.2.20 2008-07-24 7.0 Po Shan Cheah Switched from Summize to Twitter Search.
twitvim-0.2.19.vba 0.2.19 2008-07-23 7.0 Po Shan Cheah Added support for non-Twitter servers implementing the Twitter API. This is for identi.ca support.
twitvim-0.2.18.vba 0.2.18 2008-07-14 7.0 Po Shan Cheah Added support for urlBorg API.
twitvim-0.2.17.vba 0.2.17 2008-07-11 7.0 Po Shan Cheah * Added command to show DM Sent Timeline.
* Added support for pagination in Friends, User, Replies, DM, and DM Sent timelines.
* Added support for bit.ly API and is.gd API.
twitvim-0.2.16a.vba 0.2.16a 2008-05-15 7.0 Po Shan Cheah Escape ! character in browser launch URL.
twitvim-0.2.16.vba 0.2.16 2008-05-15 7.0 Po Shan Cheah Removed quotes around browser launch URL. There was a problem with TwitPic.
twitvim-0.2.15.vba 0.2.15 2008-05-13 7.0 Po Shan Cheah * Extend :UserTwitter and :FriendsTwitter to show another user's timeline if argument supplied.
* Extend Alt-G mapping to jump to another user's timeline if invoked over @user or user:
* Escape special Vim shell characters in URL when launching web browser.
twitvim-0.2.14.vba 0.2.14 2008-05-12 7.0 Po Shan Cheah Added support for Summize search API.
twitvim-0.2.13.vba 0.2.13 2008-05-07 7.0 Po Shan Cheah Added mappings to launch web browser on URLs in timeline.
twitvim-0.2.12.vba 0.2.12 2008-05-05 7.0 Po Shan Cheah Allow user to specify Twitter login info and proxy login info preencoded in base64.
twitvim-0.2.11.vba 0.2.11 2008-05-02 7.0 Po Shan Cheah * Scroll to top in timeline window after adding an update line.
* Add <Leader>r and <Leader>d mappings as alternative to Alt-R and Alt-D.
twitvim-0.2.10.vba 0.2.10 2008-04-25 7.0 Po Shan Cheah * Shortened snipurl.com to snipr.com
* Added support for proxy authentication.
* Handle Perl module load failure. Not that I expect those modules to ever be missing.
twitvim-0.2.9.vba 0.2.9 2008-04-22 7.0 Po Shan Cheah * Added some status messages.
* Added menu items under Plugin menu.
* Allow Ctrl-T as an alternative to Alt-T to avoid conflict with the menu bar.
* Added support for UrlTea API.
* Generalize URL encoding to all non-alpha chars.
twitvim-0.2.8.vba 0.2.8 2008-04-22 7.0 Po Shan Cheah * Encode URLs sent to URL-shortening services.
twitvim-0.2.7.vba 0.2.7 2008-04-21 7.0 Po Shan Cheah * Add support for TinyURL API.
* Add quick direct message feature.
twitvim-0.2.6.vba 0.2.6 2008-04-15 7.0 Po Shan Cheah * Delete Twitter buffer to the blackhole register to avoid stepping on registers unnecessarily.
* Quote login and proxy arguments before sending to cURL.
* Added support for SnipURL API and Metamark API.
twitvim-0.2.5.vba 0.2.5 2008-04-14 7.0 Po Shan Cheah * Escape the "+" character in sent tweets.
* Added Perl code to convert Twitter timestamps to local time and simplify them.
* Fix for timestamp highlight when the "|" character appears in a tweet.
twitvim-0.2.4.vba 0.2.4 2008-04-13 7.0 Po Shan Cheah * Use <q-args> in Tweetburner commands.
* Improve XML parsing so that order of elements does not matter.
* Changed T mapping to Alt-T to avoid overriding the |T| command.
twitvim-0.2.3.vba 0.2.3 2008-04-11 7.0 Po Shan Cheah Added more Tweetburner commands.
twitvim-0.2.2.vba 0.2.2 2008-04-10 7.0 Po Shan Cheah * Added quick reply feature.
   * Added Tweetburner support.
   * Changed client ident to "from twitvim".
twitvim-0.2.1.vba 0.2.1 2008-04-10 7.0 Po Shan Cheah Bug fix for Chinese characters in timeline.
Scroll up to newest tweet after refreshing timeline.
Changed Twitter window name to avoid unsafe special characters and clashes with file names.
twitvim-0.2.0.vba 0.2.0 2008-04-09 7.0 Po Shan Cheah Added views for public, friends, user timelines, replies, and direct messages. Automatically insert user's posts into public, friends, or user timeline, if visible. Added syntax highlighting for timeline view.
twitvim.vba 0.1.2 2008-04-03 7.0 Po Shan Cheah Added help documentation. Made plugin code conform to guidelines in :help write-plugin. Repackaged as Vimball archive.
twitvim.vim 0.1.1 2008-04-01 7.0 Po Shan Cheah Report errors from or problems with cURL.
twitvim.vim 0.1 2008-03-28 7.0 Po Shan Cheah Initial version.

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo