OpenSuse 13.2 - Sublime as default editor

6

I've downloaded sublimeText2 for text editing and would like to set it as the default editor instead of gedit but I'm not getting it.

Attempts

  • Arquivo -> abrir com -> outro aplicativo -> visualizar todas as aplicações
    however it does not appear in the listing, I believe it is because it is downloaded and executed, not installed.

  • Terminal -> su -> usr/share/applications/

    • create file sublime.desktop
    • vim defaults.list replace all gedit to sublime
  • Terminal -> su -> usr/share/applications/

    • create file sublime.desktop
    • vim mimeinfo.cache replace all gedit to sublime
  • Sublime.desktop content

    [ktop Entry]
    Name=Sublime
    Comment=Sublime text Editor
    Exec=sublime_text %U
    Icon=sublime-dark-icon.gif
    Terminal=false
    Type=Application
    Encoding=UTF-8
    Categories=text/editor;
    MimeType=text/plain;
    

    Question

    Would anyone know to tell me what I'm doing wrong? and how to solve?

        
    asked by anonymous 05.06.2015 / 16:51

    3 answers

    4

    As I told in the comments with @SneepSNinjA, I found the solution performing some tests on .desktop in usr/share/applications/ .

    I noticed that the only difference between the files:

    skype.desktop

    [Desktop Entry]
    Name=Skype
    Comment=Skype Internet Telephony
    Exec=skype %U
    Icon=skype.png
    Terminal=false
    Type=Application
    Encoding=UTF-8
    Categories=Network;Application;
    MimeType=x-scheme-handler/skype;
    X-KDE-Protocols=skype
    

    Sublime.desktop

    [Desktop Entry]
    Name=Sublime
    Comment=Sublime text Editor
    Exec=sublime_text %U
    Icon=sublime-text.png
    Terminal=false
    Type=Application
    Encoding=UTF-8
    Categories=text/editor;
    MimeType=text/plain;
    X-KDE-Protocols=sublime
    

    It was the fault in X-KDE-Protocols , with Skype appearing in Open with and sublime not.

    In this way after editing the file by adding X-KDE-Protocols , it started to appear in Open with . Then you just set it as the default.

    Update 2/27/2017

    Process

    • 1st - Download in sublime_text and extract your content. Let's say for /home/user/bin/sublime_text
    • 2nd - In the terminal access the folder of the sublime and permission +x (execution) to sublime_text . chmod +x /home/user/bin/sublime_text/sublime_text
    • 3rd - Create a symbolic link for /usr/bin (Note that this will affect all users, and you must have permission). ln -s /home/user/bin/sublime_text/sublime_text /usr/bin/sublime_text
    • 4º - Copy sublime Icon to /usr/share/pixmaps/ . cp /home/user/bin/sublime_text/Icon/128x128/sublime-text.png /usr/share/pixmaps/sublime-text.png
    • 5th - Create a .desktop in /usr/share/applications/ (As commented above). NOTE: This is just for creating an icon on the menu.
    • 6º - alt+r and execute command r , if it does not work, you may have to restart.
    07.08.2015 / 15:03
    1

    file. (txt | js | php ..) > Properties > Open With > Sublime text 2 > Set as default

        
    10.06.2015 / 22:47
    0

    Do a reconfigure like this

    update-alternatives --config editor
    

    or put it in your hand in your rc.local file so

    export EDITOR=<caminho do seu editor ex:/usr/bin/pico>
    
        
    08.06.2015 / 14:43