Saving sublime text snippets in a directory for reuse on different pc - sublimetext2

Hey guys i am new to Sublime. I read in documentation how to create snippets. Now my question is how to save them in to a directory and then maybe reuse them on another PC.
Thanks.

You should save snippets in your Packages/User directory, where Packages is the directory opened by selecting Preferences -> Browse Packages.... You can then copy the .sublime-snippet files to your other PC by whatever means you prefer.

Save the file. When you do, you'll need to determine two things: its file name & where to save it.
File name: The file must end with .sublime-snippet, like this: foo.sublime-snippet. What goes in front of .sublime-snippet is up to you. I like to use the tabTrigger if at all possible, along with the main part of the scope in front of the tabTrigger, giving me this: html-p.sublime-snippet.
Where to save it: When you press Save, Sublime Text should automatically try to save the file in the right folder.
You shouldn't have to worry about the location, as Sublime Text should take care of it for you, but if for some weird reason you're not in the right place, then you'll need to navigate to the right location.

Related

I want to go deeper in the settings.json file in VSCODE

Basically i want to customize my cursor, but the "editor.cursorStyle" only accepts a handfull of options, so i thought that if i could find the file where "editor.cursorStyle" is located and create my own option it would work.
So is there any way to reach this file(s)?

How can I configure sublime to always open to the same folder?

I have a folder that I want Sublime to always open to ...
my_folder
Is there somewhere I can set this so that when ever I click on the Sublime Icon it opens to this folder?
For some reason if I manually quit sublime text through the menu it will open my last folder on re-opening.
However, if I just click the close X button, it will not ... it will open a blank window.
Is there somewhere I can set this correctly in the JSON file?
Well not sure if you are aware of it, but ST has a quick switch project (usually ctrl+alt+p) that will show you your recently opened projects.
Of course it has its own drawbacks:
Unable to remove one instance from it without removing all (clear recent projects cache)Can’t open the project in a new window… instead it only replaces the current project
But AFAIK this would be the most optimal way to work with multiple projects. you just need to go to the folder of the desired project and open it once and it will be available as recent project in the future…
The point of having to choose where to save the project file, IMO is because you may want to share the same file with other people or just have them wherever you want… maybe having all in one place is good for you (it is for me as well) but other people might like to have it in separate folders. 
I usually work with the project replace window… or just go in “Project -> Open recent -> …” which opens a new ST window for me!
Hope this helps you

Index and favourites tab is missing in .chm file

I have one .chm file in which Contents and Search tab are there. But Favourites and Index tabs are missing. IF I Want to add them in .chm file how can I do that?
I assume you don‘t have the original project with the project file (*.hhp) and the HTML files. If you have only the CHM file, there is no easy way to do this.
The missing index and favourites tab was originally not added by the help author. So you have to decompile the CHM file and compile again and you have to create the index yourself!
If you really want to start with Reverse Engineering decompling is described at:
http://www.help-info.de/en/Help_Info_HTMLHelp/hh_command.htm
For some first steps you don't actually need any tool to do this. Just open a command prompt window and type the following:
hh.exe -decompile <target_directory> <path>\<filename>.chm
The only decompiler with any additional features is KeyTools as this can try to rebuild the project (.hhp) file. You will need this file if you want to recompile the help project (see link above).
One thing to note is that the decompile/recompile process isn't a "round-trip" process; certain features that the help author added to the original help file can't be recovered when you decompile it, so these may no longer work properly after you've recompiled.
This is especially true in the area of context-sensitive help, which may be broken in the new version of the file.
For further information in help authoring and building CHM files see also:
https://www.youtube.com/watch?v=BxVm_Edaus8

How do you configure JSHint options globally in Sublime Text 2?

I'd like to turn off particular warnings globally when using Sublime Text 2's JSHint plugin. For instance, "laxcomma".
I tried editing the .jshintrc file in JSHint's Sublime Packages folder, but this did not work.
{
"laxcomma": true
}
Adding a project specific .jshintrc file with the same options solves the issue for that particular project, but I would like these options to be global.
Any suggestions?
From the JSHint docs page:
http://www.jshint.com/docs/
JSHint will look for this file in the current working directory and, if not found, will move one level up the directory tree all the way up to the filesystem root.
So, technically you could put a .jshintrc file at the root level of your filesystem (/.jshintrc) and every new project would default to those options. Individual projects could override them as needed.
If anyone's having trouble creating a .jshintrc in Windows, you could go to AppData\Roaming\Sublime Text 3\Packages\SublimeLinter, copy .editorconfig for example, rename and edit it then place it in your root directory like #philip-walton suggested.
If you edit the file here, you may need to Run your text editor as administrator.
If you try to rename the file here, you may need to right-click the file, go to Security, Advanced, change the Owner object name to yourself (PC-Name\User-Name), then also Add yourself to the list of Permissions by selecting the Principal.

How to edit preference file for Notepad++?

My open source project uses spaces, not tabs, in its code.
A contributor to the project has his own website which uses tabs, not spaces.
He uses Notepad++ in Windows to edit files for both projects, and is frustrated when he forgets to manually set the Preferences correctly and thus inserts tabs into my project's files.
Is there a way to edit this Preference via a script? That way he could click one icon to start Notepad++ in mode 1 (running a batch script to modify the Preferences file and then start the program) or click another to start in mode 2.
Or if there's any other way to make him not have to remember this chore, that would work too. Maybe having a Preferences setting that depends on what folder the edited file is inside of?
Any help would be appreciated. Thanks!
The notepad++ setting for replacing tabs with spaces is stored in following xml file
%USERPROFILE%\Application Data\Notepad++\config.xml
The following is the line that needs to be changed
<GUIConfig name="TabSetting" size="4" replaceBySpace="yes" />
Now I don't know how we can edit a file by batch script in windows, but if it is not possible, then he can keep two config files config-tabs.xml and config-spaces.xml. And in the script you can copy appropriate file depending on what he needs to work on.