kalyan
​
​
Table of Contents
─────────────────
​
1. Emacs guide.
.. 1. Some basic key notes.
.. 2. Config file
.. 3. Some key concepts
.. 4. Shells
.. 5. File browser
.. 6. Window management
.. 7. Help
.. 8. Evil mode
.. 9. Org mode
..... 1. Headings and formatting and paragraphs and lists
..... 2. Date and time
..... 3. Tables
..... 4. Timers
.. 10. Exporting
​
​
1 Emacs guide.
══════════════
​
1.1 Some basic key notes.
─────────────────────────
​
The key binds below should be enough for basic editing of files.
C-x means control plus x while M-x means Alt plus x.
M-x runs any command or function that can modify the present emacs buffer.
C-x C-c closes emacs.
C-x C-s saves the file.
C-x C-f opens a file specified for editing, creates new one if such a file doesn't exist.
C-b opens a buffer with buffer name, creates new one if such a buffer doesn't exist.
C-a, C-e for beggining and end of a line.
M-<, M-> for beggining and end of the buffer.
C-SPC to set a mark.
C-w to kill from mark to present point, M-w to copy instead.(killing means cutting, deleting means cut text is not available for pasting)
C-y to yank the killed or copied contents.(yank means to paste)
C-/ or C-x u to \*undo\*.
C-k to kill a line.
​
​
1.2 Config file
───────────────
​
It is located in either \~/.emacs or \~/.emacs.d/init.el
It can contain variables and functions which will be loaded at startup.
​
​
1.3 Some key concepts
─────────────────────
​
1. Buffer is not same as file, it will saved to file once closed. It
is an editing area in RAM, need not be associated with any file.
2. There are many buffers which are not stored to files like
calculator, tetris, diary,etc.
3. Scratch buffer is not saved gives a rough area to work on.
4. Windows are the split areas on the screen, they contain buffers.
5. A frame in Emacs is what we call usually a window. Closing the
frame will close all [buffers.You](https://buffers.You) can have multiple frames and
navigate between them.
​
​
1.4 Shells
──────────
​
• M-x eshell gives access to emacs shell which can run shell commands
and also lisp.
• term also launches a shell.
• ielp is the lisp REPL.
• M-& runs the shell command you enter in a separate buffer called
async.
• M-x runs any interactive function on the current buffer, for
eg. forward-char moves the cursor to the next letter. (It is bound
to ":" in evil).
• M-: runs any lisp code, it need not be an interactive function like
with M-x.
​
​
1.5 File browser
────────────────
​
• Dired is the builtin file browser accessed through C-x d.
• With this you can open, rename and delete files.
• Type a path after opening dired,
• f opens the file at the cursor
• g does ls on the directory at the cursor.
​
​
1.6 Window management
─────────────────────
​
• C-x 0 closes current window.
• C-x 1 closes all windows except the current one.
​
​
1.7 Help
────────
​
• C-h k opens help for a key combo you specify.
• Similarly f is for function, m is for mode.
• t opens tutorial,
• h opens manual, i opens all manuals (not just for emacs)
​
​
1.8 Evil mode
─────────────
​
• Enter and exit evil mode through C-z
• Run commands through ":", equivalent of M-x.
• You can use vim window and buffer movement keys like :bn, :bp, C-ww,
C-wq etc.
​
​
1.9 Org mode
────────────
​
Only the most basic and useful commands are listed below. Refer to
org manual for more
details. <[https://orgmode.org/manual/index.html#SEC\_Contents](https://orgmode.org/manual/index.html#SEC_Contents)\>
​
​
1.9.1 Headings and formatting and paragraphs and lists
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
​
Headings use \* instead of # used in markdown.
M-RET inserts a new heading below current one. (This applies to lists, sub-headings and all elements)
Formatting: \*bold\*, /italic/, \_underline\_.
\\\\ at the end of a line causes a linebreak.
Or else use, #+BEGIN\_VERSE and END\_VERSE to retain line breaks and indents within a block of text.
Bullted lists beging with - and numbered ones with numbers.
You can use the M-RET trick for lists too.
M-Up and down arrow keys will move list elements up and down. The same can be done with headings and subheadings.
Introducing a list element in the middle will auto readjust the numbers.
​
​
1.9.2 Date and time
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
​
C-c ! will insert an inactive date. (. instead of ! inserts an active
date)
​
​
1.9.3 Tables
╌╌╌╌╌╌╌╌╌╌╌╌
​
Create a new table with | and enter fields separated by pipes. Typing tab or return will autocomplete table skeleteon and readjust table alignment.
For the second row, type | and — and then press tab to autocomplete table.
To navigate, use tab and enter. Shift + tab/enter will reverse the movement.
To adjust the display length of field, add a row on top below header with value like <10>. This will show field upto size 10.
C-c | on a csv will make a table, while the same key combo will create a new table with ability to specify rows and columns. It will create an empty table if region doesn't contain anything.
​
​
◊ [1.9.3.1](https://1.9.3.1) Formulas
​
= will start formula in a field.
You can use excel like notation like =A1+B2.
Or proper notation is u/2$3 which means row 2 and column 3, this is absolute reference.
u/-2$+3 means 2 rows above and 3 columns right, this is relative reference.
u/0 and $0 refer to current row and column, if ommited it's understood be self.
Column formula: $4 = $3 + $2 will fill all columns of column 4. Initially only one field is filled, but go to the formula bar auto typed below and then press
C-c C-c on it, it will autoupdate all the formulas.
C-c + will show the sum of all rows above in the minibuffer, S-Insert will insert this value into the current field.
​
​
1.9.4 Timers
╌╌╌╌╌╌╌╌╌╌╌╌
​
These start a stopwatch
C-c C-x 0 (org-timer-start)
C-c C-x , (org-timer-pause-or-continue)
C-c C-x \_ (org-timer-stop)
The one below starts a countdown timers.
C-c C-x ; (org-timer-set-timer)
​
​
1.10 Exporting
──────────────
​
C-c C-e will open export menu and then options there are self explanatory.
Export to markdown or html requires you to use linebreaks either with \\\\ or BEGIN\_VERSE.