diff --git a/contrapunctus/cp-nav.el b/contrapunctus/cp-nav.el new file mode 100644 index 0000000..58e246e --- /dev/null +++ b/contrapunctus/cp-nav.el @@ -0,0 +1,72 @@ +;;;; Hacks for better navigation + +;; Vim-style prompt-less tag jumping +;; http://stackoverflow.com/questions/12074897/automatically-jump-to-tag-in-emacs +(global-unset-key (kbd "M-t")) +(defun find-tag-no-prompt-other-window () + "Jump to the tag at point in the other window without prompting." + (interactive) + (find-tag-other-window (find-tag-default))) +(defun find-tag-no-prompt () + "Jump to the tag at point without prompting." + (interactive) + (find-tag (find-tag-default))) +(global-set-key (kbd "M-t M-t") 'find-tag-no-prompt-other-window) +(global-set-key (kbd "M-t M-g") 'find-tag-no-prompt) +(global-set-key (kbd "M-t M-p") 'pop-tag-mark) +(global-set-key (kbd "M-t M-f") 'find-tag) +(global-set-key (kbd "M-t M-s") 'tags-search) +(global-set-key (kbd "M-t M-c") 'tags-loop-continue) + +(require 'view) +(global-set-key (kbd "C-v") 'View-scroll-half-page-forward) +(global-set-key (kbd "M-v") 'View-scroll-half-page-backward) +;; (global-set-key (kbd "M-v") 'scroll-down) +;; (global-set-key (kbd "C-v") 'scroll-up) + +;;;; Need to make maps for +;;;; mark-* commands (-sexp, -page, -word, etc) +;;;; mark ring + +;;;; Other custom keys +(global-set-key (kbd "C-x C-1") 'delete-other-windows) +(global-set-key (kbd "C-x C-2") 'split-window-below) +(global-set-key (kbd "C-x C-3") 'split-window-right) +(global-set-key (kbd "C-x C-0") 'delete-window) +(global-set-key (kbd "C-x C-4 C-f") 'find-file-other-window) +;(global-set-key (kbd "C-`") 'point-to-register) +;(global-set-key (kbd "C-'") 'jump-to-register) +(global-set-key (kbd "C-x C-d") 'dired-jump) +(require 'dired) +(define-key dired-mode-map (kbd "b") 'dired-up-directory) +(add-hook 'dired-mode-hook 'visual-line-mode) +;(global-set-key (kbd "C-,") 'string-rectangle 'TAB) +(global-unset-key (kbd "C-x d")) + +;; (require 'dired-toggle-sudo) +;; (define-key dired-mode-map (kbd "C-c C-s") 'dired-toggle-sudo) +;; (eval-after-load 'tramp +;; '(progn +;; ;; Allow to use: /sudo:user@host:/path/to/file +;; (add-to-list 'tramp-default-proxies-alist +;; '(".*" "\\`.+\\'" "/ssh:%h:")))) +(global-set-key (kbd "C-x df") 'delete-frame) +;;;; make-frame key is after Helm's config + +;(setq compilation-read-command nil) +(defun contrapunctus-open-init () + "Open the init.el file." + (interactive) + (find-file "~/.emacs.d/init.el")) +;; todo - store current file name → kill the buffer → +;; find-file-literally with the stored filename. also, find out if you +;; can open it without modes but with the proper encoding. +(defun contrapunctus-fcf-literally () + "Find the current file literally. Like find-file-literally but + does not prompt for a file name." + (interactive) + (find-file-literally (buffer-file-name))) +(defun contrapunctus-kill-buffer () + "Kill the current buffer without prompting." + (interactive) + (kill-buffer nil)) diff --git a/init.el b/init.el index 3f1f239..206b18e 100644 --- a/init.el +++ b/init.el @@ -110,79 +110,9 @@ (load "cp-editing") +(load "cp-nav") -;;;; Vim-style prompt-less tag jumping -;;;; http://stackoverflow.com/questions/12074897/automatically-jump-to-tag-in-emacs -(global-unset-key (kbd "M-t")) -(defun find-tag-no-prompt-other-window () - "Jump to the tag at point in the other window without prompting." - (interactive) - (find-tag-other-window (find-tag-default))) -(defun find-tag-no-prompt () - "Jump to the tag at point without prompting." - (interactive) - (find-tag (find-tag-default))) -(global-set-key (kbd "M-t M-t") 'find-tag-no-prompt-other-window) -(global-set-key (kbd "M-t M-g") 'find-tag-no-prompt) -(global-set-key (kbd "M-t M-p") 'pop-tag-mark) -(global-set-key (kbd "M-t M-f") 'find-tag) -(global-set-key (kbd "M-t M-s") 'tags-search) -(global-set-key (kbd "M-t M-c") 'tags-loop-continue) - -(require 'view) -(global-set-key (kbd "C-v") 'View-scroll-half-page-forward) -(global-set-key (kbd "M-v") 'View-scroll-half-page-backward) -;; (global-set-key (kbd "M-v") 'scroll-down) -;; (global-set-key (kbd "C-v") 'scroll-up) - -;;;; Need to make maps for -;;;; mark-* commands (-sexp, -page, -word, etc) -;;;; mark ring - -;;;; Other custom keys -(global-set-key (kbd "C-x C-1") 'delete-other-windows) -(global-set-key (kbd "C-x C-2") 'split-window-below) -(global-set-key (kbd "C-x C-3") 'split-window-right) -(global-set-key (kbd "C-x C-0") 'delete-window) -(global-set-key (kbd "C-x C-4 C-f") 'find-file-other-window) -;(global-set-key (kbd "C-`") 'point-to-register) -;(global-set-key (kbd "C-'") 'jump-to-register) -(global-set-key (kbd "C-x C-d") 'dired-jump) -(require 'dired) -(define-key dired-mode-map (kbd "b") 'dired-up-directory) -(add-hook 'dired-mode-hook 'visual-line-mode) -;(global-set-key (kbd "C-,") 'string-rectangle 'TAB) -(global-unset-key (kbd "C-x d")) - -;; (require 'dired-toggle-sudo) -;; (define-key dired-mode-map (kbd "C-c C-s") 'dired-toggle-sudo) -;; (eval-after-load 'tramp -;; '(progn -;; ;; Allow to use: /sudo:user@host:/path/to/file -;; (add-to-list 'tramp-default-proxies-alist -;; '(".*" "\\`.+\\'" "/ssh:%h:")))) -(global-set-key (kbd "C-x df") 'delete-frame) -;;;; make-frame key is after Helm's config - -;(setq compilation-read-command nil) -(defun contrapunctus-open-init () - "Open the init.el file." - (interactive) - (find-file "~/.emacs.d/init.el")) -;; todo - store current file name → kill the buffer → -;; find-file-literally with the stored filename. also, find out if you -;; can open it without modes but with the proper encoding. -(defun contrapunctus-fcf-literally () - "Find the current file literally. Like find-file-literally but - does not prompt for a file name." - (interactive) - (find-file-literally (buffer-file-name))) -(defun contrapunctus-kill-buffer () - "Kill the current buffer without prompting." - (interactive) - (kill-buffer nil)) - (global-set-key (kbd "M-") 'compile) (global-set-key (kbd " p") 'grep) (global-set-key (kbd " o") 'find-grep)