# How to Install Sublime Text with KSP add-on



## Mike Greene

This question seems to come up from time to time, so I put together a video showing how to install Sublime, then Package Control, then the KSP add-on. I also added Super Calculator and Increment Selection, which I find handy.


----------



## polypx

Mike, command-K for "compile" works for you on Mac? For me, that just launches a secondary command system, and doesn't compile. So I use the manual install of KSP, and manually change the key_commands file to "command-L" for compile (or something else that Sublime Text doesn't need). I've never found out how to do that in the Package Control version.

I also like the light colour scheme, that makes two of us!

cheers, Dan


----------



## geronimo

The command-K for "compile" works for me on my Apple computer, under SIERRA 10.12.6. _

And I use Mac OS X's Calculator (here, in Programmer Mode).


----------



## geronimo

Under Mac OSX, the problem is that I end up with several choices of KSP synthax after different versions and updates. It's strange _
Still happy that I don't develop very complicated Instruments.


----------



## Anders Wall

geronimo said:


> Under Mac OSX, the problem is that I end up with several choices of KSP synthax after different versions and updates. It's strange _
> Still happy that I don't develop very complicated Instruments.


Just remove them and install the latest.
--> Prefs browse pkg.
Remove all the KSP's
Restart app and then install KSP pkg again.
Best of luck!
/Anders


----------



## Tod

Make this a sticky Mike if you haven't already. I've gone through this 3 times over the years and it's always a headbanger.

Also thanks for the "Calculator and Increment Selection", I didn't know about them.


----------



## WocherMusic

