Sublime Forum

ST3 EditPreferences

#1

Initial port of EditPreferences to ST3

[pre=#0C1021]
{ “caption”: “Edit Preference: List Settings”, “command”: “list_settings”},
{ “caption”: “Edit Preference: List Plugins Commands”, “command”: “list_commands” },
{ “caption”: “Edit Preference: List Shortcut Keys”, “command”: “list_shortcut_keys”},

{ "caption": "Edit Preference: Theme",
  "command": "edit_package_files",
  "args": {"pref_type": "sublime-theme"}},

{ "caption": "Edit Preference: sublime-completions",
  "command": "edit_package_files",
  "args": {"pref_type": "sublime-completions"}},

{ "caption": "Edit Preference: sublime-build",
  "command": "edit_package_files",
  "args": {"pref_type": "sublime-build"}},

{ "caption": "Edit Preference: sublime-mousemap",
  "command": "edit_package_files",
  "args": {"pref_type": "sublime-mousemap"}},

{ "caption": "Edit Preference: sublime-menu",
  "command": "edit_package_files",
  "args": {"pref_type": "sublime-menu"}},

{ "caption": "Edit Preference: tmTheme|colorscheme",
  "command": "edit_package_files",
  "args": {"pref_type": ".*\\.(tmTheme|stTheme)$"}},

{ "caption": "Edit Preference: tmLanguage|syntax|grammar",
  "command": "edit_package_files",
  "args": {"pref_type": ".*\\.((tm|st)Language)$"}},

{ "caption": "Edit Preference: sublime-commands",
  "command": "edit_package_files",
  "args": {"pref_type": "sublime-commands"}}

// COMMANDS THAT HAVENT BEEN PORTED TO ST3 YET
// { "caption": "Edit Preference: List Menus",            "command": "list_menu_bindings"}

][/pre]

MRF

Update [size=85](Sat 02 Feb 2013 04:57:54 PM )[/size] : Added a dodgy generator based filter to strip comments and trailing commas as allowed by sublime json variant

Update [size=85](Fri 01 Feb 12:00:25 PM )[/size] : A fix for list_commands to properly get the package name
Update [size=85](Fri 01 Feb 2013 12:00:25 PM )[/size] : Initial, part featured, port of edit_package_files commands to ST3
Update [size=85](Thu 31 Jan 2013 07:01:05 PM )[/size] : Fixed windows path related bugs
Update [size=85](Thu 31 Jan 2013 06:22:02 PM)[/size] : Added list_shortcut_keys back in.

0 Likes

#2

http://ndudfield.com/zencoding/old/editprefs-settings.gif
http://ndudfield.com/zencoding/old/editprefs.gif

0 Likes

#3

If anyone is bored and wants to contribute to this, a simple processor (don’t think simple regex would work) that strips out comments and trailing commas would be sweet.

0 Likes

#4

For stripping comments and trailing commas from JSON? I already have that github.com/facelessuser/PlistJs … file_strip

I do it simply by feeding the content through this:

j = sanitize_json(content)

Feel free to use it if you like.

Edit: Probably not Python 3 compatible yet, but I imagine it could easily be brought into compliance.

0 Likes

#5

Beauty, how does it strip?

I need it to replace any stripped characters with spaces so as to keep the character indexes correct for navigation

At a glance it doesn’t seem to?

0 Likes

#6

Wrote a shitty generator based one, with a conditional tree that seems to mirror the something about something. Seems to work … ?

Meanwhile in Cambodia:
So you got a headache? How bout we scratch the shit out of your chest then stick 62 suction cups on your back a few times?

0 Likes

#7

Spewing, the matching doesn’t really work with the soft columns any more

Worked a lot nicer in ST2

The results are just misleading now if you aren’t paying careful attention

0 Likes

#8

[quote=“castles_made_of_sand”]Beauty, how does it strip?

I need it to replace any stripped characters with spaces so as to keep the character indexes correct for navigation

At a glance it doesn’t seem to?[/quote]

Never needed to preserve columns with spaces. Lines is about all I ever needed to preserve. At work I use something similar to this in tools when I need to search for things in C source code and avoid false positives found in comments. Usually I just need to know what line the target is found on, not column. I am sure it could easily be adapted to replace with spaces instead, but it appears you have moved on anyways with a new approach.

0 Likes

#9

I waited a bit for you to swoop in with the change :smile: The regex were too scary at a glace for me to try myself.

0 Likes

#10

Yeah, I’ve been moving a bit slow recently :smile:.

0 Likes

#11

Tell me about it :smile: Struggling to find energy these days.

I hit 30 a year back, put on 20kg and nothing has been the same since.

0 Likes

#12

Was using ST3 today so made a few more tweaks on this

I just pushed an update to this

Reweighted columns to make it more likely that useful information is at the front

That seems more more sensible given the fuzzy matching changes in ST3

0 Likes

#13

http://ndudfield.com/zencoding/old/extract-snippets.gif

Restored yee old extract snippet command

The split_extents sticky auto selection stuff is part of NaturalSelection

Will get around to some docs one of these days ( still moving house to ST3 )

0 Likes

#14

Hi, this looks like some super-powerful black magic you’ve got going on here, but the language used to describe this seems to be on a higher level than I am used to.

For instance what is a “binding repr”? What does repr stand for?

Could you put in more english/layman-terms what this plugin does? I’d love to know.

0 Likes

#15

By repr I mean representation. In the sublime-keymap files, you will find json structures, where a given key short cut is described using a keys entry.

In the following binding {"keys": "ctrl+alt+shift+t"], "command" : "insert_date"} the keys value is a list containing a repr of one key combination. [size=85](The reason for a list? It may be a an emacs style binding ctrl+x, ctrl+s)[/size]

The EditPreferences package has commands for listing all the bindings, aggregated from all sublime-keymap files in a quick panel. Upon selection of an item, you are taken to the location in the corresponding file so you can edit it.

When this panel is shown, a special key is bound so that it escapes the subsequent keypress, such that in lieu of running the normal binding, it will insert a repr (representation) of the keys pressed into the quick panel. This saves you the tedium of typing in c t r l + … ( I can’t even be bothered finishing … )

The QuickPanel normalises all the keys shown such that shift+ctrl+d will show in the panel as ctrl+shift+d

0 Likes

#16

This is pretty damn meta, and that’s awesome.

Not sure I need that much awesome yet. But I’ll be checking this stuff out soon, I can feel it.

0 Likes

#17

Haha, fair enough.

0 Likes

#18

You’re talking about a “port”, does an older ST2 variant exist? Because this looks awesome.

0 Likes

#19

ST2 ? lol, do people still use that old hunk of junk?

0 Likes