Emacs: Use Alias for Fast M-x

In emacs, you can use alias to shorten commands. For example, make frequently used commands just 1 or 2 letters.

Examples of useful alias:

( defalias ' yes-or-no-p ' y-or-n-p ) ( defalias 'list-buffers 'ibuffer)

( defalias 'qrr 'query-replace-regexp) ( defalias 'lml 'list-matching-lines) ( defalias 'dml 'delete-matching-lines) ( defalias 'dnml 'delete-non-matching-lines) ( defalias 'dtw ' delete-trailing-whitespace ) ( defalias 'sl ' sort-lines ) ( defalias 'rr 'reverse-region) ( defalias 'rs 'replace-string) ( defalias 'g 'grep) ( defalias 'gf 'grep-find) ( defalias 'fd 'find-dired) ( defalias 'rb ' revert-buffer ) ( defalias 'sh 'shell) ( defalias 'fb 'flyspell-buffer) ( defalias 'sbc 'set-background-color) ( defalias 'rof 'recentf-open-files) ( defalias 'lcd 'list-colors-display) ( defalias 'cc 'calc) ( defalias 'eb ' eval-buffer ) ( defalias 'er ' eval-region ) ( defalias 'ed 'eval-defun) ( defalias 'eis 'elisp-index-search) ( defalias 'lf ' load-file ) ( defalias 'hm 'html-mode) ( defalias 'tm ' text-mode ) ( defalias 'elm 'emacs-lisp-mode) ( defalias 'om 'org-mode) ( defalias 'ssm 'shell-script-mode) ( defalias 'wsm 'whitespace-mode) ( defalias 'gwsm 'global-whitespace-mode) ( defalias 'vlm 'visual-line-mode) ( defalias 'ln 'global-display-line-numbers-mode) ( defalias 'xhm 'xah-html-mode) ( defalias 'xcm 'xah-css-mode) ( defalias 'xem 'xah-elisp-mode) ( defalias 'xjm 'xah-js-mode)

Save the above in file and name it my-alias.el , then put it in your ~/.emacs.d/ directory. Then, in your emacs init file, add:

( load "my-alias" )

Note: a keybinding is still faster than M-x alias. However, alias is great for commands that you don't really use that frequently, but maybe once a day.