English
Ask Your Question
1

Use Sublime 2 on Fedora 17 instead of gedit

asked 2012-10-17 13:44:09 +0000

Chris gravatar image

updated 2012-10-17 16:24:40 +0000

hhlp gravatar image

Hi, i just downloaded Sublime 2 Text Editor.

  1. I moved it to a own folder
  2. I created a /usr/bin/sublime file with:

#!/bin/sh export

SUBLIME_HOME="/home/chris/comp/sublime"

$SUBLIMEHOME/sublimetext $*

And a desktop file:

#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Sublime Text 2
Exec=sublime
Icon=/home/chris/comp/sublime/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Categories=Utility;

Now i can use it via the programm search and so on. Thats great. BUT how can i use it now as my standard editor? If i do a rightclick on my ".py"-file i cant find sublime in the list of programms. A option to use a terminal-command like "sublime" is neither possible.

How can i register sublime properly to use it as my custom text editor? Thanks in advance.

edit retag flag offensive close merge delete

Comments

Why don't you install the rpm package? http://repo.cloudhike.com/sublime2/fedora/

skytux ( 2012-10-17 18:10:54 +0000 )edit
1

Using the desktop file you created, add the mimetypes you wish to open with the application. In the case of gedit, its .desktop file has the following line

MimeType=text/plain;

So, add that, along with any other types in particular you're interested in. Then execute:

xdg-mime default APPLICATION.desktop MIMETYPES

To verify that this worked you can do this:

xdg-mime query default MIMETYPE

Hope this helps.

liam ( 2012-10-17 23:00:33 +0000 )edit

Yep, hope the repo is safe

thiagofm ( 2013-06-21 02:17:43 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2012-10-17 16:19:22 +0000

hhlp gravatar image

updated 2012-10-17 16:23:25 +0000

  1. Option 1

All you needed to do was to open Alacarte application (is not instaled by default so you need to install find in PackageKit ) and add a parameter %U to the program command like "sublime %U" and restart GNOME 3 shell / desktop by pressing "Alt+F2" following by keying in 'r' and hitting return / enter key. Poof !!! the miracle happens.

  1. Option 2

in your desktop file change Exec=sublime to Exec=yourprogram %U

  1. Option 3 - Use alacarte

Add custom application to Applications menu in Gnome 3 (the easy way)

This guide shows you how to add any custom application or script to "Activities -> Applications" with easy graphical interface. With the tools installed, you can also hide an application or item from the menu or system settings.

  1. Install Alacarte menu editor

    su -c "yum install alacarte"

  2. Start it with Activities -> Applications -> Main Menu or Alt+F2 -> alacarte

  3. Use the "New Item" to add an application to the group you want and don't forget the %U parameter.

P.D : right clik on the file you want to open -> properties -> open with or open with another aplication.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Stats

Asked: 2012-10-17 13:44:09 +0000

Seen: 5,069 times

Last updated: Oct 17 '12