Skip to content

Instantly share code, notes, and snippets.

@kowey
Last active December 27, 2015 07:39
Show Gist options
  • Save kowey/7290212 to your computer and use it in GitHub Desktop.
Save kowey/7290212 to your computer and use it in GitHub Desktop.
  1. create ~/.vim/plugin/kowey-bufmenu.vim by copying/patching your system vim/runtime/menu.vim
  2. edit your ~/.vimrc (not .gvimrc!), and insert let no_buffer_menu=1 BEFORE any set syntax directives (apparently they trigger the menu)
--- /Applications/MacVim.app/Contents/Resources/vim/runtime/menu.vim 2011-09-18 15:00:37.000000000 +0100
+++ /Users/kowey/.vim/plugin/kowey-bufmenu.vim 2013-11-03 13:34:03.000000000 +0000
@@ -13,8 +13,8 @@
set cpo&vim
" Avoid installing the menus twice
-if !exists("did_install_default_menus")
-let did_install_default_menus = 1
+if !exists("did_install_kowey_menus")
+let did_install_kowey_menus = 1
if (exists("v:lang") || &langmenu != "")
@@ -640,7 +640,7 @@
unlet s:n
unlet s:idx
-if !exists("no_buffers_menu")
+if !exists("no_kowey_buffers_menu")
" Buffer list menu -- Setup functions & actions
@@ -827,9 +827,10 @@
let name = fnamemodify(name, ':p:~')
endif
" detach file name and separate it out:
+ let dname = fnamemodify(fnamemodify(name, ':h'), ':t')
let name2 = fnamemodify(name, ':t')
if a:bnum >= 0
- let name2 = name2 . ' (' . a:bnum . ')'
+ let name2 = dname . '/' . name2 . ' (' . a:bnum . ')'
endif
let name = name2 . "\t" . <SID>BMTruncName(fnamemodify(name,':h'))
let name = escape(name, "\\. \t|")
@@ -1115,7 +1116,7 @@
endif
-endif " !exists("did_install_default_menus")
+endif " !exists("did_install_kowey_menus")
" Define these items always, so that syntax can be switched on when it wasn't.
" But skip them when the Syntax menu was disabled by the user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment