Using Swipes in MacVIM in OS X

The awesome folks working on MacVIM have a convenient way for hooking into the OS X swipes for performing VIM actions. All you need to do is map the and inputs to a vim action!

The following chunk of VIM commands are copied from my personal .vimrc file. I've wrapped everything specific to configuring MacVIM inside of a conditional statement. The reason for this is my config file is shared across different environments, and trying to map the swipe actions in a linux terminal isn't going to make a lot of sense.

if has("gui_macvim")
    set transparency=15            " Makes the background window 85% opaque
    set guifont=Monaco:h10         " Monaco 10 is my favorite font
    set noantialias                " Especially when it isn't aliased
    map  :bprev                    " Swipe left opens a previous hidden buffer
    map  :bnext                    " Swipe right opens the next hidden buffer

You'll see that I've got the swipes setup to use the bprev and bnext commands. These are provided by the buftabs plugin. You can, of course, map these to any other VIM command you would like to use.

Tags: #ide #macos #vim
Thomas Hunter II Avatar

Thomas is the author of Advanced Microservices and is a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.