روزنوشت های محمد فروغی

بیشتر مطالب مرتبط با لینوکس و هک (به معنای خوبش) و کار های گیکی
شاید هم قدری مطالب فلسفی ;)

emacs cheat sheet

فروغی محمد | 01 August, 2016 09:26

Master doc: http://www.gnu.org/software/emacs/tour/

exit: C-x C-c
rum emacs in terminal mode (no X): emacs -nw
quit from a command: C-g
gdb: M-x gdb
diff: M-x ediff
dir browsing: M-x dired
    switch to dir edit mode:  C-x C-q
news/rss/email: M-x gnus
tetris: M-x tetris
tutorial: C-h t
shell command: M-!
switch between widnows: C-x o
switch to previous buffer: C-x b

forward one word: M-f
back one word: M-b
previous sentence: M-a
next sentence: M-e
beginning of buffer: M-<
end of buffer: M->
jump to specific line: M-g g
search forward: C-s
search backward: C-r

mark: C-SPC
note: some command set mark for you automatically: yank, kill, search, ...
swap point and mark: C-x C-x
cycle through mark ring: C-u C-SPC

As you can see, Emacs tries to be helpful: many commands that have the potential to take you long distances set mark so that a simple C-x C-x takes you back to where you were.

start highlight: C-SPC
select all: C-x h
select current paragraph: M-h
copy higlighted section: ESC w
kill to end of line: C-k
kill to end of sentence: M-k
kill 10 lines: C-u 10 C-k
kill next word: M-d
kill to end of sentence: M-k
kill region ( "cut" ): C-w
note: there is a kill ring too, so it is so difficult to lose data ;)
save region to kill ring without deleting ( "copy" ): M-w
yank: C-y
replace yanked text with previously killed text: M-y

Narrow buffer to the current region: C-x n n
Restore ( "widen" ) buffer: C-x n w

Narrowing restricts the view (and editing) of a buffer to a certain region. Then commands like incremental search, or beginning-of-buffer or end-of-buffer don't lead you out of the region of interest, and commands like search and replacement don't affect the entire file.

Undo: there are 3 commands for undo:
C-/
C-_
C-x u

After any consecutive sequence of undos, Emacs makes all your previous actions undoable, including the undos. (This will happen whenever a sequence of undos is broken by any other command.)

If this sounds complicated, just remember that "undo" is always capable of getting you back to any previous state your buffer was in (unless Emacs has run out of memory to store the undo history). The principle here is that Emacs makes it very difficult to accidentally lose your work.

code autocompletion: M-/
code autodocumentation: M-;

نظرات

ارسال نظر
Info

توجه: از ارسال پيام هاي خصوصي در حالت لاگين براي نويسنده وبلاگ اجتناب نماييد.
در صورتی که در فرم ارسال نظر، نام شما توسط سیستم شناسایی شده باشد(در حالت لاگین) نظر شما بلافاصله منتشر خواهد شد.


در غیر اینصورت نظر شما پس از تایید توسط مالک وبلاگ منتشر خواهد شد.

 authimage
 
Accessible and Valid XHTML 1.0 Strict and CSS
Converted to use with ITS. Powered by FUMblog