How can I change Wakatime API Key in Sublime? - wakatime

I'm using Wakatime to log my work hours, I had to change my API Key and now I need to update the plugin in Sublime Text.
The Wakatime FAQ sends me to the plugin repository, but I can't find any options there.

For Sublime Text, update your api key in your WakaTime.sublime-settings file.
This file can be found inside the Packages directory in Sublime Text, in my case, having MacOS it is in ~/Library/Application Support/Sublime Text 3/Packages/WakaTime there I can find the said file.
There you can fill add your api key.
{
api_key": "MY-WAKATIME-API-KEY",
...
}
More Generic Info
To view your api key: https://wakatime.com/settings/api-key
FAQ about api key: https://wakatime.com/faq#change-api-key

Related

How to change Sublime Text default save location?

When I write something in the empty canvas of Sublime Text and try to save it, it defaults to / (macOS) which can get irritating.
How can I change the default save dialog location or current working directory of sublime text to say ~/Downloads/Test ?
I normally launch the app by GUI, but if a CLI solution (like environment variable) is there, which I can use as an alias, it'd be okay too.
For a GUI solution on macOS, in Sublime Text go to Preferences -> Settings, then paste "default_dir": "your/favorite/path"
And you are done.
More info here: https://sublime-text-unofficial-documentation.readthedocs.io/en/latest/reference/settings.html#file-and-directory-settings
In this page they address a similar question to yours https://forum.sublimetext.com/t/setting-to-change-the-default-save-location/50989. You can make minimal sublime text plugin to save files to a fixed path, you can then bind this it to a any key, even override the default save key.
import sublime
import sublime_plugin
class CustomSaveCommand(sublime_plugin.TextCommand):
def run(self, edit):
# Replace the my_custom_path with the absolute path you want.
self.view.settings().set("default_dir", "my_custom_path")
self.view.run_command("save")
Then bind it to the same keys as save: command+s
Also this plugin can help you AdvancedNewFile, you can set aliases to get to the path you want faster, or modify in the plugin settings default_path to the path you want.

How to script configuring Windows 10 Indexing?

Windows Search is built on Windows Index settings (shown below).
I need to make a powershell script (so everyone here can just run the script to get configured), to :
Add appro dir struct to the list of indexed locations
Set a list of visual studio file types to index file contents
What would such a script look like?
It seems that File Types can be added and changed via the registry.
To add a new File Type and set it to "Properties and File Contents" using "Plain Text Filter", create a key at: Computer\HKEY_CLASSES_ROOT[.extensionYouWantToAdd]\PersistentHandler
Set the (Default) value to
Type: REG_RZ, Data: {5E941D80-BF96-11CD-B579-08002B30BFEB}
I'm not sure, but I'd venture a guess that the GUID specifies that the plain text filter should be used.
I imagine that it is also possible to change the indexed locations in a similar manner.
I figured this out by adding new file types manually and then searching the registry and to find the changes that were made. I have confirmed this works and also found this article that recommends the same technique: https://www.itprotoday.com/windows-78/how-can-i-include-specific-file-type-file-system-search-under-windows-xp
For my case I will be editing the registry via other methods, but it seems this is possible via Powershell also as outlined here: https://blog.netwrix.com/2018/09/11/how-to-get-edit-create-and-delete-registry-keys-with-powershell/
Once you have changed the registry, you will need to tell the index to rebuild. (Covered here: How to rebuild Windows Search Index by using PowerShell?)

Sublime Text 2 - Key Binding for Open Recent?

How can I map Open Recent, or "open last file" to a keyboard shortcut?
This is my pitiful attempt so far:
{ "keys": ["super+shift+r"], "command": "open_recent"}
I tried looking at the console (Ctrl-`) while using Open Recent but it doesn't display anything.
In general, how does one go about adding key bindings? And is there a more appropriate place that Stack Overflow for this question?
Thanks!
Key bindings should be added to the User key-binding preferences. Adding to the default settings will also work, but the settings will be overwritten when a new version of Sublime Text 2 is installed.
Your attempt matches the general structure of a Sublime Text key-binding, but "open_recent" isn't a valid command. From what I can find in the documentation, I think the Open Recent menu keeps track of the different file names then calls open on whichever file is selected, instead of calling an open_recent command.
If there isn't a way to get the name of the most recent file, you could probably write an extension that kept track of the most recent file and then opened it, but that probably be a fairly kludgy solution.
The command is reopen_last_file. So you should add something like this:
{ "keys": ["ctrl+shift+r"], "command": "reopen_last_file" },
Little PS: I'm using ctrl+shift+t, so that the shortcut for reopening the last document is consistent across my browser, IDE and editor.
I suggest you try out a couple of packages:
https://github.com/spadgos/sublime-OpenRecentFiles
or:
https://github.com/paccator/GotoRecent
And the easiest way to install them is with this package control, package:
http://wbond.net/sublime_packages/package_control/installation
That should give you what you want...

How to register my own firefox extension?

I am trying to learn how to write firefox extensions. I download an HelloWorld example from here but I can't figure out how to register it.
I found my profiles extension folder (Easy since I use the latest Firefox version) but couldn't really understand what is this "Pointer file" that I need to create (tried a shortcut but it didn't work).
What is this "Pointer File"?
How can I register it correctly?
I am using Win 7 if matters.
Thank You.
You have to create a file in the extensions folder with the ID of the add-on as name (e.g. helloworld#mozilla.doslash.org). This file should contain only one line which is the absolute path to the folder where the add-on is contained (e.g. C:\\my\path\to\addon (or however windows paths look like)).
The add-on name is located inside of the install.rdf file. Usually, it's a GUID string, but for the demo it will look like an email address.
The filename will need to match that exactly and be free of any .txt extensions, so be careful your text editor doesn't automatically give it an extension.

File extension icon on Mac

My application uses new proprietary file formats with extensions never been used before. I would like to associate specific icons to display my files in finder with nice iconography. As far as I know LaunchService is responsible to handle all these data, however I'm confused where, when and how shall I create associations.
Which entries I have to add to plist?
Where I need to actually register this extension - during installation? Is there any script for this?
Add a CFBundleDocumentTypes key to your plist, see
Storing Document Types Information in the Application's Property List

Resources