简体   繁体   中英

In Sublime Text 3, can I send a selection of a do file to Stata?

This SO question led me to try Sublime Text 3 as a replacement for Stata's do file editor on Linux (full instructions here ).

Syntax highlighting works and a Ctrl+B shortcut sends the whole do file to Stata.

Is there a way to send only a selection of lines to Stata?

Yes you can. First you need to find the name of the python function that does it. For the SublimeStata Enhanced package , it corresponds to the function text_2_stataCommand in the file text_2_stata.py.

Second, you need to add a shortcut for this function in the Key Binding user file, where you put the function name in the command field (the suffix Command must be removed and separations are indicated by underscores instead of capital letters).

{ "keys": ["super+shift+b"],
"command":"text_2_stata",
"context": [
{"key": "selector", "operator": "equal", "operand": "source.stata"},]
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM