sublime 插件
转载:http://lucifr.com/2011/08/31/sublime-text-2-tricks-and-tips/
PackageControl安装包控制,按下Control+`,输入https://sublime.wbond.net/installation#st3中的内容
RailsLatestMigration:ctrl+shift+p打开最后一个migration
Babel:支持es6的js语法,开发react-native的时候用得着
JsFormat提供JS格式化功能,快捷键ctrl+alt+F
BracketHighlighter括号配对插件
clipboardhistory粘帖板历史,ctrl+alt+v触发
SCSS支持scss文件高亮
SublimeLinter实时检测语法是否有误,支持JavaScript,css,Coffee,PHP,Ruby,Java等各种语言,ctrl+alt+e可以手动检测是否错误,如果检测css和js需要安装node.js,然后使用node.js安装sudonpminstall-gjshint,sudonpminstall-gcsslint,sublime中需要安装SublimeLinter-jshint和SublimeLinter-csslint,这两个插件可以理解为SublimeLinter的插件,安装后在SublimeLinter的用户配置文件中配置,然后重启sublime。(如果检测ruby语法可以安装SublimeLinter-ruby)。配置在下方
gitgit插件,直接ctrl+shift+p来执行命令
sublimerubyonrailssnippets:railssnippets,https://github.com/tadast/sublime-rails-snippets
vuesnippets:vue代码提示
SublimeCodeIntel实时代码提示,不一样的是他可以直接提示函数,但是需要配置。编辑~/.codeintel/config,如果是配置ruby提示,那么如下:
{
"JavaScript":{
"javascriptExtraPaths":[]
},
"Ruby":{
"ruby":"/usr/bin/ruby",
"rubyExtraPaths":[]
}
}
AlignTab:自定义对齐,需要自己设置快捷键指定以什么符号对齐,快捷键代码如下
Alignment:格式化代码,ctrl+alt+a
KeymapManager:快捷键管理,ctrl+alt+K
SideBarEnhancements:丰富侧边栏右键操作
ColorPicker:取色,ctrl+shift+c
AllAutoComplete:让代码自动完成从所有打开的文件里去匹配,而不是只在当前文件里匹配。
ChangeQuotes:切换单引号和多引号,快捷键是Command+Shift+.
BeautifyRuby:Ruby语法支持,ctrl+alt+k两次,ctrl+alt+j
FavoriteFiles:收藏文件功能,保存一些常用的文件,方便快速打开编辑,快捷键是Command+Shift+,。
ZenCoding:快速编写HTML/CSS代码,ctrl+alt+enter,已经不再更新
emmet:快速编写HTML/CSS代码,ctrl+alt+enter,http://www.gbin1.com/technology/html/20130117-tips-for-emmet/
tag:Tag自动排布格式插件)
ctags:快速定位方法,选中方法,安装完后,先执行ctrl+t和ctrl+r才会生效,ctrl+shift+鼠标左键(ctrl+t,ctrl+t),跳转至该方法,再按ctrl+shift+鼠标右键(ctrl+t,ctrl+b)会跳转回来。
sublimetab转换空格:打开首选项-》设置用户,编辑
{
"translate_tabs_to_spaces":true,
"tab_size":2
}
启用vim:
修改首选项-配置用户,"ignored_packages":["vim"]
个人配置:
{
"fade_fold_buttons":true,
"font_face":"monaco",
"font_size":9,
"highlight_line":true,
"save_on_focus_lost":true,
"ignored_packages":
[
"vim",
"SublimeCodeIntel"
],
"tab_size":2,
"translate_tabs_to_spaces":true,
"trim_trailing_white_space_on_save":true,
"caret_extra_top":1,
"caret_extra_bottom":1,
"caret_extra_width":1
}
快捷键配置:
[
{"keys":["ctrl+e"],"command":"move_to","args":{"to":"eol","extend":false}},
{"keys":["super+alt+down"],"command":"goto_definition"},
{
"keys":["control+alt+;"],"command":"align_tab",
"args":{
"user_input":":/f"
}
},
{
"keys":["control+alt+="],"command":"align_tab",
"args":{
"user_input":"=/f"
}
},
{
"keys":["control+alt+."],"command":"align_tab",
"args":{
"user_input":"=>/f"
}
},
{"keys":["alt+shift+f"],"command":"reindent"}
]
sublimeubuntu下快捷键配置:
[
{"keys":["shift+alt+up"],"command":"swap_line_up"},
{"keys":["shift+alt+down"],"command":"swap_line_down"},
{"keys":["shift+alt+d"],"command":"duplicate_line"},
]
SublimeLinter配置:
{
"user":{
"debug":false,
"delay":0.25,
"error_color":"D02000",
"gutter_theme":"Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes":[],
"lint_mode":"background",
"linters":{
"csslint":{
"@disable":false,
"args":[],
"errors":"",
"excludes":[],
"ignore":"",
"warnings":""
},
"jshint":{
"@disable":false,
"args":[],
"excludes":[]
},
"ruby":{
"@disable":false,
"args":[],
"excludes":[]
}
},
"mark_style":"outline",
"no_column_highlights_line":false,
"passive_warnings":false,
"paths":{
"linux":[],
"osx":[],
"windows":[]
},
"python_paths":{
"linux":[],
"osx":[],
"windows":[]
},
"rc_search_limit":3,
"shell_timeout":10,
"show_errors_on_save":false,
"show_marks_in_minimap":true,
"syntax_map":{
"html(django)":"html",
"html(rails)":"html",
"html5":"html",
"javascript(babel)":"javascript",
"magicpython":"python",
"php":"html",
"pythondjango":"python",
"pythonimproved":"python",
"scss":"css"//支持scss文件中检测css格式
},
"warning_color":"DDB700",
"wrap_find":true
}
}
使用技巧:
全局搜索的时候我们需要过滤掉某些文件,例如log,此时可以在全局搜索的where中输入如下的命令,逗号隔开:-*.js,-*.css,-*.css.erb,-*.json,-*.log,-*.cache
ubuntu下sublime默认字体空格宽度太窄,可以使用字体Inconsolata
ubuntu下sublime支持中文(fcitx输入法):http://www.jianshu.com/p/bf05fb3a4709
如果最后依然不支持中文,输入命令sudofind/-namesublime*,找到所有的sublime_text.desktop,依次修改,之前修改的肯定不是现在使用的图标
ubuntu下sublime支持ibus:http://www.mamicode.com/info-detail-1378242.html
autofilename:路径提示
react:react开发相关插件
react-native-snippets:reactnative的代码片段,https://github.com/Shrugs/react-native-snippets
reactSnippets:react代码提示插件
Anaconda:python开发非常重要的插件
anaconda配置如下:
配置文件:preferences->packagesettings->anaconda->settings-user
{
"python_interpreter":"/Users/zhangcaiyan/.pyenv/versions/3.6.1/bin/python",
"complete_parameters":false,//自动补全函数时是否匹配必要参数
"complete_all_parameters":false,//自动补全函数时是否匹配所有参数
"suppress_word_completions":false,//禁止代码补全
"suppress_explicit_completions":false,//禁止精确补全
"auto_formatting":true,//代码格式检查
"enable_docstrings_tooltip":false,//显示文档
"enable_signatures_tooltip":false,//在悬浮窗中显示方法签名
"anaconda_linting_behaviour":"save-only",
"display_signatures":false,//显示方法签名
"anaconda_linting":false
}