Become a member

Get the best offers and updates relating to Liberty Case News.

― Advertisement ―

spot_img
HomeStartupsIDEmacs/IDEmacs: Making Emacs beginner-friendly, via configurations that emulate mainstream IDEs

IDEmacs/IDEmacs: Making Emacs beginner-friendly, via configurations that emulate mainstream IDEs

IDEmacs aims to be a set of Emacs configurations which provide an out-of-the-box experience similar (if not identical) to popular GUI IDEs and editors.

It is aimed at…

  1. Programmers coming to Emacs from other IDEs, or even first-time programmers familiar with only office applications.
  2. Beginner Common Lisp and Scheme programmers, who need the functionality of Emacs (Sly/Geiser + structural editing) without having to perform unnecessary setup and without dealing with an alien style of keybindings. In other words, similar to Portacle or Guile Studio.

    • Some may say that we should improve support for Common Lisp and Scheme in other editors and IDEs instead. Still others may say that we should work on a better Lisp IDE than Emacs instead (such as Second Climacs or Lem). All great points. IDEmacs is just a band-aid for the present situation, where Emacs + Sly/Geiser is the best Lisp/Scheme IDE.
  3. Non-programmers who want a fully-featured Org, Markdown, or LaTeX editor with idiomatic shortcuts and mouse-friendly GUI.

It provides…

  1. GUI and mouse support, in addition to a keyboard-driven interface.

  2. Keybindings that follow popular GUI and IDE conventions.

    • CUA mode is just the start – much more keybinding configuration is needed to provide an unsurprising experince. And that’s before we even get to the IDE-specific keybindings.
    • This excludes starter kits that use Evil by default, such as Spacemacs or Doom.
  3. A fully-featured, fast, and configuration-free Emacs experience, like any starter kit/distro.

    • The configuration uses idiomatic Elisp and contains a generous amount of comments, valuable to anyone interested in learning to configure Emacs using Elisp.

Perfectly imitating the GUIs and subtle behaviour differences of IDEs is desirable, but not top priority. Given our limited resources, we aim for “good enough”.

We hope this gives new users a comfortable starting point, and make them more likely to stick around to discover the possibilities of Emacs’ malleability, rather than being driven off by the default experience.

VSCode configuration (WIP)

This is the first and currently the only IDE configuration provided.

The VSCode configuration, showing the init.el source with vscode-dark-plus theme, treemacs, centaur-tabs, minimap, idle-highlight-mode, blamer, diff-hl, and breadcrumb.

Currently, it brings together –

  1. VSCode Dark Plus theme
  2. Treemacs for the sidebar file browser (“Explorer”)
  3. Centaur Tabs for the tab bar
  4. breadcrumb to show file paths as breadcrumbs
  5. idle-highlight-mode to automatically highlight occurrences of the symbol at point
  6. Emulation of most keybindings listed in the “General”, “Basic Editing”, “Rich Languages Editing”, and “Multi-cursor and selection” sections of the VSCode keyboard shortcuts cheatsheet.
  7. All editing packages required for emulation, including whole-line-or-region, expand-region, multiple-cursors, and smartparens
  8. vc and magit for version control
  9. diff-hl and blamer to show in-buffer version control information
  10. A comprehensive collection of completion packages – Vertico, orderless, Consult, marginalia, and company.
  11. Lisp editing packages – sly, geiser, and adjust-parens (similar to Parinfer)
  12. eat for terminals
  13. Sensible Emacs defaults, and other goodies – org-superstar, pdf-tools, undo-tree, helpful, rainbow-mode, …

use-package is used to keep the code organized.

Keybinding coverage

An empty command cell means we haven’t bound anything to these keys yet.

