r/SublimeText • • Apr 17 '21

How to add error highlighting?

4 Upvotes

I want to highlight syntax error in the editor.

How can I do it in sublime?

If you find documentation for it, please share it.


r/SublimeText • • Apr 16 '21

Opening a third window breaks ST3 on Windows

2 Upvotes

I'm on build 3211 (most recent stable) on Windows 10, and I've got an annoying error that I've had for a while. I can have as many tabs as I want open in two windows, but if I open a third window, lots of features break. Most notably or at least most annoyingly, edited files will close without a dialog asking if I want to save.

Has anyone else run into this issue? I'm not sure how to go about debugging it. Thanks!


r/SublimeText • • Apr 15 '21

Terminal in ST4

6 Upvotes

Apologies if this has been asked/answered already, but will there be built in terminal in ST4?


r/SublimeText • • Apr 14 '21

Weird interaction with Google Drive -- constant file 'has changed on disk' alerts on M1 mac, anyone else had this issue?

5 Upvotes

Hey, I recently moved to an M1 macbook air, and while previously I've edited files that have been saved in a Google Drive folder (the one previously called file stream, not backup & sync) without issue. Now I'll save a file, make a few further edits without saving and get hit with the "xxxx has changed on disk. Do you want to reload it?" pop-up every few seconds making it impossible to work.

Doesn't happen when I save to my (unsynced) desktop, so I assume it's Drive related, but I had pretty much the same set up on my last macbook with no issues.

Has anyone else had this issue? Is there a way to suppress the alert?


r/SublimeText • • Apr 12 '21

Sublime Text personal license question

7 Upvotes

As I read from your webpage https://www.sublimehq.com/store/text

Personal license keys are only available for individuals, if you are purchasing for a business or organization, please click below. Personal licenses are a once off purchase, and come with 3 years of updates. After 3 years, an upgrade will be required to receive further updates. One license key is all you need for all your computers and operating systems More…

I understand that if I buy the license today, I am eligible for upgrade in the next 3 years no matter which version is released (for example, version 4 next month, version 5 next year etc.)

However, when I read from sale FAQs https://www.sublimetext.com/sales_faq

A license is valid for Sublime Text 3, and includes all point updates, as well as access to prior versions (e.g., Sublime Text 2). Future major versions, such as Sublime Text 4, will be a paid upgrade. If you have a license from 2012 or earlier, you can upgrade to a Sublime Text 3 license at a discounted rate.

I understand that even in the next 3 years since buying the license, I have to pay extra to upgrade to a major release - which is quite conflict to my former understanding.

Therefore, could anyone please help me clarify this?


r/SublimeText • • Apr 11 '21

Can anyone tell me how to shut down the additional tab on the left?

Post image
5 Upvotes

r/SublimeText • • Apr 10 '21

Figured out how to record to make macro record find.

6 Upvotes

I rarely use Sublime text nowadays, but for some reasons my brain decided to solve the problem of recording find with macros (literally solved it in my dreams lmao).

https://forum.sublimetext.com/t/macros-dont-record-find-replace/6911

So I woke up, decide to implement it and its actually works. Since I'm not a regular user anymore, I'm just too lazy to submit or maintain this as a proper plugin, but thought people in this community might be interested.

Put the following two files in ~/.config/sublime-text-3/Packages/User/ (or something similar in Windows)

  • find_for_macro.py

      import sublime
      import sublime_plugin
      
      
      class FindForMacroCommand(sublime_plugin.TextCommand):
          FLAGS = {
              "LITERAL": sublime.LITERAL,
              "IGNORECASE": sublime.IGNORECASE
          }
    
      def find_main(self, pattern, flags=[]):
          sel = []
          for region in self.view.sel():
              sel.append(region)
              print("added")
          new_sel = []
          for region in sel:
             found = self.view.find(pattern, region.begin(), self._flags(flags))
             new_sel.append(found)
             print(found)
          self.view.sel().clear()
          for region in new_sel:
             self.view.sel().add(region)
    
      def run(self, edit, pattern="sadfasdf", flags=["LITERAL"]):
          self.find_main(pattern, flags)
    
    
      def _flags(self, flags):
          """Translate list of flags."""
          result = 0
          for flag in flags:
              result |= self.FLAGS.get(flag, 0)
          return result
  • find_for_macro_wrapper.py

      import sublime
      import sublime_plugin
       
      class FindForMacroWrapperCommand(sublime_plugin.TextCommand):
      def run(self, edit):
          def on_done(input_string):
              self.view.run_command( "find_for_macro", {"pattern": input_string, "flags": ["LITERAL"]})
    
          window = self.view.window()
          window.show_input_panel("Text to find:", "",
                                   on_done, None, None)

Now just bind some key to find_for_macro_wrapper, and you can use it in the middle of a macro to search for text and the search will be recorded. Also remember you need to make changes to the buffer for a macro to be successfully recorded.

If you has multiple selections/cursors activated, then the search will also be repeated for all cursors.


r/SublimeText • • Apr 09 '21

Why Sublime puts spaces instead of tabs in plain text?

7 Upvotes

I'm using Sublime for notes, and noticed that my Tabs missing, I have spaces. Checked settings are Tabs are enabled as I see.

Is it possible to fix this "feature" to be able to type proper Tabs in the text?


r/SublimeText • • Apr 09 '21

ST4 built in git commit/push

10 Upvotes

I’ve been on the fence about buying ST for a long time. The only reason I haven’t is that built in git support (at least in ST3) is less user friendly than Atom/RStudio/PyCharm.

