SciTE + ConEmu + Julia with AutoHotkey

Hello,

I made an AutoHotkey (v2 64-bit) script that connects SciTE and Julia because none of the IDE’s out there worked for me (probably my fault). All outputs in Julia REPL console are read from conhost.exe’s output buffer in memory. The output is then sent to SciTE’s output pane through the SciTE Director Interface, thus allowing infinite scrollback (more than Command Prompt’s 9999 or ConEmu’s 32766 limit). Single line commands and code blocks can be sent to Julia via keyboard shortcut CTRL+E (supports multi-select), and the entire file can be run with CTRL+R (after saving). This is done through the clipboard after parsing the code or filename with SciTE’s builtin lua (so tabbed lines will display properly inside the REPL console). Existing clipboard data is saved before the operation and restored afterwards. The console app used here is ConEmu because it allows the use of Unifont, which is capable of displaying all Unicode plane 0 characters. The current configurations of SciTE and ConEmu should allow for them to function as is. I modified SciTE’s builtin Python lexer properties to enable code folding and highlighting for Julia.

To try this out you should:

  1. Download the entire project from GitHub (GitHub - oif2003/JuliaSciTEConEmu: Connect SciTE, ConEmu, and Julia with AutoHotkey v2)
  2. Run “start.bat” (this will also set your SciTE_HOME variable to “\JuliaSciTEConEmu\wscite”)
  3. On first run it should ask you to locate “julia.exe” which is usually found at “C:\Users\UserName\AppData\Local\Julia-X.X.X\bin”
    …(Delete “config.ini” to change this later)
  4. Try keyboard shortcuts such as CTRL+E, CTRL+R, or CTRL+1 (fix indentation of selected code with lua)

Links:
Julia: https://julialang.org/
SciTE 64-bit for Windows: https://sjohannes.wordpress.com/scite-win64-nightly/
Unifont: GNU Unifont Glyphs
ConEmu: https://conemu.github.io/
This Repo: GitHub - oif2003/JuliaSciTEConEmu: Connect SciTE, ConEmu, and Julia with AutoHotkey v2

It is really great to hear that. I heard SciTE is even better than notepad++ in terms of performance. I always want to try it. My question is how can I set it up on Linux?

I don’t have Linux and AutoHotkey does not run on it either, but I imagine you can use an equivalent scripting language for automation on Linux for one way or maybe two way communication between SciTE and Julia. I really like SciTE, too because you can macro with lua and do nifty things like multi select, multi paste/edit, and rectangular selection. Perhaps some of the lua code would be of some use to you at least.

I just got scite set up for my Linux machine. Do you mind sharing me your user configuration code for scite? I want to see what features are available. Thanks.

Sure, here it is. It doesn’t display properly here so you might want to check out the documentations or get my config files (SciTEUser.properties and SciTEGlobal.properties) from my GitHub under the “wsite” folder. User settings > Global settings and Global settings tend to get rewritten when you update, so keep that in mind.

For more info see:

  1. SciTE FAQ
  2. SciTE

SciTEUser.properties:

## Between sessions
session.bookmarks=1
session.folds=1
;window position
position.left=913
position.top=0
position.width=937
position.height=1088
save.session=1
save.recent=1
save.position=1
save.find=1

## Behavior
;Find and replace
find.close.on.find=0
find.use.strip=0
replace.use.strip=0
highlight.current.word=1
selection.multiple=1
selection.additional.typing=1
selection.multipaste=1

## Appearance
font.base=$(font.monospace)
font.small=$(font.monospace)
font.comment=$(font.monospace)
font.text=$(font.monospace)
font.text.comment=$(font.monospace)
font.embedded.base=$(font.monospace)
font.embedded.comment=$(font.monospace)
font.vbs=$(font.monospace)

horizontal.scrollbar=0
blank.margin.left=5
line.margin.visible=1
line.margin.width=4
statusbar.visible=0
code.page=65001
fold.symbols=3
caret.line.back=#FF0000
caret.line.back.alpha=15

tabbar.hide.one=1
tabbar.hide.index=1
tabbar.multiline=1
toolbar.visible=1
toolbar.large=1

;output pane settings
output.code.page=65001
split.vertical=0
output.initial.hide=0
output.vertical.size=200
output.scroll=2
output.horizontal.scrollbar=0

