@lumincinta
2017-01-31T16:10:30.000000Z
字数 5856
阅读 284
SublimePlugin
Stata
- install the Pywin32 package from Package Control.
- install the StataEditor package from Package Control.
- 创建StataMP-64.exe 快捷方式;
- 在快捷方式中,选择属性,在目标(T)的文件地址之后添加/Register(或添加/UseRegistryStartin也可以)例如:
"D:\stata13\StataMP-64.exe" /Register
Stata设置:
Do-fileEditor -> Edit -> Preferences -> Advanced -> Edit do-files opened from Windows instead of executing them
CTRL+D
或者ctrl+R
运行
- install the Theme - Nil package from Package Control.
在Preferences -> Settings - User)中,可以做以下调整,解决do-file-editor无法直接修改行距的问题。
{
"color_scheme": "Packages/Nil-Theme/Big Duo.tmTheme",
"font_size": 11.0,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 2,
"line_padding_top": 2,
"update_check": false,
"word_wrap": "auto"
}
在Preferences -> keybinding - user中可以参照key binding - defult中的设置复制修改,例如将ctrl+D运行可改为f12键。
[
{ "keys": ["f12"],"command": "stata_execute","args": {"Mode": "do"},"context":
[
{ "key": "selector", "operator": "equal", "operand": "source.stata" }
]
},
{ "keys": ["ctrl+r"], "command": "stata_execute", "args": {"Mode": "run"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "source.stata" }
]
}
]
标签(空格分隔): SublimeText3
将下面的代码保存为 sublime_addright.inf 并放在 Sublime Text 3 的安装目录下。
[Version]
Signature="$Windows NT$"
[DefaultInstall]
AddReg=SublimeText3
[SublimeText3]
hkcr,"*\\shell\\SublimeText3",,,"用 Sublime Text 3 打开"
hkcr,"*\\shell\\SublimeText3\\command",,,"""%1%\sublime_text.exe"" ""%%1"" %%*"
hkcr,"Directory\shell\SublimeText3",,,"用 SublimeText3 打开"
hkcr,"*\\shell\\SublimeText3","Icon",0x20000,"%1%\sublime_text.exe, 0"
hkcr,"Directory\shell\SublimeText3\command",,,"""%1%\sublime_text.exe"" ""%%1"""
然后右键点击“安装”,即可。
This package provides the ability to write and run Stata code from Sublime Text 3 (ST3). Features in this package include:
This package only works on Windows machines. To use Stata with Sublime Text on OS X, try Stata Enhanced. StataEditor has been tested on Sublime Text 3 together with Stata 13 and Stata 14 on Windows 7 and Windows 8. I have very briefly tested it on Stata 11 and Stata 12 and it seems to be working.
To install the package follow the steps outlined below. You can install StataEditor without Package Control, but in that case you probably already know what to do.
Stata 14 has unicode support and uses utf-8 encoding just as ST3. Earlier versions of Stata do not have unicode support. Therefore, if you write Stata code containing non-ASCII characters in ST3, you may notice that these characters have been replaced with nonsense when you open the file in Stata's native do-file editor (versions 13 and earlier). This problem is easily avoided by saving your file with a different encoding in ST3: Simply open "File -> Save with encoding", and choose Western (Windows 1252) (or another appropriate encoding). If your Stata version uses a different encoding than Windows 1252 (again, only Stata 13 and earlier), it is possible to change encoding by going to the settings file (see step 4 under "Requirements and Setup" above) and change the character_encoding option. For a list of encodings to use, see the following link
Thanks to Adrian Adermon and Daniel Forchheimer for helpful suggestions and to Sergio Correia for providing additional key bindings.