Change Local History Default Path In Sublime Text 3 Package Local Histroy - sublimetext3

How do I change the default path in the Sublime Text 3 Local History package settings file please?
LocalHistory.sublime-settings file:
{
"file_size_limit": 262144, // 256 KB
"history_retention": 30, // in days
"history_on_close": false, // store history only on close
"history_path": "<path>" // path to store history, defaults to <HOME>/.sublime/history
}
I would like to change the path to
"D:\SUBLIME TEXT 3\Sublime Text Build 3065 x64\History"
for example. Is this possible somehow?
I like to do this since I use the portable install and like to keep the History in the install directory as well.
Thank you for any help.

"history_path": "D:\\SUBLIME TEXT 3\\Sublime Text Build 3065 x64\\History" // path to store history, defaults to <HOME>/.sublime/history
did the trick and now Local History Package for Sublime Text 3 saves file copies in:
D:\SOFTWARE\SUBLIME TEXT 3\Sublime Text Build 3065 x64\History\

Related

How to disable file deletion confirmation in NvimTree?

I just installed NvimTree plugin to my neovim setup and i get annoyed by the y/n prompt when i am deleting a file. How to disable it?
Nvim's user-specific configuration file is located at
$XDG_CONFIG_HOME/nvim/init.vim, by default ~/.config/nvim/init.vim
add the following line to your configuration file:
let g:NERDTreeConfirmDelete = 0

How do I exclude a folder from the sidebar in Sublime Text permanently, specifying it relative to the open folder?

