external_editor.rst 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .. _doc_external_editor:
  2. Using an external text editor
  3. ==============================
  4. This page explains how to code using an external text editor.
  5. .. warning::
  6. `External editors are currently incompatible with Godot's "Sync Script
  7. Changes" feature. <https://github.com/godotengine/godot/issues/10946>`__
  8. Godot can be used with an external text editor, such as Sublime Text or Visual
  9. Studio Code. Browse to the relevant editor settings: ``Editor -> Editor Settings
  10. -> Text Editor -> External``
  11. .. image:: img/editor_settings.png
  12. There are two fields: the executable path and command-line flags. The flags
  13. allow you to integrate the editor with Godot, passing it the file path to open
  14. and other relevant arguments. Godot will replace the following placeholders in
  15. the flags string:
  16. +---------------------+-----------------------------------------------------+
  17. | Field in Exec Flags | Is replaced with |
  18. +=====================+=====================================================+
  19. | ``{project}`` | The absolute path to the project directory |
  20. +---------------------+-----------------------------------------------------+
  21. | ``{file}`` | The absolute path to the file |
  22. +---------------------+-----------------------------------------------------+
  23. | ``{col}`` | The column number of the error |
  24. +---------------------+-----------------------------------------------------+
  25. | ``{line}`` | The line number of the error |
  26. +---------------------+-----------------------------------------------------+
  27. Some example Exec Flags for various editors include:
  28. +---------------------+-----------------------------------------------------+
  29. | Editor | Exec Flags |
  30. +=====================+=====================================================+
  31. | Geany/Kate | ``{file} --line {line} --column {col}`` |
  32. +---------------------+-----------------------------------------------------+
  33. | Atom/Sublime Text | ``{file}:{line}`` |
  34. +---------------------+-----------------------------------------------------+
  35. | JetBrains Rider | ``--line {line} {file}`` |
  36. +---------------------+-----------------------------------------------------+
  37. | Visual Studio Code | ``{project} --goto {file}:{line}:{col}`` |
  38. +---------------------+-----------------------------------------------------+
  39. | Vim (gVim) | ``"+call cursor({line}, {col})" {file}`` |
  40. +---------------------+-----------------------------------------------------+
  41. | Emacs | ``emacs +{line}:{col} {file}`` |
  42. +---------------------+-----------------------------------------------------+
  43. .. note:: For Visual Studio Code, you will have to point to the ``code.cmd``
  44. file. For Emacs, you can call ``emacsclient`` instead of ``emacs`` if
  45. you use the server mode.
  46. Official editor plugins
  47. -----------------------
  48. We have official plugins for the following code editors:
  49. - `Visual Studio Code <https://github.com/godotengine/godot-vscode-plugin>`_
  50. - `Emacs <https://github.com/godotengine/emacs-gdscript-mode>`_