Skip to content

Lem Manual for Users

vindarel edited this page May 28, 2023 · 32 revisions

Lem Manual for Users (JP)

目次

  1. lem概要

  2. mode

    1. Vi mode

    2. Emacs mode

  3. REPL

  4. 補完機能

  5. ジャンプ機能

  6. キーボードマクロ

Lem manual (EN)

Lem has Emacs-like keybindings, as well as a vi emulation (M-x vi-mode).

So, to open a file, press C-x C-f (you get the file selection dialog shown above). To save it, it's C-x C-s.

To switch to the REPL: C-c C-z.

To compile and load a buffer: C-c C-k. To compile a function: C-c C-c.

To switch windows: C-x o. To make a window fullscreen: C-x 1. To split it vertically: C-x 3 and horizontally: C-x 2.

To switch buffers: C-x b.

To run an interactive command: M-x (alt-x).

See this Emacs & Slime cheatsheet to find more: https://lispcookbook.github.io/cl-cookbook/emacs-ide.html#appendix

Switching buffers

Use C-x b (aka M-x list-buffers). But don't stop here, it's a rich command.

You are presented a "modale" window. Type some text to start narrowing the buffers list matching your entry.

You can also use Space to select/deselect entries, then use a right click to choose an action to apply on the selected buffers. Default actions are to kill the selected buffers, or to save them.

vi and emacs modes

Use M-x vi-mode and M-x emacs-mode.

Describe keys

To know what function is bound to a key binding, use M-x describe-key.

Describe available bindings

To see the currently available key bindings, use M-x describe-bindings.

See also describe-mode, to understand in which mode the editor is in the current buffer.

grep

M-x grep

this presents the results in a two-panes window. You can edit lines in the results buffer, changes are reflected immediately on the files, and updated on the right side. You can use search and replace M-x query-replace in the results buffer.

Working with a language's Language Server Protocol (LSP)

For Go, if you have gopls, it should work without doing anything.

Otherwise, configurations are required.

Defining a new color theme (Monokai example)

(if none of the 100 available in Lem 2.0 don't satisfy you)

;; thanks https://gist.github.com/jason-chandler/6332e3fd753fa87e3b1cd13582df5862
(define-color-theme "monokai" ()
  (:foreground "#eeeeee")
  (:background "#262626")
  (cursor :foreground "#262626" :background "#eeeeee")
  (syntax-warning-attribute :foreground "#87005f" :background "#262626")
  (syntax-string-attribute :foreground "#d7d787" :background "#262626")
  (syntax-comment-attribute :foreground "#666666" :background "#262626")
  (syntax-keyword-attribute :foreground "#5fd7ff" :background "#262626")
  (syntax-constant-attribute :foreground "#5fd7ff" :background "#262626")
  (syntax-function-name-attribute :foreground "#afd700" :background "#262626")
  (syntax-variable-attribute :foreground nil :background "#262626")
  (syntax-type-attribute :foreground nil :background "#262626")
  (syntax-builtin-attribute :foreground nil :background "#262626"))

(load-theme "monokai")

Example users' init files