I've already read this related question (How do I exclude a folder from search in sublime text 3 permanently?) but my question is different since I want to specify only the folder at the open folder's root, not a generic pattern to match at any level in the folder tree.
In Sublime Text 4 I have an open project folder via File --> "Open Folder...".
Let's say my folder layout is this:
mainapp
├── microapp
│ └── node_modules <== don't exclude this (keep it)
├── microapp2
│ └── node_modules <== don't exclude this (keep it)
├── index
├── node_modules <=== exclude this only
├── config
└── assets
I'd like to exclude mainapp/node_modules only, NOT mainapp/microapp/node_modules nor mainapp/microapp2/node_modules. How do I do that?
I'm guessing I need to specify a "folder_exclude_patterns" in the settings.
Side note: why do I need to do this?
Because that folder has so much build content in it (which is constantly-changing as builds occur) that it's actually causing Sublime Text to freeze and lock up and become unusable.
Tested on Linux Ubuntu 18.04.
Through sheer dumb luck and persistence with guessing, I figured it out. // refers to the "open folder root", apparently.
If you want to see this info about // added to the official Sublime Text documentation and default settings file, please upvote my open issue on it here.
Update
I found some official documentation on this: https://www.sublimetext.com/docs/file_patterns.html. The // feature was added as of Sublime Text 4:
If pattern begins with //, it will be compared as a relative path from the project root [added in version 4.0]
My testing, however, proves that the // actually means "path" root, as defined below, however. So, my examples below are still correct.
1. If you have a folder open via File --> "Open Folder...", do this:
Preferences --> Settings --> add this "folder_exclude_patterns" entry to your user settings JSON file:
{
// other user settings here
// exclude only the "mainapp/node_modules" dir
"folder_exclude_patterns": ["//node_modules"],
// other user settings here
}
Again, // means the "open folder's root".
NOTE: Changing your user settings above will apply globally to all of your Sublime Text instances, which may not be what you want. So, it may be better to use a "Project" instead, as described below:
2. If you have the folder open and saved as part of a project, do this:
Project --> Edit Project --> add this "folder_exclude_patterns" entry to your Project settings JSON file:
{
"folders":
[
{
// path to an open folder in a project
"path": "/path/to/mainapp",
// exclude only the "mainapp/node_modules" dir
"folder_exclude_patterns": ["//node_modules"],
}
],
}
You can see in the official project settings file example here (https://www.sublimetext.com/docs/projects.html) that the "folder_exclude_patterns" entry must be at the same level in the JSON settings file as the "path" entry.
I also first learned this from #smhg's comment here. Thank you!
To open another folder in your project, go to Project --> "Add Folder to Project...". Once you have multiple folders open in your project, you'll have to add multiple entries of "folder_exclude_patterns", as desired, like this:
{
"folders":
[
{
// **absolute path** to open a folder in a project
"path": "/path/to/mainapp",
// exclude only the "mainapp/node_modules" dir
"folder_exclude_patterns": ["//node_modules"],
},
{
// or **relative path** to open another folder in the project;
// the path is relative to the location of the
// "project_name.sublime-project" project file itself
"path": "some_dir",
// exclude only the "some_dir/path/to/excluded_folder" dir
"folder_exclude_patterns": ["//path/to/excluded_folder"],
},
],
}
Bonus: How to create a project in Sublime Text:
To create a Project from an open folder, the steps are like this:
Open a folder: File --> "Open Folder..."
Save it as part of a project: Project --> "Save Project As..."
Now you can choose where to save your project_name.sublime-project file. This is the file you are editing when you go to Project --> "Edit Project" above. To open a project go to Project --> "Open Project...".
See also:
Issue I opened: https://github.com/sublimehq/sublime_text/issues/5234
Comment I wrote on the Sublime Text forum: https://forum.sublimetext.com/t/a-way-to-specify-root-in-project-settings/7756/4?u=ercaguy
Official Project settings documentation: https://www.sublimetext.com/docs/projects.html. This includes:
Each object must have a "path" key, which may be relative to the project directory, or a fully qualified path.
How do I exclude a folder from search in sublime text 3 permanently? - answer which explains how to exclude a file or folder from the side bar in Sublime Text, versus excluding a file or folder from search, such as Goto Anything or Find in Files.

After installation of Sublime 4 wrong order of search in files results - reverse instead of ABC, how to solve?

After installation of Sublime 4 it shows the search results (multiple files search) in reverse order instead of ABC.
Can't find any solution in Google. Even tried to change settings manually Preference -> Key bindings:
[
{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },
{ "keys": ["ctrl+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files", "reverse": false} }
]
but without result:
Searching 729 files for "veh.category"
/home/me/Projects/mycompany/myproject/app/views/veh/_fm_form.html.haml:
/home/me/Projects/mycompany/myproject/app/views/veh/_form.html.haml:
/home/me/Projects/mycompany/myproject/app/views/veh/_veh.html.haml:
/home/me/Projects/mycompany/myproject/app/views/events/_veh.html.haml:
7 matches across 5 files
Link to Sublime Forum on forum.sublimetext.com
Link to Git Sublime Issues Forum on https://github.com/sublimehq/sublime_text/issues/4700
P.S.
Ubuntu 20.04
Sublime 4107
I encounter the same problem. I thought the order is reversed, but now I think it is even unordered. Maybe it is sorted now by last modified date?
I would be interested in a solution, too.
A workaround is as follows:
use version 3 and version 4 parallel:
see https://www.sublimetext.com/docs/side_by_side.html
downloaded Sublime Text 3 and put in application folder
https://www.sublimetext.com/3
renamed Sublime Text.app to Sublime Text 3.app
created /Users/<Username>/Library/Application Support/Sublime Text 4
renamed /Users/<Username>/Library/Application Support/Sublime Text to : /Users/thomasglaser/Library/Application Support/Sublime Text 3
when starting Sublime Text 3 there was an error popup Error loading syntax file "Packages/JSON/JSON.sublime-syntax": Unable to read Packages/JSON/JSON.sublime-syntax
see https://forum.sublimetext.com/t/error-loading-syntax-file-json-error/25611/6
closed all open workspaces and projects thus tabs or windows
because of that there was the line
“syntax”: “Packages/JSON/JSON.sublime-syntax”
in file
/Users/<Username>/Library/Application Support/Sublime Text 3/Local/Session.sublime_session
after restarting sublime Text 3 no error popup came again
get rid of 'Update Availabel' Popup
see https://forum.sublimetext.com/t/how-do-i-disable-update-checks/43492/7
add line {"update_check": false,} to Preferences.sublime-settings
maybe this works only for licensed accounts

How's python Pyminizip compress_multiple work?

My python version is 3.5 through Anaconda on Windows 10 environment. I'm using Pyminizip because I need password protected for my zip files, and Zipfile doesn't support it yet.
I am able to zip single file through the function pyminizip.compress, and the encrypt function worked as expected. However, when trying to use pyminizip.compress_multiple I always encountered a Python crash (as pictures) and I believe it's due to the problem of my bad input format.
What I would like to know is: What's the acceptable format for input argument src file LIST path? From Pyminizip's documentation:
pyminizip.compress_multiple([u'pyminizip.so', 'file2.txt'], "file.zip", "1233", 4, progress)
Args:
1. src file LIST path (list)
2. dst file path (string)
3. password (string) or None (to create no-password zip)
4. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress)
It seems the first argument src file LIST path should be a list containing all files required to be zipped. Accordingly, I tried to use compress_multiple to compress single file with command:
pyminizip.compress_multiple( ['Filename.txt'], 'output.zip', 'password', 4, optional)
and it lead to Python crash. So I try to add a full path into the args.
pyminizip.compress_multiple( [os.getcwd(), 'Filename.txt'], ... )
and still, it crashed again. So I think maybe I have to split the path like this
path = os.getcwd().split( os.sep )
pyminizip.compress_multiple( [path, 'Filename.txt'], ...)
still got a bad luck. Any ideas?
Pyminizip requires the path name (or relative path name from where the script is running from) in the files.
Your example:
pyminizip.compress_multiple( [os.getcwd(), 'Filename.txt'], ... )
gives a list of files of os.getcwd(), and then another file, 'Filename.txt'. You need to combine them into a single path using os.path.join()
in your filename example, you will need:
pyminizip.compress_multiple( [os.path.join(getcwd(), 'Filename.txt')],...)
conversly:
pyminizip.compress_multiple( [os.path.join(getcwd(), 'Filename1.txt'), os.path.join(getcwd(), 'Filename2.txt')],...)
From here - https://pypi.org/project/pyminizip/, the usage of compress_multiple is
pyminizip.compress_multiple([u'pyminizip.so', 'file2.txt'], [u'/path_for_file1', u'/path_for_file2'], "file.zip", "1233", 4, progress)
The second parameter is a bit confusing, but if used, it will create a zip file, which when uncompressed, will create a directory structure like:

