Skip to content

Latest commit

 

History

History
243 lines (232 loc) · 5.97 KB

tutorial.org

File metadata and controls

243 lines (232 loc) · 5.97 KB

EMACS CONFIGURATION TUTORIAL

Windows (Buffers):

<f6>

make/unmake window sticky

<f5>

maximize current window

<control>+<kp-2/4/6/8>

switch splitted windows

<meta>+<pause>

delete window

<pause>

kill buffer

Programming:

<meta>+x scratch

open scratch buffer for the current buffer mode

<meta> + <enter>

automaticly complete code snippet

<ctrl>+c d f

doxygen comments to function

<ctrl>+c d i

doxygen comments to file

<meta>+3

comment/uncomment region

<meta>+4

comment box

<meta>+i

aligns text in aligned columns

<ctrl>+x t

adjust the indent offset and tab/space configuration to much the current buffer

<meta>+x kernel-coding-style

switch on/off kernel coding style for linux kernel programming (makes tab indentations and 8 chars tab width)

<super>+1

launch zeal the offline api finder

<ctrl>+O

start syntax checking of file

Syntax Highlighting:

<ctrl>+<shift>+b

highlight lines with more than 80 characters

<meta>+x “highline-mode”

highlights current line

<meta>+x “hl-spotlight-mode”

spotlight on current line

<meta>+x “htmlfontify-buffer”

create html rpresentation of the buffer

isearch and then <meta>+h

highlight regexp

isearch and then <meta>+l

highlight line

f7

highlight symbol at point

<ctrl>+f7

clear all highlighted symbols

<meta>+x “rainbow-mode”

highlight colors

Navigation

<meta>+up/down

window up/down

<meta>+left/right

rotate windows

<ctrl>+<meta>+o

switch c/c++ header/source files

<shift>+<f9>

search all open buffers with files association

<ctrl>+;

switch to buffer

<ctrl>+]

switch to file

<ctrl>+’

switch to symbol

ebrowse

browse c++ classes

<meta>+o in dired mode

omit files

k in dired-mode

hides selected files

<control>+x <control>+j

jump to dired mode and put cursor on the current file

<meta>+enter in dired mode

run less on file in terminal window (usefull to view large files)

<meta>+x rename-buffer

change the name of buffer

<meta>+x rename-frame

change the name of frame

<meta>+x elscreen-start

Allows switching between screens (desktops) use <meta>+z ? to view screen comands use <meta>+]/[ to navigate

<meta>+`

navigate files

<control>+`

minimap

<tab>

hide/show code block

<shift>+<tab>

hide/show all code block

<control>/<shift>+<plus>/<minus>

hide/show all/single #ifdef statement in c

<control>x f

find file at point

<control>x F

Edit remote file at point (inside comint-mode buffer)

<control>x a

open app at point

meta + .

find symbol from TAGS file

meta + >

pop back after symbol find using meta + .

control + f

find file in project use:

  • e for elisp files
  • p for python files
  • c for c/c++ file

meta + 2

select region by expanding it more and more with each key press

Editing:

<ctrl>+w

backward kill word

<ctrl>+enter

Text rectangles editing

<meta>+insert

Search kill ring

<meta>+delete

show kill ring

<ctrl>+o during search

shows all occurs of the word in the current windows

<ctrl>+left/right during search

search backward/forward

In artist mode <ctrl>+p/<ctrl>+l

select drawing mode and settings using ido complete

<ctrl>+x 6 2/1

edit/merge 2 columns

<ctrl>+%

interactive replacement

<meta>+x align

aligns lines to the same column structure

<ctrl>+c d

insert date

<meta>+kp-8/2

swap line up or down

create .dir-locals.el or use add-dir-local-variable

to save dir specific configuration

<meta>+w

enable shift of words/lines/regions using meta+up/down/right/left

<meta>+e

Expand region increases the selected region by semantic units

<meta>+j

join lines (append current line to the line before it)

select text and then ctr+d

multiple cursor like in sublime

meta+o or met+O

open line before/after

Debugging:

keypad-2

step

keypad-6

next

keypad-5

break

keypad-8

continue

<meta>+x “gdb-many-windows”

build debugging environment windows

control+u control+alt+x

edebug instrument function control+alt+x - clean instrumented function

more tips:

you should use http://www.randyrants.com/sharpkeys utility to map caps lock to <ctrl> key on windows

Windows:

<meta>+wheel up/down

zoom in/out

<control>+wheel up/down

text increase/decrease

Emacs

<ctr>+q

like meta+x but with ido completion

Macros:

<meta>+<f12>

apply last keyboard macro to region

<ctrl>+x =

evaluate mathematical expression in selected region

Info

<meta>+=

prints the number of lines and characters in the region

Misc

<meta>+x describe-face

Publishing

org-mode

<control>+c <control>+t

change task state

<f4>

deft mode for editing notes

Shell

<meta>+x “ssh-authorize”

add your public key to authorized_keys on the logged in machine should be run in shell buffer

<ctrl>+=

run ssh and connect to host. Switch to ibuffer select several ssh’s then press <ctrl>+= to control them in clustered way

Packages

<meta>+x el-get-install

Upgrade some of the modules with the latest source version

SourceControl

meta+m

start magit to view git repository

meta+M

start git-mode to view git repository

meta+x cscope-update-indexer

add extra files suffixes to the cscope-indexer which is used by cscope

meta+x ctags-build

build ctags for current directory

Encryption

just edit filename.gpg instead of filename and it will be encrypted

Configuration

meta+x create-dir-locals

creates .dir-locals.el and sets configuration recursively to all files and subdirectories

Dot-files

Write different config files through shell mode

meta+x dot-gdb-crack

meta+x dot-gdb-common

meta+x dot-dircolors

meta+x dot-gitconfig

Tricks

insert prefix in rectangle

C-x r t string-rectangle

save mark where search started

C-s … then C-x

Performance

monitor load time

meta+x esup