Thank you so much for your explanation, everything worked fine!
Is there a way to set up KSP syntax as a default when opening up a new file? (I've been learning how to code – and only KSP – for only three weeks yet, so that preferences menu in Sublime Text is too much for me...)


----------



## EvilDragon

Put .ksp extension in your file as you save it and it will automatically switch to sKSP syntax coloring.

You can also add a keyboard shortcut to switch directly to it. Go to Preferences->Key Bindings, then in the right side panel (user settings), add this bit of JSON:



Code:


    {
        "keys": ["ctrl+k, ctrl+k"],
        "command": "set_file_type",
        "args": {"syntax": "KSP.sublime-syntax"}
    },


----------



## Tod

Wow, thanks Mario.


----------



## WocherMusic

Thanks! And another small thing: does anyone use F5 to compile? I'd love to use it, but the KSP add-on allows only for cmd+K, while F5 is assigned to another native function in Sublime Text ("Sort lines").


----------



## EvilDragon

You can change the binding for Sort lines to something else (I think I moved it to F9), then F5 should work.


----------



## WocherMusic

Right, it's just too hard for a beginner. I thought it was easy to change, but I'll stick with cmd+K!


----------



## EvilDragon

You could try forcing f5 to do what you want by adding this to the user keymap:



Code:


        {
            "keys": ["f5"],
             "command" : "compile_ksp",
             "context": [{ "key": "selector", "operator": "equal", "operand": "source.ksp" }]
        },


----------



## WocherMusic

It's very kind of you to still offer me a solution – it worked!!


----------



## Tod

Something has changed in Package Control, when you click on "Install Now" it no longer takes you to the same page that you show in your video, and it no longer has the part that you copied. However, I did follow the directions there and managed to get KSP loaded. 

Just thought I'd mention it in case anybody else runs into this problem.


----------



## berto

for me when i look for KSP, i can't find it!!


----------



## Tod

berto said:


> for me when i look for KSP, i can't find it!!


Are you looking down in the right bottom corner. In this picture it shows KSP, this is where you click.




Then you get a menu where you can select KSP.


----------



## berto

Tod said:


> Are you looking down in the right bottom corner. In this picture it shows KSP, this is where you click.
> 
> 
> 
> 
> Then you get a menu where you can select KSP.




i had sublimeKSp before, i could see it in the list of languages, i was using it. BUT...
I short, i had an issue with KSP in sublime text, so i uninstalled it, then following the video i wanted to find the latest KSP version, but i don't see it in the list when i type KSP in the search box as Mike Greene does in the video. 
i also went to GitHub but i don't know how to download all the folders there.


----------



## EvilDragon

Try searching for "Kontakt Script Processor"


----------



## berto

EvilDragon said:


> Try searching for "Kontakt Script Processor"


nope :-(


----------



## EvilDragon

Hm no idea. Works here.


----------



## berto

EvilDragon said:


> Hm no idea. Works here.


how can i download the full package from GitHub?
is there a zip file i can get?


----------



## EvilDragon




----------



## Mike Greene

If you're in "Install Packages," I think it excludes any packages that are already installed. In my own case (on a Mac), I don't see KSP (or Super Calculator) show up here when I search under Install Packages, and I think it's because they're both _already_ installed.

So my guess (speaking as someone who is most definitely _not_ an expert) would be that you haven't actually deleted KSP from Sublime.


----------



## berto

Mike Greene said:


> If you're in "Install Packages," I think it excludes any packages that are already installed. In my own case (on a Mac), I don't see KSP (or Super Calculator) show up here when I search under Install Packages, and I think it's because they're both _already_ installed.
> 
> So my guess (speaking as someone who is most definitely _not_ an expert) would be that you haven't actually deleted KSP from Sublime.


you are probably right, but then how do i update sublimeKSP?

the wiki says "Updates to the plugin will be automatically installed via Package Control."

But i did install it at first using package control and it did not update (judging from the files dates)


----------



## berto

EvilDragon said:


>


Thanks so much

at first i replaced all the files i had with the ones in the ZIP and sublime told me it could not load the light kopsia THEME (which is the one i usually use). All writing was black.

Then i just moved the files from the zip file to the package folder. It replaced the ones with the same name that were older. Now instead of 21 files i have 27...
It seems it's working but i don't know how to test if it is the updated version, what function or shortcut could i try to see if it is the latest version?


----------



## Tod

I get notices if there are updates, at least I think I do. Also I can click on "Help" in the menu and check for updates.


----------



## berto

Tod said:


> I get notices if there are updates, at least I think I do. Also I can click on "Help" in the menu and check for updates.


But that is for sublimetext, not for sublimeKSP add-on, right?


----------



## Mike Greene

berto said:


> you are probably right, but then how do i update sublimeKSP?


As I said, I'm _"speaking as someone who is most definitely not an expert,"_ so I really don't know. In fact, I made that video largly for myself to look at whenever I have to install on a different computer, because I can never remember any of this. 

With that said, here are a couple thoughts:

1. I assume you did the "Uninstall" process for SublimeKSP? I would do that again, _then_ do the Install process.

2. I could be wrong about this, but I think that SublimeKSP only works in certain Sublime versions, which does not include whatever the newest Sublime is. (I think it works in 3, but not in 4?) So assuming that's correct, if you are in Sublime 4, then SublimeKSP may not be possible.


----------



## Tod

berto said:


> But that is for sublimetext, not for sublimeKSP add-on, right?


Many, if not most, of the scripts I receive from friends and developers, as well as right here on VI-Control, are in text mode. Like I showed on post 17, down in the lower right corner you can click on the word "Text", or what ever may be there, and a Menu will pop up where you can select "KSP".

And yes, the name of my "Sublime" software is "Sublime Text", in case that is confusing you.


----------



## berto

Mike Greene said:


> As I said, I'm _"speaking as someone who is most definitely not an expert,"_ so I really don't know. In fact, I made that video largly for myself to look at whenever I have to install on a different computer, because I can never remember any of this.
> 
> With that said, here are a couple thoughts:
> 
> 1. I assume you did the "Uninstall" process for SublimeKSP? I would do that again, _then_ do the Install process.
> 
> 2. I could be wrong about this, but I think that SublimeKSP only works in certain Sublime versions, which does not include whatever the newest Sublime is. (I think it works in 3, but not in 4?) So assuming that's correct, if you are in Sublime 4, then SublimeKSP may not be possible.


I managed to replace the files with the zip Evil Dragon pointed me to. So now i am using the latest sublimeKSP. My version of sublime text is 4126, don't know if it is 3 or 4 (maybe it's 4, considering the first digit...?)


----------



## berto

Tod said:


> Many, if not most, of the scripts I receive from friends and developers, as well as right here on VI-Control, are in text mode. Like I showed on post 17, down in the lower right corner you can click on the word "Text", or what ever may be there, and a Menu will pop up where you can select "KSP".
> 
> And yes, the name of my "Sublime" software is "Sublime Text", in case that is confusing you.


yes i know, thanks. I have been using sublime text for many years now. But my question was about how to update sublimeKSP within sublime text. I assumed that using package control i would download the latest sublimeKSP version. Github says it will update itself, but i did not have the latest files, so, it did not update itself. hence i had to do it manually.

and regarding the text mode, it happens sometimes that i open one of my older KSP codes and they open in text mode even though i saved them in KSP mode. i only do KSP with sublime text, so i don't know why they open like that.


----------



## EvilDragon

berto said:


> I managed to replace the files with the zip Evil Dragon pointed me to. So now i am using the latest sublimeKSP. My version of sublime text is 4126, don't know if it is 3 or 4 (maybe it's 4, considering the first digit...?)


Yeah that's ST4. I still hold my ground that ST3 should be used with SublimeKSP, ST4 has some issues, or SublimeKSP has some issues with ST4, that I'm not sure how to resolve.


----------

