Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Sublime Text Editor - Very nice


  • Please log in to reply
72 replies to this topic
Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012

One can actually run external programs(even AHK scripts) from within sublime (w/o the need of an ahk script running in the background) with a simple plugin:

import sublime, sublime_plugin
import subprocess

class RunExCommand(sublime_plugin.ApplicationCommand):
	
	def run(self, param):
		subprocess.Popen(param)

 

I am using a custom menu for AHK and used this command to launch some tools(GUI Creator, DbgView, Help, and other AHK scripts/tools). 



stevenp
  • Members
  • 197 posts
  • Last active: Sep 23 2014 05:47 PM
  • Joined: 28 Aug 2006

Avi, I tried your package with a Portable version of SublimeText, your syntax highlighter is much better.

Autocompletions are also great.

Thanks for sharing.

 
However, F1 and F9 keys are depend on mouse pointer location not the keyboard cursor.

Also you could follow the suggestion made by Coco to launch tools from a custom menu.

Please don't include testvar.sublime-snippet, swtimer, parsel, defsc - these are excessive snippets.

 

I understand, you want to make some kind of Scite4Autohotkey alternative, some all-in-one super-awesome full-fledged editor, but it's better if you could at least submit the package to SublimeText Package Control.

http://wbond.net/sub...tting_a_Package

so that your bundle will be updated with the Package Control after you'll make changes to the package and resubmit it.

 

Also, you may want to make sure that it's compatible with SublimeText 3: http://www.sublimetext.com/3


"Simplifying complexity is not simple"

A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

AVI, things that discourage even to try your stuff:
* Win+S, Win+G, Win+M - what are these hotkeys, I don't need them
* you recommended to start from a fresh Sublime-Text rather than the one I originally have.
* your recommendation: paste the contents of your Package and Replace All Files if asked! 
* your recommendation: don't do things such as renaming the folder or renaming certain files, as then some features will not work. 
 
Now how about future versions?
How SublimeText will be updated?
Will it work after an update?
 
It's a nice try but imho it's not suited for public usage

Hi, Steven

Thanks for the feedback..

 

Let's answer the questions one by one..

 

* Win+S, Win+G, Win+M - what are these hotkeys, I don't need them 

 

These are used to launch certain programs and tools. Optionally you can use the mouse to go the tray aand select them from there.

I think I missed a trick there. May be the Hotkeys may block your existing ,or it will be too painful to move to him.

 

BTW, I have decided to make a RocketDock sort of a thing in next version to launch the apps.. It will be docked in the Right Screen and when you move your Mouse Pointer towards it ,it will pop up. Optionally you may also press a Hotkey to open the dock,then Up-Down To cycle and Enter.

 

* you recommended to start from a fresh Sublime-Text rather than the one I originally have.

 

Why it  is recommended is that you don't lose your initial settings .If you want you can put Sublime4Ahk in your old Directory.Before this what you only have to do is copy the code from Data/Packages/User/Default Windows.sublime- Keymap  to your existing above mentioned file and then delete it. Same can be done for other files in  the User  Dir.. The one that causes conflict will only be the files in the User Directory.

 

your recommendation: paste the contents of your Package and Replace All Files if asked! 

 

Same as Above,so that everything goes right..Replace All files is also advised as there may be a situation that you have original AHK Syntax files which are of lower quality and can be replace by mine's

 

* your recommendation: don't do things such as renaming the folder or renaming certain files, as then some features will not work. 

By this I mean only  renaming the  "avis_sublime4Autohotkey"  folder and the files in it. Nothing other..

 

Now how about future versions?

 

 

I see, currently the new Sublime release 3 will work perfectly with Sublime 4 Autohotkey..Not Sure for the future . IF a newer version of Sublime arrives,I will do the required tweaks and bring a compatible version of the tool.

 

How SublimeText will be updated?

 

 

AFAIK, there isnt a option to Update Sublime in its Interface..The only way of updating seems to be downloading directly from internet.If that happens,download the file,install it and then again copy the contents of Su4AHK.

 

Will it work after an update?

 

 

Yes,after update just place again the files of Su4Ahk and Done.

 

However, F1 and F9 keys are depend on mouse pointer location not the keyboard cursor.

 

 

Yup,that's a mistake.I chose Mouse-Pointer technique as it is more correct . for example if you place your cursor anywhere in the line of code,Scite and Rajat's Intellisense may not give the correct help as they are keyboard-based..

;example -- put your cursor in betn  copiedcode   and try

