7

I do not see an option for Swift highlighting in the gedit language menu. How can I get gedit to highlight Swift code for me?

3
  • 1
    Maybe this can help. Atleast guide you in the right direction: askubuntu.com/questions/295559/…
    – Parto
    Nov 9, 2016 at 13:46
  • @Parto the problem is i do not know enough about the syntax space of the Swift language to write my own highlighter… Nov 9, 2016 at 20:51
  • Alternately, you could install an editor on Ubuntu, such as Atom, which already has addon packages (e.g. language-swift, swift-debugger, autocomplete-swift, swift-autocomplete-snippets, language-swift3, ...) which support the Swift. Nov 16, 2016 at 1:56

1 Answer 1

5

A language definition for Swift has recently been added to the git repository of GtkSourceView (the library that performs syntax highlighting in gedit). It hasn't made it into any GtkSourceView release yet, but you can download it here:

https://git.gnome.org/browse/gtksourceview/plain/data/language-specs/swift.lang

Place this file (swift.lang) in this directory, creating it if necessary:

~/.local/share/gtksourceview-3.0/language-specs/

Then gedit will highlight Swift code for you.

1
  • @taylor-swift , does this post not answer your question? It works at least for me, I think you could consider accepting it
    – Antek
    Oct 9, 2018 at 8:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .