spacemacs/layers/+lang/asm
syl20bnr 74fdbb6795 Refactor and simplify company backends declaration
Enabling a company backend for a specific mode was a tedious tasks with code
scattered at different locations, one for local variable definitions, one for
company hook function definitions and another where the backends were pushed to
the local variables (which was problematic, since we ended up pushing the same
backends over and over again with `SPC f e R`, pushes have been replaced by
add-to-list calls in the new macro).

All these steps are now put together at one place with the new macro
spacemacs|add-company-backends, check its docstring for more info on its
arguments.

This macro also allows to define arbitrary buffer local variables to tune
company for specific modes (similar to layer variables via a keyword :variables)

The code related to company backends management has been moved to the
auto-completion layer in the funcs.el file. A nice side effect of this move is
that it enforces correct encapsulation of company backends related code. We can
now easily detect if there is some configuration leakage when the
auto-completion layer is not used. But we loose macro expansion at file loading
time (not sue it is a big concern though).

The function spacemacs|enable-auto-complete was never used so it has been
deleted which led to the deletion of the now empty file core-auto-completion.el.

The example in LAYERS.org regarding auto-completion is now out of date and has
been deleted. An example to setup auto-completion is provided in the README.org
file of the auto-completion layer.
2017-01-02 00:39:04 -05:00
..
img asm: clean up and tweaks 2016-01-11 22:58:57 -05:00
config.el Refactor and simplify company backends declaration 2017-01-02 00:39:04 -05:00
funcs.el asm: minor fixes 2016-05-28 22:23:30 +02:00
packages.el Refactor and simplify company backends declaration 2017-01-02 00:39:04 -05:00
README.org Convert org doc files with doc-fmt 2016-03-30 22:59:55 -04:00

asm layer

/TakeV/spacemacs/media/commit/9fb263481758152c540128ad14c0a21afb8fd39f/layers/+lang/asm/img/asm.png

Description

This layer adds support for Assembly code. The built-in major mode for editing assembly code in Emacs is asm-mode.

The layer also adds nasm-mode for NASM-specific syntax. Although nasm-mode is intended for NASM, it actually works well with other variants of Assembly in general, and provides Imenu integration so you can jump around with SPC s j.

Features:

  • Improved syntax highlighting.
  • Automatic indentation.
  • Auto-completion for symbol in opened buffers.
  • Look up documentation for current instruction at cursor.
  • Imenu integration.

Install

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add asm to the existing dotspacemacs-configuration-layers list in this file.

PDFs

To look up the x86 instructions, two things are required:

  • the pdftotext command line tool from Poppler:
  sudo apt-get install poppler-utils

Then, set x86-lookup-pdf to the location of your PDF document (Tip: If you use Helm as your completion of choice, you can use SPC f f to navigate to the file, and press C-c i to insert the path). For example, something like this:

  (setq x86-lookup-pdf "~/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf")

The first time you launch the command, it can take a while for indexing, this is a one time operation and the result is cached for later use.

Key bindings

Key Binding Description
SPC m h h Look up the documentation for instruction at point
; Insert a comment

Note: Quoted from the docstring of asm-comment, the command bound to ;:

Convert an empty comment to a `larger' kind, or start a new one.
These are the known comment classes:

   1 -- comment to the right of the code (at the comment-column)
   2 -- comment on its own line, indented like code
   3 -- comment on its own line, beginning at the left-most column.

Suggested usage:  while writing your code, trigger asm-comment
repeatedly until you are satisfied with the kind of comment.