Ubuntu – Getting Quickly to use Gvim instead of Gedit

application-developmentgeditgvimquicklyvim

How do I get Quickly to use Gvim (or just vim in a terminal) as its default text editor instead of Gedit?

If this can be done, I must be doing it wrong…

Ubuntu 10.10 AMD64.

Best Answer

  • I assume you mean you want to change the editor that Quickly loads when you ask it to.

    Well I did some sleuthing... I'll show you what I did followed by the answer.

    1. I fired off this command:

      sudo find / -name "*quickly*" -exec grep gedit {} \;
      

      That searches for all files with quickly in and then greps them for gedit. It was a long shot -- I should have refined the search so it was any paths with quickly in but it matched!

      Binary file /usr/share/quickly/templates/ubuntu-application/internal/quicklyutils.pyc matches
          editor = "gedit"
      
    2. I opened up /usr/share/quickly/templates/ubuntu-application/internal/quicklyutils.py (not the compiled version) in nano, searched for gedit and saw:

      def get_quickly_editors():
          '''Return prefered editor for ubuntu-application template'''
      
          editor = "gedit"
          default_editor = os.environ.get("EDITOR")
          if not default_editor:
              default_editor = os.environ.get("SELECTED_EDITOR")
          if default_editor:
             editor = default_editor
          return editor
      
    3. From that you can see it asks for the environment value EDITOR!

      Just run your quickly commands as:

      env EDITOR=gvim quickly edit
      

      or export it to persist

      export EDITOR=gvim
      quickly edit
      

      Add the export line to your ~/.bashrc line if you want it to persist between sessions.