Auto refresh in Sublime Text 3 - sublimetext3

I want Sublime Text to auto reload files when they are changed in the hard disk (by some process else). Although I am not expecting to have my code open in different places, I use the editor to see resulting files, which is why this feature is crucial to my coding setup. I’ve figured out the option to prompt for the reload as below. But my issue is, it takes a long time for Sublime Text to realize the file has changed and give me the prompt. The files are in a Linux server and I am accessing them through Samba in Windows. Previously I've used Notepad++ which instantly recognize the change and prompt me to reload - so this is not to do with the file systems or hardware. Is there a way to achieve this in Sublime Text or VSCode?
"always_prompt_for_file_reload": true

Related

Cannot add Sublime project preferences after opening repo via Github Desktop

I have been happy to notice that Github Desktop lets me open a repo in Sublime Text. It seems to open the repo as a project but I have a hard time figuring out how to edit the project preferences for the repo. Specifically, I would like to add file_exclude_patterns.
I have tried Project > Save Project As... in Sublime, but then when I open the repo through Github Desktop it opens two Sublime windows: one that respects my project preferences and one that ignores them.
From your problem description, it sounds like you might be running into issues with the hot_exit setting. When that setting is turned on (which is the default), then whenever you quit Sublime, it saves the state of all open windows into a session file before it quits.
That session file contains a list of every window that's open, what files are open in each, their scroll position, selection, any unsaved changes to files, and so on. When you restart Sublime, it loads the session file and restores its state back to what it was previously, seamlessly putting you back to where you were before.
One of the potentially unintended side effects of this is that the session is always restored every time you start Sublime. So if you have a project open in a window, and you quit, Sublime keeps a record that you had one window containing that project. If you start it and tell it to open the same project, it will first restore the session and then open the project, resulting in two windows.
As such, turning off hot_exit may solve this problem for you. When it's off, the session information isn't saved, and Sublime starts in a more or less "fresh" state every time. The downside to this is that you will be prompted to save all unsaved files, your list of open files is lost, etc. Depending on your use case, this may or may not be an issue.
If you already have that setting off and this still happens, then the issue would be that GitHub for Windows is opening both the project and the folder, which would result in two windows. In that case there's not a lot to do but poke the people in charge of GitHub for Windows and tell them to fix their code.
On the other hand, if you turn off hot_exit and you get one window, but it doesn't respect your project preferences, then the problem is that GitHub for Windows is only opening the folder, not the sublime-project file.
In that case, there's not a whole lot to be done, unfortunately. Sublime won't load a sublime-project file just because it happens to be contained in a folder, since there can conceivably be many of them in there (many people keep their project files in a single folder, for example).
If Sublime is associated with sublime-project files, then opening the sublime-project file would result in Sublime opening the project for you, so that may be a possibility as well.
Beyond that, you're more or less in the realm of things like using Project > Switch Project or Project > Quick Switch Project to get the window to display what you want; that's not very handy with regards to just opening the project, though.

Which text editor can be able to properly display the storage files created by the CodenameOne Netbeans plugin in linux?

Which Linux text editor can be used to view the hidden files created by the CodenameOne simulator? I have tried the default Gedit and Notepadqq but the text appears gibberish while on Windows it is legible even with the default note.exe app in a human-readable way. I am running Netbeans 10 on Ubuntu 18.10.
This highly depends on the file you are editing but if you are editing the preferences file then you would break it. It's a binary file that shouldn't be edited with text editing software. Some characters that are visible on the Linux editors might be hidden on notepad. But they would still be there.

How can I open sublime text 3 without restoring or saving projects as a one-time request?

My normal workflow is to have Sublime Test 3 re-open the last opened project files; this works great for me, normally. But when I'm not at work, my laptop does not have access to the NFS shares, and when the projects get opened, all of the opened files disappear; this happens most often when I just need to jot down a quick note or something.
Is there a way, without editing user pref files, to open up the editor without loading the current projects as a one-off occurrence? Command-line solutions are fine, and may even be preferable.

Run code on file open in Sublime Text

I'd like to run some code in Sublime Text every time I open a file. Is there any way of doing this?
The background, if you want more context: I recently started using Sublime Text as my main editor, and although I love having Vim mode available through the Vintageous plug-in, I just want it to be available, not forcing its way into being turned on every time I open a file.
The author does not seem open to adding an option for being turned off by default--which is entirely okay: I'm not trying to be critical of his choices, and I'm glad he's made his code available to me--so it occurred to me that Sublime Text might offer some way of running some code every time you open a file. If so, I would simply run something that sets the mode to the normal Sublime Text mode (as opposed to Vim's "normal" mode).
You can run code in response to various events by creating a plugin and subclassing sublime_plugin.EventListener. The methods you would be most interested in are on_load() and on_new(). From there, you can either run an existing command, or you can make your own in a different class (probably subclassing sublime_plugin.TextCommand).

How can I programmatically save a Sublime Text 3 workspace (without a dialog box)?

I really want a way to switch programming contexts quickly without hunting for windows that I've left strewn about. What would be nice is a command line tool to let me switch between different patches that I might be working on, and automatically open the sublime text workspace that I had open the last time I was working on that patch. The issue is that in order for the tool to know about the workspaces associated with said patches, it either needs to be told about them explicitly, or it needs to be able to tell sublime to save the current workspace with a specific file path.
Sublime does have a save_workspace_as command, but it opens a saveAs dialog, which is not what I want, and I can't seem to find any documentation that suggests that save_workspace_as can take an argument.
Any ideas?

Resources