renerocksai / sublime_zk

A SublimeText3 package featuring ID based wiki style links, and #tags, intended for zettelkasten method users. Loaded with tons of features like inline image display, sophisticated tag search, note transclusion features, support for note templates, bibliography support, support for multiple panes, etc. to make working in your Zettelkasten a joy :smile:.
Other
505 stars 58 forks source link

Sublime_ZK: Not using ag! #63

Closed roguewulf closed 6 years ago

roguewulf commented 6 years ago

Hi,

I've installed sublime_zk (on Windows 10) and downloaded Silver Searcher using the unofficial daily build method. I've added ag to a folder referenced in my PATH (and confirmed this by running ag from a command prompt). However, tag search isn't making use of ag and I'm seeing Sublime_ZK: Not using ag! in the ST3 console.

Can you help at all?

renerocksai commented 6 years ago

Hmmm if your folder was added to the path recently, I know it sounds silly, but have you tried terminating all sublime text Windows and starting it again?

Am 23.03.2018 11:16 schrieb "roguewulf" notifications@github.com:

Hi,

I've installed sublime_zk (on Windows 10) and downloaded Silver Searcher using the unofficial daily build method. I've added ag to a folder referenced in my PATH (and confirmed this by running ag from a command prompt). However, tag search isn't making use of ag and I'm seeing Sublime_ZK: Not using ag! in the ST3 console.

Can you help at all?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/renerocksai/sublime_zk/issues/63, or mute the thread https://github.com/notifications/unsubscribe-auth/AddgpxHr_9JKuFO1iAPLuamJ7PTLOc9gks5thMs-gaJpZM4S4eGs .

roguewulf commented 6 years ago

Thanks for the quick reply. Yes, I tried closing Sublime Text but still get the same error in the console when I re-launch. I've also tried restarting Explorer to make sure it's picked up the path change.

renerocksai commented 6 years ago

you can check whether your ag really is in the path (in a way that sublimetext can see it) by bringing up the console: view > view console...

then in the console type

import os     # [enter]
os.system('ag --help')    # [enter]

you should see an ag cmd line window pop up for a fraction of a second. the console should print out 0 if ag works.

Here is what I did (note that I forgot the --help first):

image

renerocksai commented 6 years ago

can you provide any details regarding your ag path and how you added it to the PATH?

roguewulf commented 6 years ago

It seems as though ST can't see ag (although the command window does flash up, briefly):

>>> import os
>>> os.system('ag --help')
1

ag is in C:\bin\ag and I added it to the PATH by opening System Properties > Environment Variables and adding C:\bin\ag\ to 'Path' System variable.

If I open a Command Prompt and type ag --help, I see the help (am not in the C:\bin\ag folder when running this command).

roguewulf commented 6 years ago

If I run os.system('ag --help & pause') the cmd window stays on screen with the following error:

'ag' is not recognized as an internal or external command, operable program or batch file.
roguewulf commented 6 years ago

Strangely, if I copy ag.exe into another folder which is also part of the PATH variable, running it in ST using os.system works fine. Very odd!

renerocksai commented 6 years ago

Hmmm. Depends on how you set the PATH variable, maybe. Sometimes spaces and special characters are also an issue.

you can also try the setting

    // fall-back: location of ag if it cannot be found in the PATH
    "path_to_ag": "/usr/local/bin/ag",

in the package settings, to specify the absolute path to ag

roguewulf commented 6 years ago

Thank you; I'll try that. Would I need to specify it as:

"path_to_ag": "c:\\bin\\ag"

?

renerocksai commented 6 years ago

I think single backslashes should be alright, I can verify on a win10 machine later

renerocksai commented 6 years ago

Btw have you tried logging off and on ? Sometimes that fixes strange behaviors in Windows

roguewulf commented 6 years ago

Rebooting Windows resolved the issue! (Windows is so awesome :unamused:).

Thanks again for all your help and sorry this was a bit of a waste of your time.

renerocksai commented 6 years ago

Naaah, it's all good! Cool that it works! Windows is an awesome mystery sometimes 😁

Am 23.03.2018 14:55 schrieb "roguewulf" notifications@github.com:

Rebooting Windows resolved the issue! (Windows is so awesome 😒).

Thanks again for all your help and sorry this was a bit of a waste of your time.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/renerocksai/sublime_zk/issues/63#issuecomment-375672321, or mute the thread https://github.com/notifications/unsubscribe-auth/Addgp52qk2Z4KF_D2R-7kVJ3VcQY2Xf_ks5thP6-gaJpZM4S4eGs .

roguewulf commented 6 years ago

It sure is!

Cortana says "Turn it off, then back on again" 😆