;;; ravi-init-navigation.el --- navigation utilities ;; Copyright (C) 2013 ;; Author: ;; Keywords: ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; Buffer navigation utilities ;;; Code: (use-package ace-jump-mode :bind ("M-h" . ace-jump-mode) :ensure t ) (use-package imenu-anywhere :bind ("s-." . imenu-anywhere) :ensure t ) (use-package expand-region :bind ("C-=" . er/expand-region) :ensure t ) (use-package multiple-cursors :bind (("C-S-c C-S-c" . mc/edit-lines) ("C->" . mc/mark-next-like-this) ("C-<" . mc/mark-previous-like-this) ("C-c C-<" . mc/mark-all-like-this)) :init (setq mc/list-file (ravi/emacs-file "past/mc-lists.el")) ) (bind-key "" 'ff-find-other-file) (setq compilation-scroll-output 'first-error) (use-package smartparens :commands (smartparens-mode show-smartparens-mode) :init (show-smartparens-global-mode 1) :config (require 'smartparens-config) :ensure t ) ;; Marking and moving lines (bind-key "M-j" (lambda () (interactive) (join-line -1)) ) (use-package move-lines :bind (("" . move-lines-down) ("" . move-lines-up) ) ) ;; grep and friends (use-package wgrep :ensure t ) (let ((ad-redefinition-action 'accept)) (use-package color-moccur :commands (isearch-moccur isearch-all) :bind ("M-s O" . moccur) :init (progn (bind-key "M-o" 'isearch-moccur isearch-mode-map) (bind-key "M-O" 'isearch-moccur-all isearch-mode-map)) :config (use-package moccur-edit) :ensure t ) ) ;; Search the web (use-package webjump :bind ("C-x g" . webjump) :config (progn ;; Suggest word at point if possible (defun webjump-read-string (prompt) (let* ((prompt (concat prompt (if (word-at-point) (concat " (default: " (word-at-point) ")")) ": ")) (input (read-string prompt))) (if (webjump-null-or-blank-string-p input) (word-at-point) input))) ;; C++ reference (add-to-list 'webjump-sites '("cpp" . [simple-query "en.cppreference.com" "http://en.cppreference.com/mwiki/index.php?title=Special:Search&search=" ""])) ) ) ;; to do: add zeal-at-point (provide 'ravi-init-navigation) ;;; ravi-init-navigation.el ends here