## Block uncomment (ctrl+Q) for dark theme (breaks output pane)
#~ style.*.32=$(font.base),back:#000000,fore:#ffffff
#~ style.*.33=back:#C0C0C0,$(font.base)
#~ style.*.37=fore:#939393
#~ caret.fore=#FFFFFF
#~ selection.alpha=75
#~ selection.back=#FFFFFF
#~ colour.keyword=fore:#649bff
#~ colour.operator=fore:#727272

indent.size=4
tabsize=4
use.tabs=1
tab.indents=1
fold.comment=1
virtual.space=3

## Lua Macro Shortcuts
command.name.1.*=Fix Identation
command.subsystem.1.*=3
command.1.*=dofile $(SciteDefaultHome)\fixindent.lua
command.mode.1.*=savebefore:no

command.name.9.*=juliacode.lua
command.subsystem.9.*=3
command.9.*=dofile $(SciteDefaultHome)\juliacode.lua
command.mode.9.*=savebefore:no

command.name.6.*=juliascript.lua
command.subsystem.6.*=3
command.6.*=dofile $(SciteDefaultHome)\juliascript.lua
command.mode.6.*=savebefore:yes

command.name.8.*=lockoutputpane.lua
command.subsystem.8.*=3
command.8.*=dofile $(SciteDefaultHome)\lockoutputpane.lua
command.mode.8.*=savebefore:no

command.name.7.*=unlockoutputpane.lua
command.subsystem.7.*=3
command.7.*=dofile $(SciteDefaultHome)\unlockoutputpane.lua
command.mode.7.*=savebefore:no

1 Like

Just found the commands to move entire lines up and down. You can use them as a lazy way to select the current line, too.

## User defined key commands
user.shortcuts=\
Alt+Up|SCI_MOVESELECTEDLINESUP|\
Alt+Down|SCI_MOVESELECTEDLINESDOWN|\

More commands you can keybind:
https://www.scintilla.org/ScintillaDoc.html#KeyboardCommands

1 Like

Thanks so much. I really found this community very helpful. Two weeks ago, I was thinking if I could find some introductory learning materials about GPU programming with Julia, then a post about it showed up. Last week, I was thinking about editing my Julia code in scite, then your post came out.

PS: I personally think adding Julia support to Scite in Linux makes more sense, because in windows we already have Julia support for notepad++. Scite is also based on Scintilla but is available on both windows and linux, and in many cases is considered alternative of notepad++ in Linux.

You’re welcome. SciTE can be controlled through Window Message (WM_COPYDATA), and it’s output pane is a bonus since I already have the AutoHotkey code to read console output. I remember when I tried Notepad++, I couldn’t get code folding to work reliably. As for Julia support for SciTE on Linux, perhaps you can lead the charge there?

How can I make the indent guidelines more visible? I mean, thicker and darker…

Try putting this in your lexer properties file:
style.lexer.37=fore:#FF0000

Change the word “lexer” to the language you are using for syntax highlighting. #FF0000 is the hex value for indentation guide color. I didn’t see any setting for thickness. If you are piggybacking off Python lexer (like I am), put this inside “python.properties”:

style.python.37=fore:#FF0000

1 Like

Thanks. It works. How can I see how many tabs or spaces the white space between left edge and my code has used?

Try menu View > Whitespace (Ctrl + Shift + 8)

Or use these in SciTEUser.properties:

view.whitespace
view.indentation.whitespace
Setting view.whitespace to 1 makes SciTE start up with whitespace visible.
Setting view.indentation.whitespace to 0 hides visible whitespace inside indentation.
Setting view.indentation.whitespace to 1 makes indentation whitespace visible
Setting view.indentation.whitespace to 2 makes indentation whitespace only visible

whitespace.fore
whitespace.back
Sets the colours used for displaying all visible whitespace, overriding any styling applied by the lexer.

Taken from: SciTE

Hi
I’m new to Julia, but a long term user of SciTE. Sorry to add to an old post but I downloaded your SciTE installation specifically looking for a properties and/or API file for Julia.

  • Do such files exist?
  • Could you add it to you Github repository?

Any pointer welcome.

Kind Regards Gavin Holt

1 Like