§ Emacs Cheat Sheet
fill-paragraph: make stuff 80 column, at least in text. so this is not that bad.
C-u C-space: go back to where you were in the file.
C-x r t:
string-rectangle. insert new text in a rectangle ergoemacs ascii art . I bind this to
C-x r i for
C-x r k: delete column of text. For
rectangle-mark-mode to select rectangles.
C-space to lay down mark. I bind it to
C-x r r.
C-c C-c: org-capture into code snippet.
C-c C-d: open org-capture list.
C-c C-o: follow a link.
C-c C-a: compile file.
C-c backtick: go to error.
C-c C-v: view file.
M-x TeX-error-overview: see all errors
C-c C-s: enter section
C-c C-e: enter environment (stuff in between
M-g n: goto next error.
M-g p: goto previous error.
§ LSP mode
(define-key lsp-mode-map (kbd "C-c l") lsp-command-map)
C-c l g r: goto ref
C-c l g g: goto definition
C-c C-r: go to output.
C-u C-c C-r: narrow to output.
cd = gives a list to go do.
C-c = gives a completion list.
dired-jump: open current file in dired.
I suppose this is because
it's attempting to match it, and is unable to figure out
what to match to. I now edit markdown in
markdown-mode lags when I open a paren
[for a link.
The answer seems to be:
yes, it kills a word. You can redefine what a word is,
and break lots of other stuff in the process, or redefine
backward-kill-word kills far too much.
ctrl-backspace does. However, as a non-expert, it's hard
to say what redefining this will mean. Will it still interact
with history the same way?
§ there is no centralized notion of
Instead, it differentiates between "go back in buffer" versus
"go back across buffers".
This is extremely confusing when one is attempting to read
code and understand control-flow: I want a unified way
to say "go forward in my history; OK go back" when I am
exploring code. I don't want to keep track of whether
I came to this buffer from the same buffer or another buffer.
The fact that emacs needs this is moronic.
Furthermore, once a mark is popped, it is lost forever. In vim, one can
navigate backwards and forwards across movement. This is not possible with
C-o (go back to where I came from).
§ Scrolling half a page is broken
There is no inbuilt functionality to scroll half a page. The canonical
reference points to this:
However, this does not work well. On press
(autoload 'View-scroll-half-page-forward "view")
(autoload 'View-scroll-half-page-backward "view")
(global-set-key (kbd "C-d") 'View-scroll-half-page-forward)
(global-set-key (kbd "C-u") 'View-scroll-half-page-backward)
C-u to go to
the top of the file, it does not move the cursor to the
top completely; once the first line is in view
(with my cursor still on line 30),
emacs obstinately refuses to scroll up with a 'beginning of buffer'
message. I'm sure there's more
elisp I can write to fix this,
but the fact that something like moving-half-a-page
is rocket science just rubs me the wrong way.
This code that is given in
has the exact same issue, I don't understand
how the poster says they come from vim and
did not notice this inconsistency.
(defun zz-scroll-half-page (direction)
"Scrolls half page up if `direction' is non-nil, otherwise will scroll half page down."
(let ((opos (cdr (nth 6 (posn-at-point)))))
(defun zz-scroll-half-page-down ()
"Scrolls exactly half page down keeping cursor/point position."
(defun zz-scroll-half-page-up ()
"Scrolls exactly half page up keeping cursor/point position."
(global-set-key (kbd "C-d") 'zz-scroll-half-page-down)
(global-set-key (kbd "C-u") 'zz-scroll-half-page-up)
§ Default encoding is weird:
Why in the world is this the option that shows up by default?
There are so many better options, with
utf-8 being the
sanest of them all; this is a nice spherical cow of
the problems with emacs: too much stuff, too like sanity.
The spell is:
§ linum lags on large files
global-linum-mode lags on very long files.
§ emacs lags on long lines
emacs lags given very long lines.
A comment by
eli-zaretskli on reddit
That is true, but the "fix" part misses the point. There's nothing wrong with the current algorithms, they just cannot handle these situations better than they already do. The main problem that makes redisplay slow in these cases is that, given a cursor motion command, such as
So there's a fundamental problem. He continues:
M-v, the display engine needs first to find where in the buffer that command puts point. And that is non-trivial when variable-size fonts are supported and variable-size characters (or images) can be anywhere on display.
... we are talking about one of the following two alternatives: Add new members to the data structures used by the display engine, that would allow it to find good approximations for buffer positions corresponding to given screen coordinates, then augment the algorithms to generate and use this additional data. edesign the display code to use a model that is entirely different from the current simple 2D canvas.
§ emacs' single threading causes pauses on auto-complete/company
§ emacs crashes on attempting to open an SVG file
emacs --version says:
I ran it with
╰─$ emacs --version
GNU Emacs 26.2
Copyright (C) 2019 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
emacs -q. The bactrace points at a segfault in
This is tagged as "not a bug" --- because
"if imagemagick crashes, there is no recourse".
Fatal error 11: Segmentation fault
 7224 segmentation fault (core dumped) emacs -q ~/work/IIIT-H-Code/softwarefoundations/project