2.8 KiB
- Organisation #5: Emacs refresher
- Lecture content
- Objective: get confident with emacs commands
- Find out and document how to do the following steps
- Search for something forward: C-s
- How to continue searching
- Search for something backward
- Search for regular expressions instead of string (forward, backward)
- Go to the beginning of the line
- Go to the end of the line
- Delete a word in front (to the right of the cursor)
- Delete a word in back (to the left of the cursor)
- List all "occurences" of a word in a file
- Search (GREP) for a word in all files in a directory RECURSIVELY
- Save the CURRENT buffer
- Save ALL open files
- Split the window/buffer vertically
- Split the window/buffer horizontally
- Switch between the different windows
- Close all buffers besides the active one
- Close only the active buffer
- Kill the active buffer
- Describe/Explain the difference between closing and killing
- Switch between buffers that are not shown
- Outcome
- Lecture content
Organisation #5: Emacs refresher
Lecture content
Objective: get confident with emacs commands
Find out and document how to do the following steps
Resources:
C-h b A searchable list of commands and shortcuts, very helpful
https://www.gnu.org/software/emacs/manual/html_node/emacs/ https://www.emacswiki.org/emacs/ https://www.gnu.org/software/emacs/refcards/pdf/refcard.pdf
I've been using it, it's great!
C-s multiple times.
C-r
urxvt scrollback-search is already bound for : C-M-s there is no easy way to disable it atm note: maybe i'll try the suckless terminal or xterm
C-M-r is working note: need to learn regex
C-a
C-e
C-del
M-backspace
M-x grep or grep-find - Return
enter string and/or specify a file (default directory is set to the currently edited file) - Return
The result will show up in a new windows. C-x-o to switch windows
M-x grep(-find) - Return add "-r" to the executed grep command
C-x C-s
C-x s
C-x 2
C-x 3
C-x o
C-x 1
There is no "Close buffer" per se (spent 10 minutes finding it)
The way is to Close the Window: C-x 0
List the buffers by: C-x C-b (you can switch to the buffers from this buffer (ret))
C-x k to kill it
C-x k
It's like tmux:
"Closing" just stops the rendering, and it will continue to run in the background. Killing stops the process and frees up the memory.
C-x b (tab to list buffers)
Switch buffers quickly: C-x <left> C-x <right>
ido mode should speed up buffer switching (haven't tried)