2015-12-02 14:23:39 +00:00
|
|
|
#+TITLE: Vimscript language layer
|
2015-09-08 07:35:26 +00:00
|
|
|
|
2019-05-07 08:21:07 +00:00
|
|
|
#+TAGS: dsl|layer|programming|script
|
2019-05-05 17:26:40 +00:00
|
|
|
|
2019-05-07 20:05:06 +00:00
|
|
|
* Table of Contents :TOC_5_gh:noexport:
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#description][Description]]
|
2017-12-07 17:23:06 +00:00
|
|
|
- [[#features][Features:]]
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#install][Install]]
|
2020-07-09 20:03:55 +00:00
|
|
|
- [[#configuration][Configuration]]
|
|
|
|
- [[#choosing-a-backend][Choosing a backend]]
|
|
|
|
- [[#company-vimscript][Company-vimscript]]
|
|
|
|
- [[#lsp][LSP]]
|
2015-09-08 07:35:26 +00:00
|
|
|
|
|
|
|
* Description
|
2020-07-09 20:03:55 +00:00
|
|
|
This layer adds support for vimscript and pentadactyl config files.
|
2017-12-07 17:23:06 +00:00
|
|
|
|
|
|
|
** Features:
|
|
|
|
- Syntax highlighting
|
2020-07-09 20:03:55 +00:00
|
|
|
- Auto-completion (with LSP)
|
|
|
|
- Syntax-checking (with LSP)
|
2015-09-08 07:35:26 +00:00
|
|
|
|
|
|
|
* Install
|
2016-01-06 05:21:55 +00:00
|
|
|
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
|
|
|
add =vimscript= to the existing =dotspacemacs-configuration-layers= list in this
|
|
|
|
file.
|
2020-07-09 20:03:55 +00:00
|
|
|
|
|
|
|
* Configuration
|
|
|
|
All layer configurations can be done by setting layer variables in your dotfile.
|
|
|
|
No custom user config lines are necessary
|
|
|
|
|
|
|
|
** Choosing a backend
|
|
|
|
This layer provides two alternative backends to choose from.
|
|
|
|
|
|
|
|
*** Company-vimscript
|
|
|
|
This is the default choice if nothing is set and no lsp layer
|
|
|
|
is loaded in your dotfile. This mode only provides very
|
|
|
|
limited IDE capabilities. Used best if only small scripts
|
|
|
|
are edited. To set explicitly set the following in your
|
|
|
|
dotfile:
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(vimscript :variables vimscript-backend 'company-vimscript)
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
*** LSP
|
|
|
|
For proper IDE support this backend should be used. It is
|
|
|
|
based on an external server which will be started automatically
|
|
|
|
by emacs, once a vimscript file is opened. The keybindings are
|
|
|
|
the same for all lsp modes so if you are already familiar with
|
|
|
|
one you should be able to work the same in all modes.
|
|
|
|
|
|
|
|
To set explicitly do the following in your dotfile:
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(vimscript :variables
|
|
|
|
vimscript-backend 'lsp)
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
For this to work you will also need to install
|
|
|
|
the latest version of the lsp server with below command:
|
|
|
|
|
|
|
|
#+BEGIN_SRC sh
|
|
|
|
npm install -g vim-language-server
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
NOTE: Keybindings for LSP are defined in the
|
|
|
|
LSP layer. Also it is advisable to have a look
|
|
|
|
at the autocomplete layer for an optimal
|
|
|
|
intellisense config for LSP.
|