Sublime Forum

Automate keypress on file open

#1

Let’s see if I can ask this question clearly (not a programmer, so…):

I use a key binding tied to a little python script to change the width of my line wrap. I find I’m using that key binding toggle on almost every text file I open, and I’m wondering how/whether a particular keypress (in this case, alt+e) can be automated to run every time I open a txt file. I don’t want that change to be permanent–I still want the toggle to be available if I want to change the wrap width to its other state–but I’d like my txt files to open with the toggle state I like best.

Does that make sense?

0 Likes

#2

Why not just set the default wrap with in the settings?

1 Like

#3

Thanks. That makes a lot of sense. I can probably figure that out. It’s also a wrap that responds to varying widths of the window, keeping everything in view. I’ll poke at it.

0 Likes

#4

That solved it, of course. Thanks. In settings I have default wrap width of 70 and implemented “wrap_width_style”: “min”

Such a noob. I overlook the most obvious things sometimes.

0 Likes