Sublime Forum

Disable lorem ipsum

#1

I use Sublime Text 3 on my Macbook at work to take notes. I have enabled text suggestions for plain text, and now whenever I type the letter “l”, it predicts a chunk of lorem ipsum instead of a word I’ve actually typed. How can I turn this off?

0 Likes

#2

In order to modify that behaviour, you need to modify the snippet that’s providing the lorem ipsum completion. To do that, the easiest way would be to use PackageResourceViewer.

With that package, select PackageResourceViewer: Open Resource from the command palette, then pick Text, Snippets and lorem.sublime-snippet in order to open the snippet. The result looks like this:

<snippet>
    <description>Lorem ipsum</description>
    <content><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content>
    <tabTrigger>lorem</tabTrigger>
    <scope>-source</scope>
</snippet>

Depending on your needs, you can edit this in a variety of ways:

  1. To remove the snippet entirely (disabling it throughout Sublime as a whole), delete the entire contents of the snippet so that the buffer is empty
  2. To change the trigger that fires it, change the <tabTrigger> from lorem to something else
  3. To remove the tab trigger and make the snippet only available from the command palette, remove the entire <tabTrigger>lorem</tabTrigger> line
  4. To disable the snippet in plain text but keep it for other text files (e.g. HTML files), modify the <scope> pattern from -source to -source, -text.plain

Once you’ve made the change, save the file. This will create a new folder in your Packages folder named Text/Snippets and place your modified lorem.sublime-snippet in it’s place. Since that shadows the file that appears in the package, Sublime will use it instead of the original version.

To go back to the original behaviour you can open up the file as above and reverse your changes or select Preferences > Browse Packages from the menu, then go into the Text/Snippets folder and delete the lorem.sublime-snippet file, which will make Sublime use the original version again (after you restart Sublime).

2 Likes

#3

Unfortunately, I do not have access to that package. Is there any other way?

0 Likes

#4

If you can’t install that package, you can select Preferences > Browse Packages, then manually create a folder in it named Text, then a folder inside that named Snippets, then create a file inside that folder named lorem.sublime-snippet with the above contents, edited as desired. The case of the folder and file names should be as seen here; although on a Mac (or Windows) your file system is probably not case sensitive, it’s a good habit to keep the files similarly cased to avoid potential future upsets.

Using PRV is just a shortcut for having to manually create the folder structure and file content.

0 Likes

#5

That still didn’t work. I tried defining the snippet with some nonsense content, removed the tabTrigger, and added , -text.plain to the scope. It still has “Lorem ipsum” as the first prediction for the letter l.

0 Likes

#6

I would verify that the path name is Packages/Text/Snippets/lorem.sublime-snippet; as a test, if you revert the snippet back to the content listed above, you should see lorem only appear once in the list; if it appears twice, the path isn’t right.

0 Likes

#7

That seems like the correct path. My full path is Macintosh SSD/Users/<me>/Library/Application Support/Sublime Text 3/Packages/Text/Snippets/lorem.sublime-snippet. When I put your above snippet in, I do indeed get two Lorem ipsum entries.

0 Likes

#8

Hmm, that’s interesting. I would agree that that seems like the right path… Sublime only ships with the one lorem snippet, so possible causes for something like this would be if you have a copy of the snippet in your User folder or perhaps a third party package has also included one (although that seems weird in general since there is one built in).

Something to try would be to open the Sublime console (View > Show Console or Ctrl+` and enter this command to see what it says:

>>> sublime.find_resources("lorem.sublime-snippet")
['Packages/Text/Snippets/lorem.sublime-snippet']

If it shows more than one item that would pinpoint where the duplicate is coming from; this presumes that the snippet has the same name as the default one, though.

0 Likes

#9

It turns out I mis-typed the path before. I’d put my lorem.sublime-snippet in Packages/Text, leaving off the Snippets directory. Once I created that and put the snippet there, everything worked as expected. Thanks for the help.

0 Likes