Emacs seems to have all the possible keyboard combinations already randomly distributed among it\'s commands. :p
If I am to define new keyboard shortcuts, where should I
This is mine.
Notice I remapped the movement keys. This was because I use the MS NS4K, which makes those particular key movements very easy.
;;;;;;;; remapping of keys ;;;;;;;;;;;;;;;
(global-set-key "\C-cg" 'goto-line)
;C-c u untabifies...yuck!
(global-set-key "\C-cu" 'untabify)
;Regex replace
(global-set-key "\C-x%" `query-replace-regexp)
;;Backward-kill-line is defined later on in this file.
(global-set-key "\M-k" `backward-kill-line)
(global-set-key "\C-x\C-j" 'eval-print-last-sexp)
;;M-up/down -> start/end of buffer. Yay!
(global-set-key (kbd "M-") 'beginning-of-buffer)
(global-set-key (kbd "M-") 'end-of-buffer)
(global-set-key (kbd "M-[") 'beginning-of-buffer)
(global-set-key (kbd "M-]") 'end-of-buffer)
;;remap movement keys to get rid of emacs pinky
;Jump back and forth by 5.
(global-set-key "\C-n" '(lambda () (interactive) (forward-line 5)))
(global-set-key "\C-p" '(lambda () (interactive) (forward-line -5)))
(global-set-key "\M-a" 'move-beginning-of-line)
(global-set-key "\M-e" 'move-end-of-line)
(global-set-key "\M-n" 'next-line)
(global-set-key "\M-p" 'previous-line)
;bookmark
(global-set-key (kbd "") 'bm-toggle)
(global-set-key (kbd "") 'bm-next)
(global-set-key (kbd "") 'bm-previous)
(setq bm-cycle-all-buffers t)
(global-set-key (kbd "") 'revert-buffer)
(global-set-key (kbd "") 'delete-trailing-whitespace)
(global-set-key (kbd "") 'comment-or-uncomment-region)
(global-set-key (kbd "M-RET") 'newline-and-indent)
(global-set-key "\C-m" 'newline-and-indent)
;;Jump "backwards"
(global-set-key "\C-xp" '(lambda () (interactive) (other-window -1)))
;;copy
(global-set-key "\M-y" 'yank)
;;insert line
(global-set-key "\M-o" '(lambda () (interactive) (open-line 1)))
;zap to char backwards
(global-set-key "\C-z" 'minimize)
;;suspend-emacs is the send-to-background command on linux
;simplify register usage
(global-set-key "\M-s" 'copy-to-register)
(global-set-key "\M-i" 'insert-register)
;;autocomplete hacks
(global-set-key [?\M-/] 'hippie-expand)
(global-set-key [?\C-/] 'dabbrev-expand)
(global-set-key [?\C-.] 'find-tag)
;(global-set-key "\C-.\C-s" 'find-tag)
(global-unset-key [?\M-.])
;;this lets us have long lines go off the side of the screen instead of hosing up the ascii art
(global-set-key "\C-t" 'toggle-truncate-lines)
;comment/uncomment region
(global-set-key "\C-c\C-c" 'comment-or-uncomment-region)
;;Buffer-move
(global-set-key (kbd "") 'buf-move-left)
(global-set-key (kbd "") 'buf-move-right)