您的位置:首页 > 编程语言 > Lua

subslime lua开发环境配置

2015-01-01 00:01 363 查看
1安装 subslime text3

2 安装package control

点击打开链接

import urllib.request,os,hashlib; h = '2deb499853c4371624f5a07e27c334aa' + 'bf8c4e67d14fb0525ba4f89698a6d7e1'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)


3 自定义 Sublime Text 3 皮肤 Spacegray 和括号配对显示插件 BracketHighlighter 适配 base64-ocean.dark 色彩主题

用package control安装BracketHighlighter 和 Spacegray

3.1 BracketHighlighter 配置:

粘贴进
Preferences -> Package Settings -> Bracet Highlighter -> Bracket Settings - User

{
"bracket_styles": {
"default": {
"icon": "dot",
"color": "brackethighlighter.default",
"style": "outline"
},
"unmatched": {
"icon": "question",
"color": "brackethighlighter.unmatched",
"style": "outline"
},
"curly": {
"icon": "curly_bracket",
"color": "brackethighlighter.curly",
"style": "outline"
},
"round": {
"icon": "round_bracket",
"color": "brackethighlighter.round",
"style": "outline"
},
"square": {
"icon": "square_bracket",
"color": "brackethighlighter.square",
"style": "underline"
},
"angle": {
"icon": "angle_bracket",
"color": "brackethighlighter.angle",
"style": "underline"
},
"tag": {
"icon": "tag",
// "endpoints": true,
"color": "brackethighlighter.tag",
"style": "outline"
},
"c_define": {
"icon": "hash"
// "color": "brackethighlighter.c_define",
// "style": "underline"
},
"single_quote": {
"icon": "single_quote",
"color": "brackethighlighter.single_quote",
"style": "outline"
},
"double_quote": {
"icon": "double_quote",
"color": "brackethighlighter.double_quote",
"style": "outline"
},
"regex": {
"icon": "regex"
// "color": "brackethighlighter.quote",
// "style": "underline"
}

}
}


3.2 Spacegray 配置
Preferences -> Settings Users

{
"theme": "Spacegray Eighties.sublime-theme",
"color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme",
"font_face": "Monaco",
"font_size": 10.0,
"ignored_packages":
[
],
"word_wrap": false,
"highlight_line": true
}



4 中文乱码

“ConvertToUTF8”或“GBK Encoding Support”

5 打开包含文件夹
sidebar

6 安装配置lua环境

Lua For WIndows下载地址:http://luaforge.net/projects/luaforwindows/

7 subslime 编译环境


Tool->Build System->New Build System

{
"cmd": ["lua", "$file"],
"file_regex": "^(?:lua:)?[\t ](...*?):([0-9]*):?([0-9]*)",
"selector": "source.lua"
}



ctrl + s将文件保存为lua.sublime-build,保存到默认位置即可。


Tool->Build System,勾选lua为默认选项即可。


ctrl + n新建一个lua文件,输入

ctrl + n新建一个lua文件,输入


ctrl + b运行,这个时候我们就能在控制台看到输出"hello world"啦!

7 cTags

cTags是一个用于从程序源代码树产生索引文件(或tag文件),从而便于文本编辑器来实现快速定位的实用工具。安装了这个插件以后,通过快捷键ctrl
+ t,ctrl + r来生成索引文件,在索引文件生成后,可以通过快捷键ctrl + 鼠标左键来跳到函数定义的地方,通过ctrl + 鼠标右键跳回上一次编辑的地方。这个功能在阅读代码时十分有用。(cTags快捷键及详情

8


2014 年 9 个最佳的 Sublime Text 2/3 主题

http://www.oschina.net/news/55190/best-sublime-text-2-and-3-theme-for-2014
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: