Skip to content
An Emacs package to get GDScript support and syntax highlighting.
Emacs Lisp
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Rename data files to *.txt Feb 15, 2020
.gitignore Add gitinore Feb 15, 2020
CHANGELOG.md Update CHANGELOG with 1.0.2 release notes Feb 17, 2020
README.md Update README Feb 16, 2020
emacs-rx.el Refactor rx code to fix import error with gdscript-rx macro Feb 17, 2020
gdscript-completion.el Address package-lint warnings and errors Feb 17, 2020
gdscript-customization.el Address package-lint warnings and errors Feb 17, 2020
gdscript-fill-paragraph.el Address package-lint warnings and errors Feb 17, 2020
gdscript-format.el
gdscript-imenu.el Address package-lint warnings and errors Feb 17, 2020
gdscript-indent-and-nav.el Address package-lint warnings and errors Feb 17, 2020
gdscript-mode.el Address package-lint warnings and errors Feb 17, 2020
gdscript-rx.el Address package-lint warnings and errors Feb 17, 2020
gdscript-syntax.el Address package-lint warnings and errors Feb 17, 2020
gdscript-utils.el Address package-lint warnings and errors Feb 17, 2020

README.md

GDScript mode for Emacs

This package adds support for the GDScript programming language from the Godot game engine in Emacs. It gives syntax highlighting and indentations.

This is currently a work in progress, and my first time creating an Emacs package. Feedback, tips, and contributions are more than welcome!

Features

This mode already features all the essentials:

  • Syntax highlighting.
  • Code folding.
  • Imenu.
  • Support for scenes (.tscn) and script (.gd) files.
  • Comment wrapping when using fill-paragraph.
  • Indentation and auto-indentation: tab-based (default) and space-based.
  • Automatic pairing of parentheses, brackets, etc.
  • Code formatting using gdformat.
  • Auto-completion for all the keywords in the data/ directory.

How to install

As it is in development, the package is not available yet on Emacs package managers.

To install it:

  1. Clone the repository to your computer.
  2. In your init.el file, add a call to load and require the package.
(add-to-list 'load-path "/path/to/gdscript-mode.el")
(require 'gdscript-mode)

Installing in Spacemacs

  1. Clone the repository to the private/local subdirectory of your .emacs.d directory, where you installed spacemacs.
  2. Add the package to the dotspacemacs-additional-packages and mark it as local. That's Spacemacs' feature to make it easy to load locally installed packages.
dotspacemacs-additional-packages '((gdscript-mode :location local))
  1. In your dotspacemacs/user-config function, require the package.
(defun dotspacemacs/user-config ()
  (require 'gdscript-mode))

Installing in Doom Emacs

Add the following package definition to your .doom.d/packages.el file:

(package! gdscript-mode
          :recipe (:host github
                   :repo "GDQuest/emacs-gdscript-mode"
                   :files ("*.el" "data/*.txt")))

Require the package in your .doom.d/config.el file:

(require 'gdscript-mode)

Formatting with gdformat

You can call the gdscript-format function to format the current buffer with gdformat. This feature requires the python package gdtoolkit to be installed and available on the system's PATH variable.

You can install gdtoolkit using the pip package manager from Python 3. Run this command in your shell to install it:

pip3 install gdtoolkit

Customization

Set the following variables to customize gdscript-mode:

(setq gdscript-tabs-mode t) ;; If true, use tabs for indents. Default: t
(setq gdscript-tab-width 4) ;; Controls the width of tab-based indents
You can’t perform that action at this time.