General
Keybinding VSCode description IDEmacs-VSCode command Notes
C-S-p Show Command Palette execute-extended-command VSCode also binds F1 to this, but we currently leave that to the Emacs help prefixes.
C-p Quick Open, Go to File consult-locate FIXME – behaviour differs from VSCode. Without a search term, VSCode suggests currently- and recently-opened files. Once a search term is entered, it searches for currently- and recently-opened files and the files in the currently opened project.
C-S-n New window/instance make-frame
C-w Close window/instance idemacs-kill-buffer-noprompt
C-, User Settings customize
C-k C-s Keyboard Shortcuts We need to make an interface for this.
Keys not mentioned in the VSCode keyboard shortcuts PDF
Keybinding IDEmacs-VSCode command Notes
idemacs-escape Tries to provide VSCode behaviour while also acting as C-g
C-a idemacs-select-all
C-k C-o treemacs-select-directory FIXME – behaviour differs from VSCode. This should not just open a directory in Treemacs but also load the corresponding desktop file for it.
Basic editing
Keybinding VSCode description IDEmacs-VSCode command Notes
C-x Cut line (empty selection) cua-cut-handler empty selection behaviour is TODO
C-c Copy line (empty selection) cua-copy-handler empty selection behaviour is TODO
M- / M- Move line up/down drag-stuff-up / drag-stuff-down
C-S-k Delete line whole-line-or-region-kill-region
C-RET / C-S-RET Insert line below/above idemacs-open-line / idemacs-open-line-above
C-S-\ Jump to matching bracket
C-] / C-[ Indent/Outdent line
/ Go to beginning/end of line move-beginning-of-line / move-end-of-line vanilla Emacs defaults
C- / C- Go te beginning/end of file beginning-of-buffer / end-of-buffer vanilla Emacs defaults
C- / C- Scroll line up/down scroll-down-line / scroll-up-line
M- (Page Up) / M- (Page Down) Scroll page up/down
C-S-[ / C-S-] Fold/unfold region
C-k C-[ / C-k C-] Fold/unfold all subregions
C-k C-0 / C-k C-j Fold/unfold all regions
C-k C-c Add line comment idemacs-comment-line In VSCode, subsequent presses add additional comment characters to the start of the line, whereas IDEmacs-VSCode just toggles the comment.
C-k C-u Remove line comment idemacs-comment-line In VSCode, subsequent presses remove additional comment characters from the start of the line, whereas IDEmacs-VSCode just toggles the comment.
C-/ Toggle line comment
C-S-a Toggle block comment
M-z Toggle word wrap toggle-truncate-lines
Rich languages editing
Keybinding VSCode description IDEmacs-VSCode command Notes
C-SPC, C-i Trigger suggestion
C-S-SPC Trigger parameter hints
C-S-i Format document
C-k C-f Format selection
Go to definition xref-find-definitions
C-S- Peek definition
C-k Open definition to the side
C-. Quick fix
S- Show references xref-find-references
Rename symbol
C-k C-x Trim trailing whitespace delete-trailing-whitespace
C-k m Change file language
Multi-cursor and selection
Keybinding VSCode description IDEmacs-VSCode command Notes
M- Insert cursor mc/toggle-cursor-on-click
M-S- / M-S- Insert cursor above/below mc/mark-previous-lines / mc/mark-next-lines
C-u Undo last cursor operation
M-S-i Insert cursor at end of each line selected mc/edit-ends-of-lines
C-l Select current line
C-S-l Select all occurrences of current selection mc/mark-all-like-this
C- Select all occurrences of current word mc/mark-all-words-like-this
M-S- Expand selection er/expand-region
M-S- Shrink selection er/contract-region
M-S- Column (box) selection idemacs-mouse-drag-rectangle
Display
Keybinding VSCode description IDEmacs-VSCode command Notes
Toggle full screen toggle-frame-fullscreen vanilla Emacs defaults
M-S-0 Toggle editor layout (horizontal/vertical)
C-\= / C-- Zoom in/out text-scale-increase / text-scale-decrease
C-b Toggle sidebar visibility
C-S-e Show Explorer/ Toggle focus idemacs-treemacs
C-S-f Show Search
C-S-g Show Source Control magit-status
C-S-d Show Debug
C-S-x Show Extensions list-packages We need to write a better interface. Elpaca may be an option.
C-S-h Replace in files isearch-query-replace We need an incremental, multi-file replacement UI.
C-S-j Toggle Search details
C-S-c Open new command prompt/terminal
C-k C-h Show output panel
C-S-v Open Markdown preview
C-k v Open Markdown preview to the side
C-k z Zen Mode (Esc Esc to exit)
Search and replace
Keybinding VSCode description IDEmacs-VSCode command Notes
C-t Show all symbols
C-g Go to line consult-line
C-p Go to file consult-locate FIXME – behaviour differs from VSCode
C-S-o Go to symbol consult-imenu-multi FIXME – behaviour differs from VSCode
C-S-m Show problems panel
Go to next error or warning
S- Go to previous error or warning
C-S- Navigate editor group history
C-M-- Go back
C-S-- Go forward
C-m Toggle Tab moves focus
Editor management
Keybinding VSCode description IDEmacs-VSCode command Notes
C-w Close editor idemacs-kill-buffer-noprompt FIXME – behaviour differs from VSCode
C-k f Close folder
C-\ Split editor split-window-right
C-1 / C-2 / C-3 Focus into 1st, 2nd, 3rd editor group select-window-1, select-window-2, select-window-3 FIXME – behaviour differs from VSCode
C-k C- Focus into previous editor group
C-k C- Focus into next editor group
C-S- Move editor left
C-S- Move editor right
C-k Move active editor group left/up
C-k Move active editor group right/down
File management
Keybinding VSCode description IDEmacs-VSCode command Notes
C-n New file untitled-new-buffer
C-o Open file find-file
C-s Save save-buffer
C-S-s Save As write-buffer
C-w Close idemacs-kill-buffer-noprompt
C-k C-w Close all
C-S-t Reopen closed editor
C-k Enter Keep preview mode editor open
C- Open next
C-S- Open previous
C-k p Copy path of active file
C-k r Reveal active file in Explorer
C-k o Show active file in new window/instance

Help needed!

Users –

  1. Use IDEmacs. Observe newbies as they use IDEmacs.
  2. Provide your feedback in our Jabber/XMPP room or in the issues.
  3. Tell others about IDEmacs!

Developers –

  1. Look at the major problems and to-do items in the issues and the TODO.org
  2. Search for “FIXME” in the source to find smaller problems
  3. Make pull requests
  4. Tell others about IDEmacs!

Prior art

  1. https://github.com/seamus-brady/mousemacs

    From the author –

    I created this abomination so I could learn Lisp without having to worry too much about learning Emacs. It was originally envisaged for me to use and then switch off as I learned Emacs. But I actually liked it better and now it is my main editor.

    Mousemacs works pretty much like Sublime Text or Visual Studio Code out of the box. But it has the full power of Emacs underneath. All I did was take all the most useful Emacs packages and wrap them in a mouse friendly distribution. It is not perfect and certainly not for everyone, but it might be useful for some. It comes with a simple plain theme but it is still Emacs.

Source link