Add layer for the Perl 6 Programming Language
This layer provides the following features for the Perl 6 Programming Language: * Jump to definition & Code completion via [ctags-universal](https://github.com/universal-ctags/ctags) * Syntax checking via [flycheck-perl6](https://github.com/hinrik/flycheck-perl6) * Syntax highlighting & Syntax indentation via [perl6-mode](https://github.com/hinrik/perl6-mode) * `META6.json` highlighting via [json-mode](https://github.com/joshwnj/json-mode) * Provides evil text objects for: * double-angle-brackets * corner-brackets * single-quotation-marks * double-quotation-marks See also #5019
This commit is contained in:
parent
f89dce787a
commit
4661bbf266
|
@ -0,0 +1,43 @@
|
|||
#+TITLE: perl6 layer
|
||||
|
||||
# The maximum height of the logo should be 200 pixels.
|
||||
[[img/camelia-logo.png]]
|
||||
|
||||
# TOC links should be GitHub style anchors.
|
||||
* Table of Contents :TOC_4_gh:noexport:
|
||||
- [[#description][Description]]
|
||||
- [[#install][Install]]
|
||||
- [[#key-bindings][Key bindings]]
|
||||
|
||||
* Description
|
||||
This layer provides the following features for the Perl 6 Programming Language:
|
||||
- Jump to definition & Code completion via [[https://github.com/universal-ctags/ctags][ctags-universal]]
|
||||
- Syntax checking via [[https://github.com/hinrik/flycheck-perl6][flycheck-perl6]] and ~perl6 -c~
|
||||
- Syntax highlighting & Syntax indentation via [[https://github.com/hinrik/perl6-mode][perl6-mode]]
|
||||
- ~META6.json~ highlighting via [[https://github.com/joshwnj/json-mode][json-mode]]
|
||||
- Provides evil text objects for:
|
||||
+ double-angle-brackets
|
||||
+ corner-brackets
|
||||
+ single-quotation-marks
|
||||
+ double-quotation-marks
|
||||
|
||||
|
||||
* Install
|
||||
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
||||
add =perl6= to the existing =dotspacemacs-configuration-layers= list in this
|
||||
file.
|
||||
|
||||
It is highly recommended to install ctags-universal not ctags-exhuberant
|
||||
because it has support for Perl 6. You can use it to generate your ~TAGS~ file
|
||||
in your project directory like this:
|
||||
|
||||
#+BEGIN_SRC
|
||||
ctags -e -Ra lib t/
|
||||
ctags -e -Ra --language-force=Perl6 bin/ $YOUR_PERL_PATH/share/perl6/site/sources/
|
||||
#+END_SRC
|
||||
|
||||
* Key bindings
|
||||
|
||||
| Key Binding | Description |
|
||||
|-------------+--------------------|
|
||||
| ~SPC m g g~ | Jump to definition |
|
|
@ -0,0 +1 @@
|
|||
(spacemacs|define-jump-handlers perl6-mode)
|
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
|
@ -0,0 +1,51 @@
|
|||
;;; packages.el --- perl6 layer packages file for Spacemacs.
|
||||
;;
|
||||
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
|
||||
;;
|
||||
;; Author: Bahtiar `kalkin-`''Gadimov <bahtiar@gadimov.de>
|
||||
;; URL: https://github.com/syl20bnr/spacemacs
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
(defvar perl6-packages
|
||||
'(company
|
||||
flycheck
|
||||
flycheck-perl6
|
||||
perl6-mode
|
||||
json-mode
|
||||
)
|
||||
)
|
||||
|
||||
(defun perl6/post-init-company ()
|
||||
(spacemacs|add-company-backends
|
||||
:backends company-capf
|
||||
:modes perl6-mode))
|
||||
|
||||
(defun perl6/init-json-mode () (use-package json-mode :defer t))
|
||||
|
||||
(defun perl6/init-perl6-mode()
|
||||
(use-package perl6-mode
|
||||
:defer t
|
||||
:init
|
||||
(progn
|
||||
(add-to-list 'spacemacs-jump-handlers-perl6-mode 'evil-jump-to-tag)
|
||||
(add-to-list 'auto-mode-alist '("/perl6/site/sources/" . perl6-mode))
|
||||
(when (configuration-layer/package-usedp 'company)
|
||||
(push 'company-capf company-backends-perl6-mode)
|
||||
)
|
||||
(spacemacs|define-text-object "«" "double-angle-bracket" "«" "»")
|
||||
(spacemacs|define-text-object "「" "corner-bracket" "「" "」")
|
||||
(spacemacs|define-text-object "‘" "single-quotation-mark" "‘" "’")
|
||||
(spacemacs|define-text-object "“" "double-quotation-mark" "“" "”")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun perl6/init-flycheck-perl6 () (use-package flycheck-perl6 :ensure t :if
|
||||
(configuration-layer/package-usedp 'flycheck)) )
|
||||
|
||||
(defun perl6/post-init-flycheck () (spacemacs/add-flycheck-hook 'perl6-mode))
|
||||
|
||||
;;; packages.el ends here
|
Loading…
Reference in New Issue