Blog Archives

gedit to Geany

I’ve decided lately to switch from gedit to Geany as the default editor. I had done this before and really liked it (I didn’t want to set it up again because I didn’t remember all the settings I had changed). Geany is more religious how it handles text and I can’t really define it better than that. All I remember is that there were some odd quirks when I adjusted to gedit like selecting text; also Geany just runs beautiful, real light. Geany is a actually an IDE (an integrated development environment) so it’s more than a text editor but it can be pruned down to feel like a basic text editor and it just runs very very nice.

Settings

To get Geany to behave and feel like gedit a number of setting changes will need to be made. To make changes open up the preferences (Edit > Preferences) and change these settings in the Tabs:

General : Startup

  • Uncheck: Load virtual terminal support

General : Miscellaneous

  • Check: Always wrap search

Interface : Interface

  • Uncheck: Show sidebar
  • DropDwn: Font size for Editor: Same as system

Interface : Toolbar : Customize Toolbar Button

  • Removed: Revert, Close
  • Added: Undo and Redo
  • Removed: Back and Forward Location (Unknown use)
  • Removed: Compile, Execute, and Build
  • Removed: Color Chooser
  • Removed: Goto, Jump to (Using Ctrl + L instead)
  • Removed: Quit

Editor : Features

  • Check: Line Wrapping
  • Uncheck: Code folding (I like to see all the text)
  • Check: Newline strips trailing spaces (I find it hard remembering empty spaces)
  • Set: Line breaking column to 80 (Good for readability, more oft use)

Editor : Indentation

  • Set: Width 2 (Two space tabs break up content well without learing the eye overly)
  • Type: Spaces (Spaces translate look as expected)

Editor : Display

  • Uncheck: Show line numbers (Don’t often need to know)
  • Uncheck: Show markers margin
  • Set: Long line marker > Column to 80
  • Set: Long line marker > Color to #98A8B6

Files

  • Check: Strip trailing spaces and tabs # For a consistent, expected feel
  • Check: Replace tabs by space

After setting these preferences remove the Message Pane by unchecking View > Show Message Window.

Automatic Save

gedit has a useful feature in one of its’ options of being able to autosave files at certain intervals. To get the same functionality in Geany do:

Tools > Plugin Manager

  • Check: Save Actions
  • Select: Preferences
  • Check: Auto Save: Enable & Save all open files
  • Check: Backup Copy: Enable

Geany as Default Text Editor

xdg-mime default geany.desktop $(grep MimeType /usr/share/applications/geany.desktop | sed 's/MimeType=//' | sed 's/;/ /g')

Use Generic Text Editor Icon

Ubuntus’ icon theme has a generic text editor icon that gets tied to gedit. To be able to use it with Geany do:

cp /usr/share/applications/geany.desktop ~/.local/share/applications/
sed -i 's/^Icon=.*$/Icon=accessories-text-editor/g' ~/.local/share/applications/geany.desktop
sed -i 's/=Geany/=Text Editor/g' ~/.local/share/applications/geany.desktop
nautilus ~/.local/share/applications/

From nautilus, drag geany.desktop to Launcher

Change Colorscheme

Note: To get colorscheme support to work properly it may be necessary to install the latest version of Geany. If I understand correctly this is part the development (a.k.a. master?)‘ branch. Nightly builds for various systems can be found here.

Colorscheme support in Geany is still rudimentary. Thankfully a fellow named codebrain has done a lot of the work and it is easy. Much appreciate the work codebrain, thank you.

gny_cnf_dir=~/.config/geany															# define config dir
[ ! -d $gny_cnf_dir ] && mkdir $gny_cnf_dir             # create config dir
cd $gny_cnf_dir
[ -d $gny_cnf_dir/colorschemes ] && \
mv $gny_cnf_dir/colorschemes{,_$(date +%F-%R)}          # backup original
git clone git://github.com/codebrainz/geany-themes.git  # get repository
mv $gny_cnf_dir/geany-themes $gny_cdf_dir/colorschemes

To Do

  • Remove line wrap arrows? – I learned how to do this before from a developer and lost it; afraid to ask again.
Follow

Get every new post delivered to your Inbox.

Join 52 other followers