Cmd + S of TeX file in Sublime Text turns off spell check [MacOS] [duplicate] - sublimetext3

This question already has an answer here:
Sublime Text - spell check but only certain file extensions
(1 answer)
Closed 4 days ago.
Problem
I have been experiencing this weird effect where every time I press Cmd+s to save a .tex file, the spell check gets disabled.
I tried ...
This bug is not there in other file types (tested on .txt, .py, .bib, .nml)
Builds
I use Sublime Text build 4143 on MacOS Monterey 12.6.3. and I edit .tex files to build documents using the Sublime package called LaTeXing 1.4.0.
Any hints are appreciated.

The procedure in the link pointed out in the comments by #Parthis worked for me.
In short:
Open a .tex file (or whichever file you want to keep the spell check on).
Go to Preferences > Settings - Syntax Specific. This will open a settings file specific to .tex. Mine was blank with only { }.
Add "spell_check": true between the { }
Now my spellcheck is not affected by Cmd+s anymore!

Related

How to change the default working directory in vim permanently (on windows 10)?

Although this question is similar, answer given over there changes the working directory only temporarily i.e. whenever I close and reopen gVim and write a new file given just the filename, it saves it in the home directory.
Here is another similar question, but I didn't get what the answer is trying to say. I found a _vimrc file at C:\Program Files (x86)\Vim. But I don't know what to do with it.
I want to achieve this:
Whenever I open vim and write a new file, given only the filename, it should save it in C:\Users\Sourav Kannantha B\Documents\Vim Projects instead of C:\Users\Sourav Kannantha B
I just downloaded gVim today from their website. So I am new to this.

control+/ does not work to comment multi line in sublime 3

I can't comment out multi line in sublime 3. Looked at this Keyboard shortcut to comment lines in Sublime Text 3 already but it is not fixing it
Sublime version is 3.2.1 build 3207 . on windows 10.
Please help me out if have any tips.
The keyboard binding for commenting is indeed Ctrl+/ (Cmd+/ on MacOS) so in the general case what you're trying should work just fine.
That said, the keys in question are bound to the toggle_comment command and that command requires language specific metadata to know what comments are supposed to look like. For example comments look and work differently in HTML than they do in C or JavaScript. Some file types (such as plain text files) aren't code and thus don't have a concept of comments at all.
If the metadata file for a file type is missing, then the toggle_comment command won't do anything because comments are assumed to not be valid, which seems to be what's happening to here.
The first thing to check would be to examine the bottom right of the window to see if Sublime agrees with you about what the file type is supposed to be. For example, newly created tabs are Plain Text files until you save the file for the first time, and comments are not allowed in Plain Text files.
If the file type doesn't say what you think it should, you can click it to open a menu and select the appropriate type for that file.
If the type of the file looks to be correct and the command still doesn't work, then the metadata file needed is not being provided in the package that is adding support for that language. In that case you should raise an issue with whoever is responsible for the package in question and get them to add the appropriate file.
Based on the comments on your question, you think you're editing JavaScript files but Sublime thinks you're editing an ActionScript file instead. The JavaScript package includes the appropriate file, but the ActionScript package does not.
So in your particular case, your best bet is to switch the file type to JavaScript and your problem should go away. If you actually want to be editing ActionScript instead, then you need to create an issue on the Default package tracker and ask for this to be added.

How are MacVim's settings related to .swp files unique from other versions of Vim and how can I override them?

