; make 'ibuffer' replace 'buffer-menu' as the default buffer listing command (defalias 'list-buffers 'ibuffer)
metakey, which is Alt on PC keyboards
press key2 while maintaining key1 down
** (emacs:3920): WARNING **: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
export NO_AT_BRIDGE=1
If, for any reason ((non-)?(login|interactive) shell), you prefer not to alter ~/.bashrc, you can apply changes to /etc/bash.bashrc
| To replace ... | with ... | query-replace-regexp ... | with ... |
|---|---|---|---|
"dd/mm/yyyy" |
"yyyy/mm/dd" |
"\([0-9]\{2\}\)/\([0-9]\{2\}\)/\([0-9]\{4\}\)" |
"\3/\2/\1" |
| newlines in a paragraph of text | auto-wrapped lines of text | \([a-zA-Z0-9\.,]\)CTRL-q-j |
\1SPACE |
| consecutive space characters | a single space character | + (a space character followed by a + sign) |
(a single space character) |
<span class="code"></span> |
<code></code> |
<span class="code">\([^<]*\)</span> |
<code>\1</code> |
\(expression\), and to backreference it : \n (n being the number of the captured expression) (more)[NEWLINE] character in an interactive RegExp search, just hit CTRL-q-j[TAB] character in an interactive RegExp search, just hit CTRL-q TAB[0-9]+ to match numbers), the square brackets [ and ] must not be escaped.hold CTRL down, press a then b, release CTRL
press CTRL then a, release both, then press b
| CTRL | ALT | CTRL-x | ESC | other | |
|---|---|---|---|---|---|
| a | goto beginning of line | goto beginning of paragraph | |||
| b | Backward 1 word |
|
|||
| c |
+ c : send mail + / : close current HTML tag |
change to uppercase the letter under the point and go forward one word | exit Emacs | ||
| d | Delete current character (= DEL) | Delete word forward from point (kill-word) | |||
| e | goto End of line | goto End of paragraph | |||
| f | Forward 1 word | open File | |||
| g | quit almost anything | + g n : Goto line number n | |||
| h |
+ b : list existing key bindings + c : describe key briefly + e : display startup error messages |
select whole buffer (mark-whole-buffer) | CTRL-h F : show the FAQ | ||
| i | indent point up to the next tab stop (source) | ||||
| j | make new line with same indentation (newline-and-indent) | ||||
| k | Kill text from point to end of line | Kill current buffer | F1-k-key : describe key | ||
| l | centers the point vertically | starting from the point, change to lowercase the letters of the current word, then go forward 1 word | Display the total number of Lines of the current buffer, lines before cursor and lines after. | CTRL-x-l : turn region lowercase (downcase-region) | |
| m | Move (forward or back) to the first nonblank character on the current line (back-to-indentation) | create a new Mail | |||
| o | change the selected window | query-replace-regexp | occur : return lines matching RegExp See also keep-lines and flush-lines |
||
| q | CTRL-q TAB : indent point up to the next tab stop (ALT-i is easier) | ||||
| r | Reverse incremental search (i-search) | CTRL-ALT-r : Reverse incremental regular expression search (isearch-backward-regexp) Regexp help | |||
| s | forward incremental Search (i-search) | Save current buffer |
|
||
| u | starting from the point, change to uppercase the letters of the current word, then go forward 1 word | +u : undo | CTRL-x-u : turn region uppercase (upcase-region) | ||
| v | page up | page down | +v : reload buffer from disk (revert-buffer) | ||
| w | cut selection | copy selection | Save current buffer as ... | ||
| x |
|
+ show-paren-mode highlight matching parenthesis + shell: open a shell session in an Emacs buffer + blackbox + doctor: talk to the psycho + dunnet : RPG (solution) + gomoku : Puissance 5 + hanoi + life : the Game of Life + mpuz : multiplication puzzle + tetris |
exchanges the point and the mark | + ispell-buffer : checks spelling (details) |
To convert line endings :
|
| y | paste | ||||
| z | repeat the previous command | ||||
| SPACE | set mark (use arrows to make selection) | ||||
| BACKSPACE | Delete word backward from point (backward-kill-word) | ||||
| _ | undo (Win), baskspace (Linux) (???) | ||||
| { | decrease width of the current window | ||||
| } | increase width of the current window | ||||
| % | Search and query replace. ! replace all remaining matches |
||||
| ^ | Make current window higher. (enlarge-window). CTRL-x ^ SPC to avoid inserting a ^, CTRL-x z to repeat. |
||||
| < | Go to 1st character of buffer | ||||
| > | Go to last character of buffer | ||||
| + | Make all windows the same height (balance-windows) | ||||
| / | word completion (made as "best-effort", based on words found in the current buffer) | ||||
| \ | delete all spaces surrounding the point | CTRL-ALT-\ (defunct ?) : indent all lines beginning in the region (indent-region) | |||
| 0 | unsplit current buffer | ||||
| 1 | completely unsplit display | ||||
| 2 | split current buffer display horizontally (1 on top / 1 on bottom) | ||||
| 3 | split current buffer display vertically (1 left / 1 right) | ||||
| ← / → | |||||
| CTRL | ALT | CTRL-x | ESC | other |
| Command | Usage | Shortcut / alias | Details |
|---|---|---|---|
| column-number-mode | Show the column number | ||
| compare-windows | Compare the text in the current window with that in the next window | ||
| delete-matching-lines | Delete lines matching RegExp | ||
| delete-non-matching-lines | Delete lines not matching RegExp | ||
| delete-trailing-whitespace | Delete trailing whitespaces ([space] or [TAB]) in the whole buffer |
run it automatically when saving | |
| downcase-region | turn the region lowercase | C-x-l | Case Conversion in Lisp |
| erc | Start the Emacs IRC Client | ||
| eww | Start the Emacs Web Wowser | web browser for GNU Emacs | |
| flush-lines | Delete lines matching RegExp | delete-matching-lines | |
| hexl-find-file | View and edit a file in hexadecimal | ||
| highlight-lines-matching-regexp | Highlight lines matching RegExp | hi-lock-line-face-buffer | |
| how-many | Count lines matching RegExp | count-matches | |
| ibuffer | list existing buffers (in an extra buffer ) and perform actions such as save / delete / ... on one or more buffers at once | C-x-b | |
| keep-lines | Delete lines not matching RegExp | delete-non-matching-lines | |
| list-colors-display | Display Emacs colors names | ||
| list-matching-lines | List lines matching RegExp | ||
| menu-bar-mode | Toggle display of the menu bar : File | Edit | Options | ... | ||
| occur | Count lines matching RegExp | list-matching-lines | |
| reverse-region | reverse order of selected lines | ||
| sort-lines | Sort lines alphabetically | M-x so-l |
|
| sort-numeric-fields | Sort lines numerically | ||
| toggle-word-wrap | Long lines are wrapped at white space, instead of cutting words in the middle at the edge of window | ||
| tool-bar-mode | Toggle display of the tool bar (icons) | ||
| upcase-region | turn the region uppercase | C-x-u | see downcase-region |
| whitespace-mode | Toggle display of spaces and tabs | M-x whit-m |
| OS | version | custom options file |
|---|---|---|
| Debianoids | GNU Emacs 22.2.1 | ~/.emacs |
| GNU/Linux | Emacs 21.3.1 | ~/.gnu-emacs-custom |
| Windows 7 | GNU Emacs 24.3.1 | ~/AppData/Roaming/.emacs |
| Windows | GNU Emacs 23.3.1 | ~/Application Data/.emacs |
| Windows | XEmacs 21.5 | ~/.xemacs/custom.el |
(set-frame-font "mononoki-11" nil t)
(set-frame-font "Consolas-11" t t)
(set-face-foreground 'minibuffer-prompt "moccasin") line to the custom configuration file.
;PHP SYNTAX HIGHLIGHTING
;source : http://www.emacswiki.org/emacs-en/EnablingFontLock
(if (fboundp 'global-font-lock-mode)
(global-font-lock-mode 1) ; GNU Emacs
(setq font-lock-auto-fontify t)) ; XEmacs
; source : http://thedrupalblog.com/enabling-php-mode-and-syntax-highlighting-emacs
(require 'php-mode)
(setq auto-mode-alist
(append '(("\\.php$" . php-mode)
("\\.module$" . php-mode))
auto-mode-alist));REVERSE VIDEO MODE ; source : http://a-nickels-worth.blogspot.com/2007/11/effective-emacs.html (set-background-color "black") (set-face-background 'default "black") (set-face-background 'region "black") (set-face-foreground 'default "white") (set-face-foreground 'region "gray60") (set-foreground-color "white") (set-cursor-color "red")
(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
Open the configuration file and append (global-set-key "key_sequence" 'command) into it.
Example : (global-set-key "\M-o" 'query-replace-regexp)
| Special key | Characters |
|---|---|
| ALT | \M ("meta", sometimes bound to ESC) |
| CTRL | \C |
| DEL | \d |
| ESC | \e |
| RET | \r |
| TAB | \t |
; PYTHON HOOK (add-hook 'python-mode-hook '(lambda () (setq-default indent-tabs-mode nil) ; no difference "setq default" or "setq-default" (global-set-key (kbd "TAB") 'tab-to-tab-stop) (setq tab-stop-list (number-sequence 4 120 4)) ; start stop increment. Source : http://www.emacswiki.org/emacs/TabStopList ) )
; SHOW CURRENT FILE NAME WITH FULL PATH IN WINDOW TITLE
; source : http://emacs-fu.blogspot.fr/2011/01/setting-frame-title.html
(setq-default
frame-title-format
(list '(buffer-file-name "EMACS : %f" (dired-directory
(revert-buffer-function " %b"
("%b – Dir: " default-directory)
)))
)
)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
; Hide the "File | Edit | Options | ..." bar (menu-bar-mode 0) ; Hide the icons bar (tool-bar-mode 0)