Skip to content

amittendulkar/emacs-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ivy Mode

Refer to the below Ivy mode info to effectively find and execute commands in Emacs

OperationCommand
Search textswiper
Execute commandcounsel-M-x
Find filecounsel-find-file
Describe functioncounsel-describe-function
Describe variablecounsel-describe-variable
Find librarycounsel-find-library
Info lookup symbolcounsel-info-lookup-symbol

Navigation

C-n, C-p, M-<, M->, C-v, M-v

KeyOperation
RETAccept current candidate
C-M-jAccept current input instead of current candidate
C-’Faster machnism to select candidate than C-n and C-p
C-M-mSelect candidate but keep minibuffer open for further input. C-M-p/n is faster.

Minibuffer altering

KeyOperation
M-n/pNext/previous history element
M-jInsert word at point
S-SPCNarrowing
C-rSearch commands history

Info

OperationKey
Search in current manuals
Use isearch to searchC-s or C-M-s
Search across all manualsM-x info-apropos
Navigate down/upSPC/DEL
Navigate back through historyl
Visit nodem title

Operations

This section points to various files for carrying out various operations in Emacs

OperationPackage
SVNdsvn
StackExchange website activitySx
Web browsingw3m
Email, NewsGnus

Emacs cheatsheet

Movement

Left/right, up/down chars: C-f/b, C-p/nLeft/right words: M-f/bPage up/down: C-v/M-v
Move point to line on screen: C-u NUM M-rMove focus to line: C-u NUM C-lScroll up/down: C-u NUM C-v/M-v
Begin/End line: C-a/eBegin/end sentence: M-a/eBegin/end buffer: M-</>
Move to line: M-g g NUMMove to column: M-g TAB NUMMove to mark: C-u C-SPC
Set mark: C-SPC C-SPC (push to ring)Store position: C-x r SPC RVisit position: C-x r j R
Find/replace: M-% SRC RET DEST RETFind word under point: C-s C-w... C-sFind ahead/behind: C-s/C-r (M-p/n srch hist)
Match braces: C-M-f/bRepeat find in same/reverse: C-s/r/DELEnter newline: C-q C-j
Move to top/bottom line: C-u 0/-1 M-r

Editing

Delete char/word: C-d/M-dDelete char/word before: DEL/M-DELUndo/Redo: C-/
Join line with previous: M-^Indent/outdent: TABComment/uncomment: M-;
Transpose chars/words: C-t/M-tTranspose lines: C-x C-t
Cut/Copy region: C-w/M-wKill/copy rect: C-x r k/M-wDelete/Yank rect: C-x r d/y
Newline after point/with spaces: C-o/C-M-oOne space around point: M-SPCUpper/lower/Capitalize: M-u/l/c
Toggle show/hide block: C-c @ cKill line/sentence: C-k/M-kYank/Cycle through: C-y/M-y
Copy/paste region from R : C-x r s/i RSelect all: C-x hMark word/para: M-@/h
Arrange para: M-qRemove blank lines: M-x flush-lines ^\s-*$Kill till CHAR: M-z CHAR

File/Buffer/Window

Open/save/save as: C-x C-f/C-s/C-wSwitch/list buffers: C-x b/C-bKill buffer: C-x k
Close all but current: C-x 1Split hori/vert: C-x 2/3Scroll other wnd text: M-PGUP/PGDN
Cur wnd tall/wide/narrow: C-x ^/}/{Window number: M-NUM/, NUMScroll bottom wnd text: C-M-v

Dired

Open in dired mode: C-x d DIRMove/Copy/Sort by name/date: R/C/sMark/unmark/zip-unzip files: m/u/z
Edit dired buffer: C-x C-q (C-c C-c if done)Remove ^M: M-x shell-strip_ctrl-mHide details: ( / dired-hide-details-mode

Macro

Start/stop macro: C-x (/)Run macro: C-u NUM C-x eSave NUM in register: C-u 10 C-x r n R
Increment R: C-x r \+ RM-x name-last-kbd-macro nameM-x insert-kbd-macro insert named macro

Shell

Emacs interpret/not: C-c C-j/C-kRename buffer: M-x rename-bufferCommand history/next/prev: M-r/C-s/C-r
Remote sudo: /ssh:u1@h1 PIPE sudo:h1:FILEShell: M-x ansi-term
Prev/next command: M-p/M-nEdit as sudo: C-x C-f /sudo::FILEOn remote: /ssh:user@host:FILE

Version Control

Next action commit (log buffer): C-x v vIn log buffer will commit file: C-c C-cShow diff: C-x v =
Vc dired mode (only changed files): C-x v dMark/unmark files/dir: m/u (same st: M/U)Visit file/dir in same/diff window: f/o
Next/previous dir entry: TAB/S-TABNext/previous entry: n/pQuit: q
Search/Query replace fileset: S/QRevert file: C-x v uShow revision history: C-x v l
RevHist- move to next/prev entry: n/pSame as before except next/prev file: N/PGet latest revision: C-u C-x v v
Switch to branch: C-x v r BR-NAME/C-u C-x v vHide up-to-date files: x
(e.g. ^/ProdName/branches/ProdBranch)Get latest: +

Help

Active key bindings - C-h bInfo search index: C-h i d m emacs i STRInfo search text: C-h i d m emacs s STR
Help for func/cmd - C-h f/cList functions with STR - C-h a STR

Regexps

Match single: .Match zero/one or more: */+Match zero or one: ?Match non-greedy: *?/+?/??
Match N times: \{N\}Match M to N times: \{M,N\}Match char set/range: [a-z0-9]Match except range: [^a-z]
Match begin/end: ^a/a$Match A or B: A\PIPEBGrouping construct: \(STR\)Backreference: \NUM
Word boundary: \b/\</\>Match whitespace: \s-Replace: replace-regexpReplace: string-replace
Ask before repl: query-*

About

Notes related to using Emacs editor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published