I have been using Vim casually for around 3 years (mostly for git commit messages) and recently started using it exclusively for text editing and coding while I work my way through a series of intermediate tutorials and resources. Up until a few weeks ago, I primarily used either Vim, NeoVim or iVim (on iOS).
Recently I installed MacVim and started using it exclusively when I'm working in iTerm on a Mac. I have noticed some differences in the way .swp files are created and managed. In the other versions of Vim that I have used, .swp files are only created when I have a file open in more than one instance of Vim at the same time. It seems that MacVim creates .swp files for every open file (I'm guessing for backup/restore purposes). MacVim also seems to put .swp files into the working directory. I don't recall other versions of Vim doing this but it recently led me to add *.swp to my global Git ignore settings.
Before drafting this question I did a quick search for: vim macvim swp files and found one result that gave me a few ideas on how to work around one of the issues that I've noticed:
Vim Swap Files Not Deleting
I also found this post that gives the impression that the following settings are involved:
backup / nobackup
writebackup / nowritebackup
swapfile /noswapfile
But this doesn't really answer my question, which is "What is different?". I am editing my .vimrc regularly and would like to add in the appropriate settings to get the same behavior in MacVim by default (while also understanding what I am adding). What is unique about the way MacVim is setup related to swap files? Is there a specific combination of the three settings mentioned above or are more settings involved? How can I set up the same default behavior I have noticed in Vim, NeoVim, and iVim?
I have read the MacVim FAQ and Troubleshooting Guide but didn't find any relevant information.
The default location for a swap file is determined by :help 'directory'. Given the default value, Vim will try the directory of the file for which the swap file is created first, appending the .swp extension. If it can't create the swap file there, it will try the next location in 'directory':
The file:
_posts/2018-07-31-npm-201.markdown
The swap-file:
_posts/2018-07-31-npm-201.markdown.swp
If a swap file already exists for a file you are trying to edit and you decide to edit it anyway, another swap file is created at the same location, with a different extension: .swo, .swn, etc.
What I described above is the normal, expected, behaviour. And that's how MacVim works.
In the other versions of Vim that I have used, .swp files are only created when I have a file open in more than one instance of Vim at the same time.
Those "versions of Vim" are either:
broken,
weirdly configured,
not Vim.
It seems that MacVim creates .swp files for every open file (I'm guessing for backup/restore purposes).
You guessed right, and yes, that's the expected behaviour in every Vim.
MacVim also seems to put .swp files into the working directory.
If the file is in the working directory it's normal. If it's not, the working directory may be part of 'directory'. If it's not, you have found a bug.
I don't recall other versions of Vim doing this but it recently led me to add *.swp to my global Git ignore settings.
It's very common to have a Vim section in there.

How to change the default syntax highlighting for new files in Sublime Text [duplicate]

This question already has answers here:
Sublime Text 2 Default File Type on new file
(3 answers)
Closed 6 years ago.
When I'm opening a new file (e.g. with Ctrl+N), the default Syntax in Sublime Text 3 is just Plain Text. I would like to change that into e.g. Markdown. (How) Is that possible?
I would like to avoid a "hacky" solution as proposed here:
creat a file in your Packages/User directory called
'default_syntax.py' or something, and add this:
import sublime, sublime_plugin
class DefaultSyntaxCommand(sublime_plugin.EventListener):
def on_new(self, view):
view.set_syntax_file('Packages/HTML/HTML.tmLanguage')
It is possible with the ApplySyntax Plugin. Once it is installed (e.g. via PackageControl), you can set the ApplySyntax User Settings like that:
"new_file_syntax": "Markdown/MultiMarkdown",
or
"new_file_syntax": "Markdown/Markdown",
depending on your installed Markdown syntax. Now if you open a new file, your default syntax will be Markdown.

Sublime Text 3 seems to block .LESS file from getting compiled by WinLess

Until today, I had been using Sublime Text 2 and WinLess software to compile .LESS files to CSS. The files got compiled automatically when I saved a file.
However since I upgraded to Sublime Text 3, automatic compiling has stopped. To see if its issue with WinLess, I tried editing the .less file in NotePad, and the automated compilation work.
So I am assuming Sublime Text3 seems to be locking file or something.
Anyone faced this or have any ideas to debug?
Try adding the following to your Preferences (Preferences -> Settings-User):
"atomic_save": false
See this question and my answer below for an explanation of what Sublime is doing behind the scenes when atomic_save is true (the default setting). Temp files are created and destroyed, and the original file is deleted and recreated. This could easily mess with a LESS compiler just looking for a simple file modification. Using the "atomic_save": false setting also dramatically decreases save time on some network setups.

Resources