Questions tagged [sublimetext-snippet]

Related to the creation of code snippets in Sublime Text editor

This quote from the Unofficial Documentation sums it up:

Whether you are coding or writing the next vampire best-seller, you’re likely to need certain short fragments of text again and again. Use snippets to save yourself tedious typing. Snippets are smart templates that will insert text for you and adapt it to their context

47 questions
0
votes
1 answer

How to detect in keybindings if sidebar is open?

I'd like cmd+1 to alternate between reveal in sidebar (if closed) and if sidebar is open, close it. if closed: { "keys": ["super+1"], "command": "reveal_in_side_bar"} if open: { "keys": ["super+1"], "command": "toggle_side_bar" } I don't know how to…
Adam
  • 3,415
  • 4
  • 30
  • 49
0
votes
1 answer

Livereload snippet throwing error

I'm using the livereload plugin with SublimeText3 and when I open SublimeText get this error: Error parsing snippet xml: expected > in filePackages/User/livereload.sublime-snippet on line:6 Here's the code:
BruceWayne
  • 22,923
  • 15
  • 65
  • 110
0
votes
1 answer

Snippet-style tab stop to jump to right of auto-completed closing bracket in Sublime?

When I open a bracket, sublime adds a closing bracket for me, placed immediately to the right of the cursor. I'm fine with that. However, I'd like to be able to type inside these brackets, then be able to hit tab to jump immediately to the right of…
mwal
  • 2,803
  • 26
  • 34
0
votes
1 answer

Autocompletion list RESET when typing a dot on SublimeText

I implemented a SublimeText autocompletion plugin: import sublime_plugin import sublime tensorflow_functions = ["tf.test","tf.AggregationMethod","tf.Assert","tf.AttrValue", (etc....)] class TensorflowAutocomplete(sublime_plugin.EventListener): …
0
votes
0 answers

Sublime Text 3 snippet with two underscores not working

I created this snippet for ST3 which should be triggered by typing two underscores: __('${1:TEXT'); ?> ]]> __ Whenever I type the two underscores…
RSeidelsohn
  • 1,149
  • 18
  • 33
0
votes
1 answer

Sublime Text 3 path snippet issue

I just want to select 'folder*' and 'filename' to edit but I can't, below code does not work for me. This file path with screenshot. So I just try to write snippet code for 3 fields like…
Max-Enrik
  • 61
  • 13
0
votes
1 answer

Sublime Text 2 snippet all-caps when typing in fields

I want to simplify the typing of this: export const RECEIVE_POSTS = 'RECEIVE_POSTS' I then came up with this snippet:
The questioner
  • 724
  • 10
  • 21
0
votes
1 answer

How to remove all sublime snippets for a particular tab trigger?

I used to have 4 entries for the do sublime snippet tab trigger. I followed the technique described in another post, by renaming the appropriated files in the ruby package directory: Ruby ❯ pwd /Users/max/Library/Application Support/Sublime Text…
mbigras
  • 7,664
  • 11
  • 50
  • 111
0
votes
1 answer

How to add literal CDATA tags to a sublime text snippet file?

is there any way to add tags to the content of a Sublime Text snippet? CDATA tags are used by Sublime Text to distinguish between the snippet XML and the actual snippet content. I have not been able to get it to work except for
mamift
  • 651
  • 7
  • 18
0
votes
1 answer

How to create a snippet for html in Sublime Text?

I made a snippet which works on other scopes, but won't with html. When i'm typing "test" just nothing happens. Why? test text.html
Parki
  • 159
  • 9
0
votes
1 answer

HTML Snippets not working in Sublime Text 3

I created the following snippet in Sublime Text. It seems doesn't get triggered by the tab. If I change the contents to some other language, or some plain text, it is working. For html, it doesn't work. Any help is appreciated.
Sibidharan
  • 2,717
  • 2
  • 26
  • 54
0
votes
1 answer

Sublime Snippet, if no regex match use "null" string

I'm trying to write a snippet. For this post I super simplified it. If I run it on this selection: arg1 the snippet should output: doFunc('arg1', 'null'); if I run it on this selection: arg1, arg2 the snippet should output doFunc('arg1', arg2); I…
Noitidart
  • 35,443
  • 37
  • 154
  • 323
0
votes
0 answers

Sublime snippet does not tab complete after deleting previous snippet

In SublimeText 3 build 3083, tab completion of snippets breaks under odd conditions. Repro steps are: Tab-complete a snippet (let's say co --> console.log(this), but any will do) Then change my mind delete it with ctrl+shift+k Then add a new line…
tyleha
  • 3,319
  • 1
  • 17
  • 25
0
votes
2 answers

How to display dropdown list of sublime-snippets in html files

I have created a libary with about 80 sublime-snippet's. They work great on my machine which is the machine I created them on. I then passed my folder out to two of my fellow employees so that they could use the new library of snippets I created.…
zz Rot
  • 1
  • 2
0
votes
1 answer

Sublime snippet not scoping to HTML

I have the following snippet: Name: ]]>