My Geany Configuration


  Python code
    with too much distracting documentation ...
    difficult to navigate between sections and references ...
    with blocks of code that are not easily executable ...

  An editor that manages both text and code files:
    with code folding based on indentation (Python type)
    right click option, to open file pathnames, both relative and absolute,  directly in editor
    right click on htttp://web_address,  to open address in a given web browser
    syntax highlighting for Python files -  *.py
    keyword highlighting for document files - *.txt, *.hlp, *.gny

    I selected the *.gny extension to emphasize that a given text file is best reviewed
      with a custom configured Geany,  as described here...
    I selected the *.hlp extension for the documentation retrieved from Python source code by:
      >>> help(module_name)

Following describes my custom configuration for Geany ....
  Done with support from Linux Mint, pylint3, dolphin and chromium-browser.

  To configure Geany manually:

    Install and open Geany....

    Click on MenuBar > Edit > Preferences >
      and edit following:

      Interface > Message Window >
        click [x] Right  # tall is easier to read than wide,  on a large screen

      Editor > Indentation >
        width 2          # my personal preference rather than default 4
        type  spaces

      Files > Saving Files >
        [x] strip trailing spaces and tabs  # to help comply with pylint3
        [x] replace tab with space

      Tools > Tool Paths >
        set Browser to             chromium-browser      # or Firefox if prefer

      Tools > Commands >
        set Context Action to      chromium-browser %s
        #Now available:
        # click-drag on a valid web address   -> selects address
        # right clicking on address           -> opens a popup menu
        # clicking Context Action             -> opens address in given web browser
        Also Note:
        # right clicking on the pathname of a file  -> opens the popup menu
        # clicking on Open Selected                 -> opens the file in Geany

      Keybindings >    # Note: many of common keybindings are included by defualt,
        #eg for Run, Find, Find Next, Select All, Cut, Copy, Paste, etc
          Delete current line(s)    Alt-D
          Increase indent           Alt-I     # note that the Tab key is equivalent
          Decrease indent           Shift-ISO_Left_Tab
          Replace                   Alt-R     # easier to reach with one hand,  but most editors use default Ctrl-H
          Fold all                  Alt-C
          Unfold all                Alt-X
          Go to line                Alt-G

    Click on MenuBar > Edit > Plugin Preferences >
        dolphin "%d"      # I like the split screen option in dolphin
        dolphin "%d"

    Click on  Menu > Build > Set Build Commands >
      Replace all defaults with following:
        Under Doc commands >
          Pylint       pylint3 --rcfile=~/mylintrc  "%f"   # assumes default pylintrc modified and saved as ~/mylintrc
        Under Execute commands >
          Python3.7    python3.7 "%f"

    Click on Menu > Tools > Plugin Manager >
      First,  install package "geany-plugins" with Synaptic or sudo apt-get.
      Then of the many available plugins,  enable the most useful:

    Click on File > New (with template) >
      To see your custom templates in Geany File menu, put your templates in

      To put your custom templates ~above~ the defaults in the template list,
      use an initial underline character in your template`s name,  for example:

  To enable folding and simple syntax coloring for *.txt, *.hlp and *.gny files
    Easy Option:
      Click on Menu > Tools > Configuration Files > filetype_extensions.conf
      Look for
      replace with
    Better Option:  # based on
      On bash command line:
        Copy Geany global config file to local configuration directory - so any changes are now local:
          cp -v    /usr/share/geany/filetype_extensions.conf      ~/.config/geany
        Copy and rename following:
          cp -v    /usr/share/geany/filedefs/filetypes.python    ~/.config/geany/filedefs/filetypes.Txt.conf

        Note: Once these files have been copied,  they can be updated later under
          Geany > MenuBar > Tools > Configuration Files > ...

      Add following to  ~/.config/geany/filetype_extensions.conf:
        Txt=*.txt;*.hlp;*.gny             # between Tcl=... and Txt2tags=...

      Edit following in  ~/.config/geany/filedefs/filetypes.Txt.conf:
        Comment out keywords list,  so will not be highlighted
        or replace with your own keywords,  eg my favorites:
          primary = Note Warning Syntax Example Examples Description Goal References Usage Instalation Configuration Details Classes

        Enable python style folding and highligting

        Remove any build commands found here:

Tim Wallace               
Cochabamba,  Bolivia