Summary: Kill startup-echo-area-message dead.
< * To remove start-up messages, put ##(setq inhibit-splash-screen t)## and (setq inhibit-startup-echo-area-message "YOUR-USER-NAME") in your init-file.
> * To remove start-up messages, put ##(setq inhibit-splash-screen t)## and (setq inhibit-startup-echo-area-message "YOUR-USER-NAME") in your init-file. Or just add
> (eval-after-load "startup" '(fset 'display-startup-echo-area-message (lambda ())))
> to get rid of it everywhere.
Some programmers are enormously productive using Emacs. Their hands seem to quickly run over the keyboard accomplishing things in minutes that it takes others hours to accomplish. They must know many Emacs tricks which allow them to work rapidly. If asked, they are hesitant to show their tricks. Understandably so, it would probably take many hours for them to show me all their tricks.
This web page describes all their little tricks for using Emacs effectively.
Some were mentioned on the EmacsChannel.
Nifty tricks for Dired are on their own page: DiredPower.
delete-trailing-whitespacein Emacs 21 and later. For those of us using earlier versions, use the PictureModeTrailingWhitespaceTrick.
c-x r N.
C-x r i, you may use a prefix argument to jump to the end of the inserted text, but if you forget you can use
C-a TABto jump to identation point. Also consider switching C-a and M-m, since most of the time you want back-to-indentation.
‘reindent-then-newline-and-indent’command. For example if you have long line and you want move part of it to new line, just move point to the place where splist must be done and do
M-x reindent-then-newline-and-indent RET. Also consider
(global-set-key (kbd "RET") 'reindent-then-newline-and-indent).
C-x C-n (`set-goal-column')when doing vertical editing.
‘C-w’adds the word following point to the search buffer. Very useful.
‘C-y’adds the rest of the current line to the search buffer. Sometimes useful.
C-yin Isearch has been bound to
‘isearch-yank-kill’since GNU Emacs 24.1. – XueFuqiao
‘isearch’as a navigation mechanism. Consider modifying Isearch’s behavior by using IsearchOtherEnd.
‘enable-recursive-minibuffers’non-nil, then you can bring up a complex search and replace that you’ve just done (either because it didn’t work and you want to tweak it and try again, or because you want to another similar one) in the MiniBuffer using the history mechanism, and use search and replace to edit the original search and replace. For example, if you’ve just replaced “
aabbcc” with “
zzbbyy” and now want to replace “
aaddcc” with “
zzddyy”, you can bring up the original search, and use replace-string to change the “
bb” strings to “
dd” in both pattern and replacement.
‘C-h m’during a search) has some good tips: Use
‘M-e’to edit the search string,
‘M-r’to toggle regular-expression mode,
‘M-c’to toggle case-sensitivity, `
M-%’ to start
‘query-replace’. There are lots of other useful bindings described there.
‘M-mouse-1’on the word, then
‘M-mouse-2’to insert. Very easy. With library second-sel.el, you can do more: swap primary and secondary, use a ring of secondary selections,…
‘C-x r s R’and
‘C-x r g R’(think: register-set/register-get). This works slightly different in XEmacs. From the info page (XEmacs)RegText?: “’
‘C-x r s R’stores a copy of the text of the region into the register named R.
‘C-x r i R’inserts the text from the register
‘R’in the buffer.” At least this is true for XEmacs 21.4.x.
ido.el, but with more: complete regexp matching of virtually any minibuffer input (files, buffers, commands…). Cycle completion candidates; perform actions on candidates, manipulate sets of candidates…
(recentf-mode 1)to your DotEmacs. Use Icicles to get a
‘find-file’, completion+cycling interface to your recent files.
‘C-x r j e’to open DotEmacs,
‘C-x r j i’to open an
(set-register ?e '(file . "~/.emacs")) (set-register ?i '(file . "~/org/ideas.org"))
‘M-x customize-group backup’, turn on
‘prepend-file-name’. – DanielLundin
‘tiny-buffer’is the best buffer switching.
‘tinyeat’is great as well – AaronBrady
‘ffap-alist’to tell Emacs where to find them. – PiotrMieszkowski
‘M-x auto-image-file-mode’– view images rather than high ASCII
‘C-u 1 M-x set-selective-display’to show only headings, `
M-x <up> RET’ to disable it again.
C-x$’ by default. You can make it a lot friendlier with a wrapper: – DaleWiles?
(global-set-key "\C-x$" 'set-selective-display-dlw) (defun set-selective-display-dlw (&optional level) "Fold text indented more than the cursor. If level is set, set the indent level to level. 0 displays the entire buffer." (interactive "P") (set-selective-display (or level (current-column))))
‘highlight-changes-mode’– Sometimes Emacs asks me if I want to save my changes in a buffer, and I don’t know what I’ve changed. This won’t tell you after the fact, but it will highlight changes made if it’s on during the editing process. This is part of GnuEmacs- anybody know if this is available for XEmacs? and where to get it?
‘M-x ee-buffers’brings up a list of buffers. You can jump between views by encoding, DiredMode style, by directory, by project, etc. It’s awesome!
C-u M-!’ inserts the result of the
‘shell-command’directly into the buffer, quite handy for stuff like
C-u M-|’ replaces the current region with the output of a shell command which gets the region passed as input. Use `
C-x h C-u M-| md5sum RET’ to apply the
‘md5sum’command to the current buffer
C-x r m <somekey>’ adds a bookmark, `
C-x r b <somekey>’ visits that bookmark, and
‘C-x r l’lists bookmarks. See
bookmark.eland bookmark+.el. – DanielLundin
‘M-x enable-flow-control RET’– Use when some nasty terminal (NCSA telnet for Macintosh, for instance) won’t let you use
‘save-buffers-kill-emacs’without process-killing query. I bet this is a FAQ. – rubikitch
(defadvice save-buffers-kill-emacs (around no-query-kill-emacs activate) "Prevent annoying \"Active processes exist\" query when you quit Emacs." (flet ((process-list ())) ad-do-it))
‘M-x linum-mode’or put
(global-linum-mode 1)in your init-file; see LineNumbers. b) To get them on your modeline, try
(line-number-mode 1)in your
;; quiet, please! No dinging! (setq visible-bell nil) (setq ring-bell-function `(lambda () (set-face-background 'default "DodgerBlue") (set-face-background 'default "black")))
(menu-bar-mode -1)permanently hide them. See ActiveMenu for for another less persistent solution for menu bar. To get rid of title bar given by OS, run Emacs in full screen by commandline option -fs or --fullscreen. See the page FullScreen for more details and, for example, Windows specific methods.
(setq inhibit-splash-screen t)and (setq inhibit-startup-echo-area-message “YOUR-USER-NAME”) in your init-file. Or just add
(eval-after-load "startup" '(fset 'display-startup-echo-area-message (lambda ())))
to get rid of it everywhere.
‘M-x transient-mark-mode’in GnuEmacs (and
‘zmacs-region’in XEmacs) to make it highlight the active region (and lots of other nifty stuff too!)
Emacs*Xlw''''''Menu*fontSet: -*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-* Emacs*Xlw''''''Menu*foreground: black Emacs*Xlw''''''Menu*shadowThickness: 1
‘t’and stop worrying about whether you are at the end of the file when you do
‘C-n’. (Why is there no
‘M-x describe-face’– The faces applied to the text are listed as the default value for completion. If you use Icicles, then
‘describe-face’shows the face-name candidates in buffer
‘*Completions*’using their own faces —WYSIWYG. (Screenshot)
M-: (face-at-point)’ (Emacs 23+)
mouse-drag.el– scroll the buffer by dragging it. For XEmacs you can use TrackScroll
(strokes-mode 1)– use mouse gestures as key events
‘M-x mouse-avoidance-mode RET’
(setq echo-keystrokes 0.1)– See what you are typing.
‘M-x webjump’– Jump directly to predefined websites using
(setq hcz-set-cursor-color-color "") (setq hcz-set-cursor-color-buffer "") (defun hcz-set-cursor-color-according-to-mode () "change cursor color according to some minor modes." ;; set-cursor-color is somewhat costly, so we only call it when needed: (let ((color (if buffer-read-only "black" (if overwrite-mode "red" "blue")))) (unless (and (string= color hcz-set-cursor-color-color) (string= (buffer-name) hcz-set-cursor-color-buffer)) (set-cursor-color (setq hcz-set-cursor-color-color color)) (setq hcz-set-cursor-color-buffer (buffer-name))))) (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode)
‘message-mode’when you’re not in Gnus or if you want your mail archived by Gnus – just use
(setq mail-user-agent 'message-user-agent) (setq mail-user-agent 'gnus-user-agent)
See also GnusNiftyTricks
(c-subword-mode 1)in your mode setup: makes some movement and text commands recognize case-change as a word boundary.
(define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2")– XueFuqiao
‘M-/’auto-completes a word. Good for long variable names. If it doesn’t guess what you’re typing right the first time, keep pressing it until it completes correctly. Once you’ve used this for awhile, you’ll probably want to rebind it to the HippieExpand
(eval-after-load "dabbrev" '(defalias 'dabbrev-expand 'hippie-expand))
(global-set-key [(shift end)] '(lambda () (interactive) (other-window -1)))
‘semantic-hippie-expand’), Eldoc (now for any
‘bovine-mode’), Speedbar (lots of function details),
classname.funcname’ in modeline), and a few other tools. Wish every language-specific mode supported SemanticBovinator
‘M-x flyspell-prog-mode RET’–
‘flyspell’for comments and strings.
‘query-replace-regexp’– see ReplaceRegexp.
M-|’ to feed bits of text to perl or ruby one-liners or scripts. `
C-u M-|’ to replace the text.
‘M-x sort-lines’. Follow
‘M-x uniquify-buffer’defined at uniquify – it removes all but one line in every sequence of repeated lines in the buffer. Or get the same effect with `
C-x h M-| uniq RET’, but not all systems have
M-gwas made a prefix by RMS in 2005.
goto-linehas been bound to
M-g M-g. – XueFuqiao
‘M-/’. Emacs searches through all the buffers for the completion. – ttn
‘grep’. I could have used the
‘mysql’client directly but the LXR database doesn’t accept remote clients (for security reasons.) – LinhDang
desktop.el’, and `
‘wikiput-buffer’to edit wiki pages with Emacs bindings. See RyanDavis.
‘other-window’, note keybinding workaround http://www.nongnu.org/emacs-tiny-tools/keybindings/index-body.html#case_study_why_cant_i_assign_key_esc_c
‘list-matching-lines’: Show all occurrences of a regex in another window, and jump around in the buffer by selecting them. – DC
desktop.el– Allows for multiple named desktops that you can switch in/out of really easy. – DC
‘tabify’– JonAquino? But do not use this with unknown (bad written) code because it will also replace inside string literals! One reason why there should not be literal tabs inside strings - use \t
‘untabify’acts only on the region, so that is typically not a problem. The better guideline is to not use it on a region that contains TABs other than as insignificant whitespace. IOW, it is not a proble of badly written code but of knowing what the code is/does before you act on it. – DrewAdams
‘M-x phases-of-moon’– Awoooo!
‘lunar-phases’instead. – XueFuqiao
‘ESC ESC ESC’– Go back to just one window (by deleting all but the selected window).
(fset 'yes-or-no-p 'y-or-n-p)– Make all “
yes or no” prompts show “
y or n” instead. See YesOrNoP.
‘C-x 5 2’is that it also doesn’t screw up your window layout on your desktop. – LathI