Skip to content

Commit 7e6eef3

Browse files
committed
Explain how to use godot commands in the README
1 parent fa26dd5 commit 7e6eef3

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Diff for: README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This mode already features all the essentials:
2121
- Code formatting using
2222
[gdformat](https://github.com/scony/godot-gdscript-toolkit/).
2323
- Auto-completion for all the keywords in the `gdscript-keywords.el` file.
24+
- Run or open the project and files with Godot.
2425

2526
## Contributing
2627

@@ -118,7 +119,23 @@ Add the call to use-package to your Emacs configuration:
118119
(require 'gdscript-mode)
119120
```
120121

121-
## Formatting with gdformat
122+
## How to use
123+
124+
### Opening the project in the editor
125+
126+
You can open the project in the Godot editor with `M-x gdscript-godot-open-project-in-editor`, or open files and more in Godot with the `M-x gdscript-godot-*` commands.
127+
128+
By default, these commands try to use an executable named `godot` on the system [PATH environment variable](<https://en.wikipedia.org/wiki/PATH_(variable)>).
129+
130+
If you don't have `godot` available there, you can set a custom executable name or path to use instead:
131+
132+
```lisp
133+
(setq gdscript-godot-executable "/path/to/godot")
134+
```
135+
136+
You can also use `customize` to change this path: `M-x customize` and search for "godot".
137+
138+
### Formatting code with gdformat
122139

123140
You can call the `gdscript-format` function to format the current buffer with
124141
`gdformat`. This feature requires the python package `gdtoolkit` to be installed
@@ -133,9 +150,12 @@ pip3 install gdtoolkit
133150

134151
## Customization
135152

136-
Set the following variables to customize gdscript-mode:
153+
To find all GDScript-mode settings, press `M-x customize` and search for "gdscript".
154+
155+
Code example:
137156

138157
```lisp
139158
(setq gdscript-use-tab-indents t) ;; If true, use tabs for indents. Default: t
140159
(setq gdscript-indent-offset 4) ;; Controls the width of tab-based indents
160+
(setq gdscript-godot-executable "/path/to/godot") ;; Use this executable instead of 'godot' to open the Godot editor.
141161
```

0 commit comments

Comments
 (0)