mattiasnordin / StataEditor

Stata Editor for Sublime Text 3
47 stars 18 forks source link

4 different "Do"-shortcuts #5

Open theodorius123 opened 8 years ago

theodorius123 commented 8 years ago

I'll post this here again. Maybe other people want to say something about this suggestion:

My suggestion: 4 different shortcuts for sending syntax to Stata:

  1. [without selection:] Send line / [with selection:] send selection
  2. sent from beginning of line to end of file
  3. sent from end of line to beginning of file
  4. sent whole do-file

For me, those 4 options are typical situations you run into using Stata.I did this with the rundo/rundolines from Friedrich Huebler and some macros in Sublime. Would love to see this in StataEditor. You should NOT make this the default, think people get confused and want the typical CTRL+D behavior.

mattiasnordin commented 8 years ago

Thanks for the suggestions, I might do something about that when I get the time. Do you think this should be done when running do-file noisily ("do") or quietly ("run")?

theodorius123 commented 8 years ago

Thanks! I don't like "run" at all so I would prefer "do". Let me know when you need beta-testing!

mattiasnordin commented 7 years ago

I just released version 0.8.0 which include some versions of your suggestions. Feel free to give some feedback on the changes!

apoorvalal commented 7 years ago

semi-related to this: Ctrl+d as do supersedes sublime's very useful multiple-selections feature http://docs.sublimetext.info/en/latest/editing/editing.html#multiple-selections

I've remapped do to ctrl+alt+d. At the cost of breaking consistency with Stata's do file editor, maybe consider an alternate keybinding?

mattiasnordin commented 7 years ago

Yes, it is a problem! My goal has been to make the transition from Stata's native do-file editor to StataEditor as seamless as possible. It comes at the cost of removing the useful native keybinding for ctrl+D. At this point, I still think it's better to keep it the way it is, because users who prefer ST:s original keybinding can always change it back as you did.

apoorvalal commented 7 years ago

That makes sense. In case others want to do this in the future, the binding change is :

  // resolves StataEditor Multiple-selection conflict
  { "keys": ["ctrl+alt+d"], "command": "stata_execute", "args": {"Mode": "do", "Selection": "default"}, "context":
    [
      { "key": "selector", "operator": "equal", "operand": "source.stata" }
    ]
  },
  { "keys": ["ctrl+d"], "command": "find_under_expand" },

https://github.com/apoorvalal/sublime-settings/blob/master/Default%20(Windows).sublime-keymap#L16