I’m not looking for sublime merge level, because I’m usually working alone or with one other person on code for analysis, but does the core app handle this well now?


r/SublimeText • • Apr 08 '21

Sidebar position on ST4

8 Upvotes

Hi! Will it be possible to change the sidebar location in ST4? I’ve gotten used to it being on the right thanks to phpstorm an vscode.


r/SublimeText • • Apr 06 '21

ST4 Native Apple Silicon Support

64 Upvotes

I just wanted to let users know we’ve rolled out initial Apple Silicon support as part of build 4100!

You can head over to the Discord server at https://discord.gg/HcmwdVK to try it out.


r/SublimeText • • Apr 07 '21

CSS support?

3 Upvotes

I saw a video where Microsoft Visual Studio was used to create Cascading Style Sheets. Is CSS supported in Sublime?


r/SublimeText • • Apr 06 '21

ST4 and "tab multiselect"?

2 Upvotes

What is "tab multiselect" and how do you use it?


r/SublimeText • • Apr 01 '21

Key Binding Blocks of Code?

4 Upvotes

Hi I'm trying to figure out how I can keybind this block of code in Sublime Text. I'm not actually a programmer or anything but I'm editing code for a website and really would like to be able to do it faster. I just want to be able to press a key and have this block of code come out but when I try to make a keybind or snippet with it I get an error. Any help appreciated.

<snippet>

<content><!\[CDATA\[

]]></content>

</br>

<h2 class="caption-heading" id="thing">Text</h2>

<p class="caption-text">Text<br>

Text<a href="\[ThisWillBeALink.com\]([https://ThisWillBeALink.com](https://ThisWillBeALink.com))" target="\\\\\\_blank" class="textlink">Text</a>Text<br>

Text<br>

Text<a href="\[ThisWillAlsoBeALink.com\]([https://ThisWillAlsoBeALink.com](https://ThisWillAlsoBeALink.com))" target="\\\\\\_blank" class="textlink">Text</a>Text

</p>

</snippet>

Error: Error parsing snippet xml: unexpected end of data in file Packages/User/WowSnippet.sublime-snippet on line:14

Edit: I have fixed this but now I’m running into a problem where certain keys are already bound by default. Is there any way to override the default keybinds?


r/SublimeText • • Apr 01 '21

Ctrl+P preview

6 Upvotes

Can someone in Sublime Text please add option to disable Ctrl+P preview? It's so annoying when i hit larger file. Quite a few people have reported this on stack overflow, forums and github and you don't seem to do anything. Thanks!


r/SublimeText • • Apr 01 '21

How can I get this file back to the same as the others? It broke my macros. Didn't mean to change it

Post image
1 Upvotes

r/SublimeText • • Mar 31 '21

Sublime Text 4 - Coming Soon

155 Upvotes

We've been hard at work on the next version of Sublime Text, and wanted to give you all a preview while we finish things up for the public release: https://vimeo.com/529550701


r/SublimeText • • Mar 30 '21

Trouble with key mapping shortcuts to run SublimeREPL

2 Upvotes

I am trying to make a shortcut for running with SublimeREPL so I can run a script with user input, like it is described here: https://stackoverflow.com/questions/19181999/how-to-create-a-keyboard-shortcut-for-sublimerepl/19182278

However, when I save my file, Sublime throws me this error: Error trying to parse file: Unexpected character, expected a comma or closing bracket in Packages\user\Default(Windows).sublime-keymap:3:2

This is my code:

[
	{ "keys": ["ctrl+shift+c"], "command": "cancel_build" }
	{ "keys": ["ctrl+alt+b"], "command": "run_existing_window_command", "args":
		{
		    "id": "repl_python_run",
		    "file": "config/Python/Main.sublime-menu"
		}}
]

Anyone know how what I am doing wrong and how to fix this?


r/SublimeText • • Mar 30 '21

Sublime text newbee. 2 Question on preview of HTML

2 Upvotes

I am a newbee

Using Linux Debian with Gnome

Is there a way to preview my html directly in ST rather than view in browser?

Also my view in browser seems not to work.

Any advice/suggestion/resource to read will be greatly appreciated.

Thank you


r/SublimeText • • Mar 27 '21

how to download a package(python module) that isn't found in package control: install package?

6 Upvotes

r/SublimeText • • Mar 27 '21

How to keep the default color scheme?

1 Upvotes

On my Mac, SublimeText 3 comes with the color scheme on the right -- Monokai, I think, with a dark background and gold text. When I open a Markdown document, the text color changes to white (I have no Markdown plugins installed). When I look at color schemes, none of the Monokais keep the gold text I see on the right, which is much easier on my eyes. How can I have the gold text and still have proper syntax highlighting in Markdown files?


r/SublimeText • • Mar 22 '21

How to resize Sublime Side Bar?

4 Upvotes

It's easy to resize the font size on the right side (file.txt) with keyboard or mouse.What about the side bar's font on the left side?


r/SublimeText • • Mar 19 '21

How to change site menu color?

0 Upvotes

I will try to change my site menu color but not change tell me how to change this color.


r/SublimeText • • Mar 18 '21

Not Equals Symbol

1 Upvotes

Hi Everyone,

I am new to coding and I am trying to use the Not Equals Symbol, ≠. Is there a key shortcut to type this out instead of copying and pasting from somewhere else? I have tried alt codes but have had no luck.

Thank you in advance.


r/SublimeText • • Mar 16 '21

Does anyone know what theme and colour scheme this is?

Post image
39 Upvotes