Raku mode lets you edit Raku code with GNU Emacs 24.
This mode needs GNU Emacs 24.4.
- Basic syntax highlighting
- Basic indentation
- Identifier index menu (variables, subs, classes, etc.)
- REPL interaction
- Complete syntax highlighting
- Better indentation support (uses Emacs SMIE grammar, see the Emacs manual)
- Help system
- ETags support
find-file-at-pointfor module names
- Electricity (
electric-pair-modeneeds some context-sensitive help)
- Unicode character map
- Better HEREDOC support (currently not very stable)
- Syntax checking (use flycheck-raku)
use-package in your init file:
(use-package raku-mode :ensure t :defer t)
Or in your
(source melpa) (depends-on "raku-mode")
Or manually from MELPA with M-x package-refresh-contents and M-x package-install RET raku-mode.
Just visit Raku files.
The major mode will be autoloaded whenever a Raku file is visited.
This includes any file with
raku in the shebang, as well as any file
.pl6 extension. It also applies to any
.t files whose first line of code looks like Raku.
Start the REPL with M-x run-raku RET. The following keybindings are available to interact with the REPL:
- C-c C-c: Send the current line to the REPL
- C-c C-r: Send the selected region to the REPL
- C-c C-h: Send the whole buffer to the REPL
The REPL will start if needed with this keybindings.
Use M-x customize-group RET raku to customize Raku Mode.
Included are two skeletons (file templates) that can be auto-inserted with auto-insert-mode:
To use them, add them to your auto-insert-alist (
M-x customize-option RET auto-insert-alist) with the conditions of your choice.
To insert them when you create a new file with the
extension, use the following matching regular expressions:
Alternatively you can add them in your .emacs using
(define-auto-insert '("\\.rakumod\\'" . "Raku module skeleton") 'raku-module-skeleton) (define-auto-insert '("\\.raku\\'" . "Raku script skeleton") 'raku-script-skeleton)
The full path to the Raku executable for the shebang, as well as the default
auth information for a module can be defined in the Raku Skeleton customization
M-x customize-group RET raku-skeleton.
Pull requests are welcome.
You might want to install
cask so you can run the test suite
The original version of this code can be found at https://github.com/hinrik/perl6-mode
Raku Mode is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Raku Mode is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
COPYING for the complete license.