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?

  • 1
    Maybe this can help. Atleast guide you in the right direction: askubuntu.com/questions/295559/… – Parto Nov 9 '16 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… – taylor swift Nov 9 '16 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. – l --marc l Nov 16 '16 at 1:56

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:


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


Then gedit will highlight Swift code for you.

  • @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 '18 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.