3

In practice I prefer to write R codes with Notepad++ and NppToR, where you can use the default shortcut keys to achieve the following functions:

F8:             Pass line or selection
Shift+F8:       Pass to point of cursor (from the very beginning) 
Ctrl +F8:       Pass entire file at once
Ctrl+Shift+F8:  Pass by source (i.e., source("C:/Users/lenovo/Desktop/yourRcode.r")) 

It is said that Julia is as simple as R or Python, but much faster than the latter two, almost as fast as C or Fortran. Thus, I try to use Julia to write codes. According to julia-NotepadPlusPlus, we can use Julia with Notepad++ and AutoHotkey, where one can achieve the following goals:

Win-F12 -> Start Julia
Left_Shift-Enter -> Evaluate current line
Right_Shift-Enter -> Evaluate selected block

I want to write a NppToJulia.ahk file to link Notepad++ and Julia, achieving the functions as the R-NpptoR-Notepad++ way:

F8:             Pass line or selection
Shift+F8:       Pass to point of cursor (from the very beginning)
Ctrl +F8:       Pass entire file at once
Ctrl+Shift+F8:  Pass by source (i.e., include("C:/Users/lenovo/Desktop/yourJuliaCode.jl"))

As I know nothing about AutoHotkey, can anyone give me some hints?

John Stone
  • 635
  • 4
  • 13
  • 1
    I know AHK well, but I don't know anything about Julia, R or those Notepad++ plugins so I'm having trouble understanding what it is that you're asking. Could you try to rephrase? Kind of sounds like you're trying to make some hotkeys? That is indeed very easily doable with AHK. – 0x464e Feb 13 '21 at 08:03
  • @0x464e Thank you for your kind response. The [julia-NotepadPlusPlus](https://github.com/JuliaEditorSupport/julia-NotepadPlusPlus ) can give us basic shortcut keys for writing Julia codes in Notepad++ with AutoHotkey. I want to modify it as the `R-NpptoR-Notepad++ way`, enhancing the shortcut keys. As you don't know anything about `Julia`, `R` and `NppToR.exe`, I'm sort of embarrassed to ask you to help me with this issue. Thanks anyway! @0x464e – John Stone Feb 13 '21 at 14:49
  • 1
    Yeah, I see the GitHub link, and I see their AHK script (which I must say is pretty terrifyingly bad, please don't try to learn AHK from it). But I'm still not 100% clear on what the question is. But maybe I get it now. You want `Shift+F8` to send `Ctrl+Shift+Home` then `Ctrl+C` then activate some other editor (Julia editor?) and send `Ctrl+V` there. And `Ctrl+F8` should do the same, but use `Ctrl+A`? 'F8' sounds a bit problematic though, since you'd need AHK to be able to tell whether or not you currently have some text selected(?) It's doable though. And I don't get "pass by source" is. – 0x464e Feb 13 '21 at 15:41
  • @0x464e Tks! I have installed [Julia](https://julialang.org/) and [Notepad++](https://notepad-plus-plus.org/) in `D:\Julia\Julia-1.4.2\bin\julia.exe` and `D:\Notepad++\notepad++.exe`, respectively. Without considering the "pass by source" functionality, I want `NppToJulia.ahk` to achieve that (1) Open Julia; (2) Passes a line or a selection to Julia; (3) Passes the entire file to Julia; (4) Evaluates the file from the beginning to the point of the cursor. Yes, you're right! I quite agree with you that we should achieve functions (1)-(4) using proper shortcut keys to avoid problems. @0x464e – John Stone Feb 15 '21 at 09:12

0 Answers0