I am experimenting with Gnu Global to navigate a Java project in emacs with the ggtags package. I find it fast and slick, but I hit a bump in the road when I found that it remaps M-< and M-> — the default bindings to jump to the top and bottom of a buffer — when there are multiple matches for a tag. I find this intolerable. Don’t whack useful key bindings. </rant>
Luckily, this is emacs and I can customize everything. I think this is the first time I have deleted key bindings, so I figured I’d document it. A quick search found a post on Emacs Redux which includes how to remove emacs key bindings. In short, set the mode map entry for the key binding you want to remove to nil. Here is what I added:
;; ggtags: don't whack my useful key bindings! (eval-after-load 'ggtags '(progn (define-key ggtags-navigation-map (kbd "M-<") nil) (define-key ggtags-navigation-map (kbd "M->") nil)))
Leave a Reply