<div dir="ltr"><div dir="ltr"><div>My Geany Configuration</div><div><br></div><div>References:</div><div>  '''<a href="https://www.geany.org/'">https://www.geany.org/'</a>''</div><div>  '''<a href="http://go-lang.cat-v.org/text-editors/geany/'">http://go-lang.cat-v.org/text-editors/geany/'</a>''</div><div><br></div><div>Problem:</div><div>  Python code</div><div>    with too much distracting documentation ...</div><div>  Documentation</div><div>    difficult to navigate between sections and references ...</div><div>    with blocks of code that are not easily executable ...</div><div><br></div><div>Solution:</div><div>  An editor that manages both text and code files:</div><div>    with code folding based on indentation (Python type)</div><div>    right click option, to open file pathnames, both relative and absolute,  directly in editor</div><div>    right click on htttp://web_address,  to open address in a given web browser</div><div>    syntax highlighting for Python files -  *.py</div><div>    keyword highlighting for document files - *.txt, *.hlp, *.gny</div><div><br></div><div>  Note:</div><div>    I selected the *.gny extension to emphasize that a given text file is best reviewed</div><div>      with a custom configured Geany,  as described here...</div><div>    I selected the *.hlp extension for the documentation retrieved from Python source code by:</div><div>      >>> help(module_name)</div><div><br></div><div>Following describes my custom configuration for Geany ....</div><div>  Done with support from Linux Mint, pylint3, dolphin and chromium-browser.</div><div>  <a href="mailto:twallace51@gmail.com">twallace51@gmail.com</a></div><div><br></div><div>  To configure Geany manually:</div><div><br></div><div>    Install and open Geany....</div><div><br></div><div>    Click on MenuBar > Edit > Preferences ></div><div>      and edit following:</div><div><br></div><div>      Interface > Message Window ></div><div>        click [x] Right  # tall is easier to read than wide,  on a large screen</div><div><br></div><div>      Editor > Indentation ></div><div>        width 2          # my personal preference rather than default 4</div><div>        type  spaces</div><div><br></div><div>      Files > Saving Files ></div><div>        [x] strip trailing spaces and tabs  # to help comply with pylint3</div><div>        [x] replace tab with space</div><div><br></div><div>      Tools > Tool Paths ></div><div>        set Browser to             chromium-browser      # or Firefox if prefer</div><div><br></div><div>      Tools > Commands ></div><div>        set Context Action to      chromium-browser %s</div><div>        #Now available:</div><div>        # click-drag on a valid web address   -> selects address</div><div>        # right clicking on address           -> opens a popup menu</div><div>        # clicking Context Action             -> opens address in given web browser</div><div>        Also Note:</div><div>        # right clicking on the pathname of a file  -> opens the popup menu</div><div>        # clicking on Open Selected                 -> opens the file in Geany</div><div><br></div><div>      Keybindings >    # Note: many of common keybindings are included by defualt,</div><div>        #eg for Run, Find, Find Next, Select All, Cut, Copy, Paste, etc</div><div>        Editor</div><div>          Delete current line(s)    Alt-D</div><div>        Format</div><div>          Increase indent           Alt-I     # note that the Tab key is equivalent</div><div>          Decrease indent           Shift-ISO_Left_Tab</div><div>        Search</div><div>          Replace                   Alt-R     # easier to reach with one hand,  but most editors use default Ctrl-H</div><div>        Document</div><div>          Fold all                  Alt-C</div><div>          Unfold all                Alt-X</div><div>        GoTo</div><div>          Go to line                Alt-G</div><div><br></div><div>    Click on MenuBar > Edit > Plugin Preferences ></div><div>      FileBrowser</div><div>        dolphin "%d"      # I like the split screen option in dolphin</div><div>      TreeBrowser</div><div>        dolphin "%d"</div><div><br></div><div>    Click on  Menu > Build > Set Build Commands ></div><div>      Replace all defaults with following:</div><div>        Under Doc commands ></div><div>          Pylint       pylint3 --rcfile=~/mylintrc  "%f"   # assumes default pylintrc modified and saved as ~/mylintrc</div><div>        Under Execute commands ></div><div>          Python3.7    python3.7 "%f"</div><div><br></div><div>    Click on Menu > Tools > Plugin Manager ></div><div>      First,  install package "geany-plugins" with Synaptic or sudo apt-get.</div><div>      Then of the many available plugins,  enable the most useful:</div><div>        SplitWindow</div><div>        AutoMark</div><div><br></div><div>    Click on File > New (with template) ></div><div>      Note:</div><div>      To see your custom templates in Geany File menu, put your templates in</div><div>        ~/.config/geany/templates/files</div><div><br></div><div>      To put your custom templates ~above~ the defaults in the template list,</div><div>      use an initial underline character in your template`s name,  for example:</div><div>        _pure_python.py</div><div>        _PyQt5.py</div><div><br></div><div>  To enable folding and simple syntax coloring for *.txt, *.hlp and *.gny files</div><div>    ======================================================================</div><div>    Easy Option:</div><div>    ======================================================================</div><div>      Click on Menu > Tools > Configuration Files > filetype_extensions.conf</div><div>      Look for</div><div>        Python=*.py;*.pyw;SConstruct;SConscript;wscript;</div><div>      replace with</div><div>        Python=*.py;*.pyw;SConstruct;SConscript;wscript;*.txt;*.hlp;*.gny</div><div>    ======================================================================</div><div>    Better Option:  # based on    <a href="http://go-lang.cat-v.org/text-editors/geany/">http://go-lang.cat-v.org/text-editors/geany/</a></div><div>    ======================================================================</div><div>      On bash command line:</div><div>        Copy Geany global config file to local configuration directory - so any changes are now local:</div><div>          cp -v    /usr/share/geany/filetype_extensions.conf      ~/.config/geany</div><div>        Copy and rename following:</div><div>          cp -v    /usr/share/geany/filedefs/filetypes.python    ~/.config/geany/filedefs/filetypes.Txt.conf</div><div><br></div><div>        Note: Once these files have been copied,  they can be updated later under</div><div>          Geany > MenuBar > Tools > Configuration Files > ...</div><div><br></div><div>      Add following to  ~/.config/geany/filetype_extensions.conf:</div><div>        Txt=*.txt;*.hlp;*.gny             # between Tcl=... and Txt2tags=...</div><div><br></div><div>      Edit following in  ~/.config/geany/filedefs/filetypes.Txt.conf:</div><div>        Comment out keywords list,  so will not be highlighted</div><div>          [keywords]</div><div>          #primary=....</div><div>          #identifiers=....</div><div>          .</div><div>        or replace with your own keywords,  eg my favorites:</div><div>          primary = Note Warning Syntax Example Examples Description Goal References Usage Instalation Configuration Details Classes</div><div><br></div><div>        Enable python style folding and highligting</div><div>          [settings]</div><div>          extension=txt,hlp,gny</div><div>          lexer_filetype=Python</div><div><br></div><div>        Remove any build commands found here:</div><div>          [build-menu]</div><div>          FT_00_LB=</div><div>          FT_00_CM=</div><div>          FT_00_WD=</div><div>          FT_02_LB=</div><div>          FT_02_CM=</div><div>          FT_02_WD=</div><div>          EX_00_LB=</div><div>          EX_00_CM=</div><div>          EX_00_WD=</div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Tim Wallace                         <a href="mailto:twallace51@gmail.com" target="_blank">twallace51@gmail.com</a><br>Cochabamba,  Bolivia<br></div></div></div>