General
Evaluate a piece of elisp code
- You can type the form in the scratch buffer, and then type LFD (or C-j) after it. The result of evaluating the form will be inserted in the buffer.
- Typing M-: or M-x eval-expression allows you to type a Lisp form in the minibuffer which will be evaluated once you press RET.
enable / disable tabs instead of spaces on a buffer
set indent-tab-mode
to t
to enable tabs.
Major modes
Markdown mode
Table editing
C-c UP
orC-c DOWN
- Move the current row up or down.C-c LEFT
orC-c RIGHT
- Move the current column left or right.C-c S-UP
- Kill the current row.C-c S-DOWN
- Insert a row above the current row. With a prefix argument, row line is created below the current one.C-c S-LEFT
- Kill the current column.C-c S-RIGHT
- Insert a new column to the left of the current one.
Spacemacs
Reinstall packages
remove packages under elpa/
directory and restart emacs.
Key binds
-
list processes of Emacs subprocesses
M-m a p
(list-processes)
LSP
- remove blacklist
M-x lsp-workspace-blacklist-remove
Metals
Bloop with gradle
- Add gradle-bloop plugin. e.g. on
build.gradle.kts
buildscript {
repositories {
mavenCentral()
}
dependencies { classpath("ch.epfl.scala:gradle-bloop_2.12:1.6.0") }
}
apply(plugin = "bloop")
- Export build (done by metals)
$ ./gradlew bloopInstall
- Verify installation and export
$ bloop projects
- Reference
Log location
${project_home}/.metals/metals.log
Reinstall metals
Delete .cache/lsp/metals/
and install server again.
Clangd
Project setup
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1
Links
Emacs for Mac
Trouble shooting
Too many open files
This problem cannot be simply solved by increasing ulimit because
Emacs uses pselect, which is limited to FD_SETSIZE file descriptors, usually 1024.
It requires to build Emacs to change FD_SETSIZE
.
lsp-mode tends to consume many file descriptors for file watching. file-notify-rm-all-watches can be used to free up descriptors as a workaound.
reference: Fix annoying max open files for Emacs