:: krowemoh

Friday | 11 APR 2025
Posts Links Other About Now

previous
next

Using Emacs

2025-02-28
todo, emacs, editor

I've use a few editors but my main editor of choice has always been Vim.

I think it's time I give emacs a shot and to give it a fair enough shot, I want to outline what I need to know before using emacs. Otherwise it'll be frustrating to try and do things.

How to open files,

emacs test.sh

Opening a file seems to actually take an appreciable amount of time. It's a bit slow. This is what killed vscode for me.

How to save a file

C-x C-s

This is something to get used to but it's natural enough.

There is an autosave that happens based on characters and possibly time as well.How to exit a file, infamously hard in vim

C-x C-c

How to undo and redo in emacs

C-_

How get infinite undo and redos

C-g C-_

Really weird redo behavior, not sure but it seems to be cycling back to the undos.

How do I go to the start of a file

Esc <

How do I go to the end of a file

Esc >

How do I go to the start of a line

C-a

How do I go to the end of a line

C-e

How do I delete a line

C-k

This will blank a line, you can do it again to delete the blank line fully. This is similar to how I dd already.

How to get syntax highlighting

Searching for stringsNavigating the search results

Arrow key navigation hopefully just works

Copy a lineCopy a blockPaste

Replacing a string in a lineReplacing a string in a block