Stringgetpos,pos,copiedcode,L

 

btw i will give both the options in my next version(choose whatever you like) i.e help based on keyboard and on mouse OR may even try for a better keyboard based help system.

No,its not mandatory,just recommended . You can also use it with the sublime you have installed.

 

 

Portable Version of Sublime??

 

Portable version will just allow you to edit AHK with Sublime wherever you go..

An AHK Script is indispensible because of following reasons.-----

 

 

Why an AHK Script in Background

 

For the facilty ---   Create New Script  (See Tray Menu)

For   -------   Add Registry Entry

For  -----   Syntax Helper

For   -----  Help Launcher

 

*These are indispensible features -- So ,No

I may add a #NoTrayIcon.

 

Thanks again for the suggestion to remove excess Snippets.

 

//---------------------------------------------------------------------------------------------------

So what i have learned is and planned is--

 

-A Rocketdock (based on Mouse as well as Hotkey) system to launch apps.

-Keyboard-cursor and mouse-pointer based system.

-No Nude AHK Scripts in Background,just the Sublime 4 Autohotkey.exe

//---------------------------------------------------------------------------------------------------


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


stevenp
  • Members
  • 197 posts
  • Last active: Sep 23 2014 05:47 PM
  • Joined: 28 Aug 2006
Thanks for clarification.

BTW, I have decided to make a RocketDock sort of a thing in next version to launch the apps

 

Wait, are you doing a launcher or a syntax highlighter with auto-completion, access to Help files and a Tooltip.
 
A launcher? There are plenty of them available. I like the RadialMenu and NODE:
imho, it's for a Separate Topic
 

AFAIK, there isnt a option to Update Sublime in its Interface..

 

There is, if you install Sublime Package Control
 

I chose Mouse-Pointer technique as it is more correct

 

Who said you that? Then you may also want to use your finger on a tablet or by touching the words on a touch-enabled monitor.
 

if you place your cursor anywhere in the line of code,Scite and Rajat's Intellisense may not give the correct help as they are keyboard-based..

 

SciTE4AutoHotkey works flawlessly in this regard and you can put either keyboard cursor or mouse pointer inside nested commands too not just the one from the start of the line.
I suggest you to try SciTE4AutoHotkey - it have the possibility to Debug your scripts with Breakpoints.
 

-No Nude AHK Scripts in Background,just the Sublime 4 Autohotkey.exe

Yes, and a Bundle for Sublime Package Control please grin.png 

"Simplifying complexity is not simple"

A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

A launcher? There are plenty of them available. I like the RadialMenu and NODE:

I never knew they existed!!  To Launch tools was the only reason i was bothering on this. But know I think i have got the answer..

 

-------------------------------------------------------------------------------------

And one thing Interesting, Sublime 3 needs license to be used. And now i don't think people here would be interested to use it. And probably the topic would come to an end.shocked.png


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


robertcollier4
  • Members
  • 141 posts
  • Last active: Jun 28 2019 01:05 AM
  • Joined: 11 Nov 2012

Update: I have combined the files I have found on the net and integrated these updates to a Github repository. Feel free to improve/update this and submit a pull request:

https://github.com/r...ier4/AutoHotkey

 

 

1. An addition to @rootey AutoHotkey.tmLanguage to match function labels:

        <dict>
            <key>name</key>
            <string>meta.tag.section.ahk</string>
            <key>match</key>
            <string>^[\S]*:</string>     <!-- beginning of line, non-whitespace chars, followed by colon -->
        </dict> 

 

2. I recommend adding ^(?!MsgBox) to all the rules that match keywords. Don't want things like "for" to be colored when MsgBox is preceding.

So this:

            <string>(\b|^)(?i)(if|else|return|loop|break|for|while)\b</string>

Should become:

            <string>(\b|^)^(?!MsgBox)(?i)(if|else|return|loop|break|for|while)\b</string>

 

P.S. @Avi Aryan - nice package you put together - but can you use standard scope names that can be used with any color scheme? I prefer to use the color scheme "Theme - Nil/Tubnil.tmTheme" - I tried your tmLanguage file but many things dont get colored with other color themes because you have used non standard scope names such as "return.ahk", "gosub.ahk",  etc. Try to use standard scope names such as "meta.expression.something", "meta.structure.something", "meta.function", "storage.type.function", "keyword.control.operator.ahk"  so that it can be used with any color theme. You can read the scope names used by the .tmLanguage files in default packages which most 3rd-party color schemes will define.


Edited by robertcollier4, 28 March 2013 - 10:13 AM.


