Skip to content

elyscape/vim-winjumplist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

winjumplist.vim

Windows 7 introduced a feature called Jump Lists, which offer easy access to recently-used files. Unfortunately, Vim doesn't support it. Well, winjumplist.vim is here to save the day.

Vim's Jump List with items in it

How it works

Windows populates the recent items in an application's Jump List from the entries it has added to the Recent Documents list in the Start menu. Files are added to the Recent Documents list when either of two things happen:

  1. The user double-clicks on a file in Explorer.
  2. The application calls SHAddToRecentDocs().

While Vim doesn't call SHAddToRecentDocs(), if you've associated any extensions with Vim, you may notice that files you've opened from Explorer have been added to Vim's Jump List. winjumplist.vim calls SHAddToRecentDocs() when Vim opens files so that you can get the full benefit of having Jump Lists.

Installation

If you don't have a plugin manager, I highly recommend getting one.

  • Pathogen
    • git clone https://github.com/elyscape/vim-winjumplist.git ~/vimfiles/bundle/vim-winjumplist
  • NeoBundle
    • NeoBundle 'elyscape/vim-winjumplist'
  • Vundle
    • Plugin 'elyscape/vim-winjumplist'
  • Manual install
    • copy the files into your ~/vimfiles directory

Customization

You can tell winjumplist.vim to ignore certain files by setting g:winjumplist_excludes to be an array of regular expressions that match file paths you don't want added to Vim's Jump List. It defaults to ['\v\\doc\\[^\\]+\.txt$'], which should match any Vim help files.

Requirements and caveats

  • Obviously, this only does anything on Windows.
  • Your copy of Vim must have been compiled with the libcall feature for winjumplist.vim to do anything. Most standard Windows distributions of Vim, including the official binary, include libcall.
  • Files without extensions are not added to the Recent Documents list. This is a limitation of Windows itself and therefore not something I can fix.
  • winjumplist.vim does not work with the console version of Vim and will silently refuse to load.

Things to be aware of

Since SHAddToRecentDocs() is a Windows API function, calling it requires the use of a compiled DLL. For your convenience, I have provided precompiled DLLs for both 32-bit and 64-bit versions of Vim. If you don't trust me and want to build it yourself, I've included everything you need to do so. Just fire up Visual Studio and do a release build on the included solution. If you don't have a copy of Visual Studio, Visual Studio Community is available for free.