diogo149 / babymacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

babymacs

a beginner setup for emacs that has some nice stuff built-in

installation

git clone https://github.com/diogo149/babymacs.git ~/.emacs.d

installing emacs for OS X

brew install --with-cocoa emacs
ln -s /usr/local/Cellar/emacs/24.5/Emacs.app /Applications

how to use

glossary

frame
a graphical system-level “window” (this is unfortantely quite confusing, since in emacs a window means something else)
window
a part of a frame which contains a buffer
buffer
contains the text to be editted - when you visit a file, the representation is stored in a buffer
kill
when talking about text, this means “cut”
yank
when talking about text, this means “paste”
  • keybindings
    C-
    control
    M-
    meta (alt)
    S-
    shift
    s-
    super (eg. OS X command key)
    • examples:
      C-M-<up>
      pressing control + alt + up at the same time
      C-x C-s
      pressing control + x then control + s
      C-x k
      pressing control + x then k (without control)

basics

C-gcancel command / partial command
M-xenter a command

general

keybindings

C-x kkill current buffer
C-wcut selected region / current line
M-wcopy selected region / current line
C-vhalf page down
M-vhalf page up
C-ssearch forward
C-rsearch backward
M-<up>move selected region / current line up
M-<down>move selected region / current line down
S-<backspace>delete all whitespace on cursor
C-=expand selected region
C-+increase text size
C–decrease text size
S-<arrow>move cursor to other window
C-/toggle comment/uncomment

when searching:

C-sfind next match
C-rfind previous match
RETend search

TODO

  • movement
  • editting
  • help
    • C-h C-m discover-my-major
  • buffer-move
  • move-text
  • winner-mode

commands

ibufferview open buffers and perform commands on them

prefix

  • NOTE: normally in emacs, pressing <escape> is also used for meta, but this config uses <escape> and <C-escape> as prefix keys for general commands and major-mode specific commands, respectively.
<escape> +balance the size of windows
<escape> 0delete current window
<escape> 1delete all windows except current
<escape> 2split window vertically
<escape> 3split window horizontally
<escape> 4split window into 4
<escape> <up>move up one logical (not visual) line
<escape> <down>move down one logical line
<escape> <left>move to start of logical line
<escape> <right>move to end of logical line
<escape> [begin recording macro
<escape> ]end recording macro
<escape> C-sswitch project
<escape> C-ffind file in project
<escape> mopen magit
<escape> dopen dired
<escape> sopen shell

python

  • make sure the environment (eg. virtualenv) you’re using has the following packages:
    • jedi
    • flake8
    • autopep8
<C-escape> wchoose virtualenv

multiple-cursors

RETexit multiple cursors
C-jadd newline
M-<mouse-1>add extra cursor
C->add cursor on next instance of highlighted region
C-<add cursor on previous instance of highlighted region
C-c C-<add cursor at all instances of highlighted region
C-S-c C-S-cadd cursor on each line in the highlighted region

dired

qkill buffer
^go up a directory
RETopen file
ropen file(s) with external app
Ccopy file(s)
Rrename/move file(s)
Ddelete file(s)
mmark file
grefresh

helm

TODO

magit

TODO

org

TODO

how to extend

  • TODOs
    • how to read elisp
    • keybindings
    • use-package
    • bind-key
    • examples

TODOs

  • general
    • trailing whitespace (ws-butler)
    • require-final-newline
  • prog-mode stuff
    • no word wrapping (truncate-lines-mode)
    • highlight-parentheses-mode
    • yasnippet
    • company
      • helm-company
    • smartparens
  • wgrep
  • dired-ranger
  • dired file size on z

About

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 96.3%Language:Python 3.5%Language:Shell 0.1%Language:Groff 0.1%Language:C 0.0%Language:HTML 0.0%