robertcollier4
  • Members
  • 141 posts
  • Last active: Jun 28 2019 01:05 AM
  • Joined: 11 Nov 2012

Are there any "Indent Patterns.tmPreferences" files for AutoHotkey that anyone knows about?



A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

P.S. @Avi Aryan - nice package you put together - but can you use standard scope names that can be used with any color scheme? I prefer to use the color scheme "Theme - Nil/Tubnil.tmTheme" - I tried your tmLanguage file but many things dont get colored with other color themes because you have used non standard scope names such as "return.ahk", "gosub.ahk",  etc. Try to use standard scope names such as "meta.expression.something", "meta.structure.something", "meta.function", "storage.type.function", "keyword.control.operator.ahk"  so that it can be used with any color theme. You can read the scope names used by the .tmLanguage files in default packages which most 3rd-party color schemes will define.

I'm trying to do that, but I'm a total noob.

 

My main is that  return, gosub, label and more... (with un-regular names) have their specific colours.

Could you give me some examples on what can their names be - ..

Is using something like meta.expression.label feasible ?


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


robertcollier4
  • Members
  • 141 posts
  • Last active: Jun 28 2019 01:05 AM
  • Joined: 11 Nov 2012

A v i, on 08 Apr 2013 - 19:15, said:
My main is that return, gosub, label and more... (with un-regular names) have their specific colours.
Could you give me some examples on what can their names be - ..
Is using something like meta.expression.label feasible ?

Check out Color Scheme Editor by facelessuser:
http://www.sublimete...php?f=5&t=11819

It will let you open and see visually the scope names and colors defined in .tmTheme files. You can open up the various .tmTheme files in the "Color Scheme - Default" package. If you can't find the .tmTheme files - then find "Color Scheme - Default.sublime-package" and rename its extension to zip. Then unzip it.

Then use scope names with a beginning that matches the scopes defined in the default color schemes and add ".ahk" at the end of it. The color from the tmTheme used be the one with the prefix that matches most specifically. So you can add things on to the scope names - but always use the standard prefix scopes already found in other tmTheme files.

So for example, you can have one syntax language rule for scope "variable.parameter.local.ahk" and another for "variable.parameter.global.ahk". If in your .tmTheme file defines these two scopes then they will each get different colors. But if a user is using another color scheme that only defines "variable.parameter" - it will still color - but it will color both as the same since "variable.parameter" still matches as a prefix.

Also, use this to edit your color schemes and syntax language files in JSON format instead of XML-Plist (which is very messy and hard to read):
http://www.sublimete....php?f=5&t=6534

The Sublimetext forum (linked above) is a great place to ask any more questions you might have.

Update: Another web based color scheme editor:
https://github.com/aziz/tmTheme-Editor



A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Thanks, Robert
Now, I have some idea.
Your examples on scope names are really good. I feel confident with the concept.
However, the first of the links doesnt work. It shows me an error.

Information
The requested topic does not exist.

 

I like the last link. The online editor is good.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Guys,

I created an Sublime-Text Autocomplete Adder to easily add auto-completes to Autohotkey or any other language of your choice. Comes with Duplicate-Completeions Filter.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


T1G3R_5H0T
  • Members
  • 15 posts
  • Last active: Apr 25 2013 04:24 PM
  • Joined: 16 Apr 2013

you know what would be nice a build packages to build ahk into exe with out using anything else



A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

@TIger_Shot

 

You can use the Ahk2exe compiler for that. Sending data to it from commandline. 


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


T1G3R_5H0T
  • Members
  • 15 posts
  • Last active: Apr 25 2013 04:24 PM
  • Joined: 16 Apr 2013

yea but with sublime you can compile and run and stop and debug it all there so it would cool if someone coded it you can code plugins with sublime for and make compile parameters for ahk and run it and debug it right from sublime but as for the code i know nothing about other then its capabilities 

 

(just saying it would be cool just a suggestion if you don't take it seriously then its ok.)



Binocular222
  • Members
  • 99 posts
  • Last active: Jul 25 2014 04:28 AM
  • Joined: 26 Feb 2012

Hi Avi,

Seems that your highlighter cannot be installed via Package Control. It says cannot load Light Theme. Besides, Preferences → Package settings does not show an entry to edit your settings.

 

I gaveup Package Control and have to install manually create each file. It works but the autocompletion is somewhat worse than what it was in ST2 (in ST2, all variables & function name existed in currently editing .ahk are listed for autocompletion - this no longer works in ST3)