stop checking for updates

In sublime terminal (ctrl + `) every minute I got annoing lines:
Checking for updates:
Sync Enabled: True
Sync Timeout: 60000
Latest Update at: Thu Jan 1 00:00:00 1970
Thread is: Thread-4
Paths: [{'path': '', 'display': ''}]
It interrupt me from debuging sublime plugins.
How to disable this Checking for updates?
I tried 2 things to disable it:
I added line "update_check": false into /Users/maks/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings:
{
"ignored_packages":
[
"JavaScript Console",
"Vintage"
],
"update_check": false
}
And restarted sublime. But nothing...
I tried to find string 60000 in all files of sublime folder: /Users/maks/Library/Application Support/Sublime Text 3
But nothing good found. Maybe 60000 ms is default value.
Update
Created function to search text in packages and installed packages:
searchInSubl()
{
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Installed\ Packages; zgrep -e $1 *.sublime-package ; cd ../Packages; grep -R -e $1 *
}
With help of it I searched by different words: "Checking for updates", "Sync Enabled", "Sync Timeout", "60000", "Latest Update at", "Thread is", "Paths". But nothing found.
Seemingly this update is internal sublime 3 option. Don't know how to disable it...
My current version of sublime text 3 is 3083. Here how the guys solved it HERE.
Text version
Go to Preferences -> Settings-User -> and paste that line of code in the end:
"update_check": false, or "update_check": false (without last comma if it's last item in the array). After that press CTRL + S (on Windows OS) to Save file or go to File -> Save
Image version
Since Sublime Text 3 packages are in zipped .sublime-package files, you'll need to use zgrep to search them:
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Installed\ Packages
zgrep -e "Checking for updates" *.sublime-package
If nothing is found, try looking in the Packages directory:
cd ../Packages
grep -R -e "Checking for updates" *
Hopefully one of these will match a package. If so, add the package to your ignored_packages setting and restart Sublime.
If neither search works, try using other fragments of the message as your search term: "Sync Enabled", "Latest Update", etc.
Good luck!
Please Note:
This is not the same issue as this one, where setting "update_check": false in your user preferences does not stop Sublime Text 3 from displaying upgrade messages when a new build is released. This particular issue was caused by a plugin constantly printing a message to Sublime's console. As the OP commented below:
using turning off and on every single plugin, target plugin found, its name: "My Snippets" in Installed Packages folder.
Two solutions, depending on what exactly you want to accomplish.
Since I am not sure - possibly my English - so I give you two solutions.
BLOCK PACKAGE FROM UPDATING
I use Sublinter as an example.
Preferences > Package Settings > Package Control > Settings – User
... and add something like this to block package:
// Packages to not auto upgrade
"auto_upgrade_ignore": [
"SublimeLinter"
],
BLOCK SUBLIME FROM UPDATING
If you want Sublime to stop updating and you do not trust in-app update blocking solutions, just nuke 'em.
On Windows (system I use) go to:
C:\Windows\System32\drivers\etc
... and open file named 'hosts'.
You may have to move this file onto desktop, edit it and move it back to original location, as Windows may not allow any changes to it - even, if you try as Administrator.
Then add to 'hosts' file this line of code:
127.0.0.1 localhost www.sublimetext.com
127.0.0.1 localhost sublimetext.com
Version with 'www' will do, as sublime sends updates from 'www.sublimetext.com' location.
Above code will prevent any connection from your machine to 'www.sublimetext.com', hence no updates anymore.
That does not apply to packages, they need option #1.

Resources