Skip to content

Instantly share code, notes, and snippets.

@stelonix
Last active August 29, 2015 14:26
Show Gist options
  • Save stelonix/1c55b8404fa189639e1b to your computer and use it in GitHub Desktop.
Save stelonix/1c55b8404fa189639e1b to your computer and use it in GitHub Desktop.
Configurações para o Sublime = Eclipse
Finalmente, agora eu tenho tudo quase perfeito com o Sublime, só me falta mesmo é um Outline para fechar de vez.
Segue relação dos plugins que estou utilizando com o Sublime, bem como minhas configurações:
O primeiro package a instalar é o Package Control. A partir dele é possível intalar todos os outros pacotes executando Cmd+Shift+P (ou Ctrl para quem usa Linux/Windows), e buscando por "Package Control:Install Package".
Para instalar o Package Control, execute as instruções contidas nesta página:
https://packagecontrol.io/installation
Agora, chame o comando de instalação de pacotes e instale os seguintes pacotes.
- BracketGuard
- BracketHighlighter
- DocBlockr
- Emmet
- HTML 5
- jQuery
- Package Control
- phpfmt
- Pretty JSON
- SideBarEnhancements
- SublimeCodeIntel
- SyncedSideBar
Para desenvolvimento com o Symfony, instale também:
- PHP-Twig
- Pretty YAML
- Symfony2 Snippets
- Twig
Instale agora o tema Spacegray Midnight, disponível em: https://github.com/phackwer/spacegray, fazendo o download como ZIP e descompactando-o dentro da sua pasta de Packages (busque browse packages no seu menu de preferências de acordo com sua plataforma - no Mac, Sublime Text > Preferences > Browse Packages), em uma pasta chamada "Theme - Spacegray".
Para a fonte, estou usando atualmente a Consolas com tamanho 14, mas a Andale Mono também é muito boa. Altere o tamanho da fonte de acordo com sua resolução e tamanho de tela. Estou usando um Mac de 17" 1920x1200, por isso esotu usando tamanho 14 atualmente.
Após instalar estes pacotes, configure seu ambiente para melhor apresentação do texto no Mac (no Windows, coloque outra fonte que lhe agrade) abrindo o arquivo de preferências do usuário e colocando o seguinte conteúdo:
{
"theme": "Spacegray Midnight.sublime-theme",
"color_scheme": "Packages/Theme - Spacegray/base16-midnight.dark.tmTheme",
"spacegray_sidebar_tree_small": true,
"draw_white_space": "selection",
"auto_ident": true,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"use_tab_stops": true,
"trim_automatic_white_space": true,
"trim_trailing_white_space_on_save": true,
"indent_subsequent_lines": true,
"detect_indentation": false,
"font_face": "Andale Mono",
"font_size": 12,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"word_wrap": false,
"show_full_path": true,
"caret_style": "phase",
"highlight_line": true,
"line_padding_bottom": 1,
"line_padding_top": 1,
"bold_folder_labels": true,
"line_numbers": true,
"preview_on_click": true,
"indent_to_bracket": true,
"shift_tab_unindent": true
}
No linux, utilize estas configs para fontes:
"font_face": "DejaVu Sans Mono",
"font_size": 11,
"font_options":["no_antialias"],
IMPORTANTE! Depois de alterar as configurações, reinicie para que a sidebar pegue as configs do tema! Ou vc vai ter uma barra lateral cinza.
Agora vamos colocar o keybinding para Eclipse (trocar super por ctrl para o windows)
[
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+shift+c"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["super+shift+f"], "command": "reindent" , "args": {"single_line": false}},
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["super+shift+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["super+alt+left"], "command": "prev_view_in_stack" },
{ "keys": ["super+alt+right"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
]
Sabe um dos melhores recursos que tem para abrir uma definição de classe, método ou algo assim, apertando o ctrl e clicando? Também dá para fazer no Sublime. A tecla padrão é a F12, mas como eu não gosto de mudar o comportamento das minhas teclas, e apertar fn+F12 é chato, eu resolvi correr atrás de como fazer isso com alt+click (porque ctrl+click é o botão direito e não quero perder isso). E encontrei. Mudei o mapeamento para ser a tecla alt+click, então, se for fazer em outro OS, lembre-se de mudar de volta para ctrl.
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["alt"],
"press_command": "drag_select",
"command": "goto_definition"
}
]
E vamos configurar o SideBarEnhancements para abrir arquivos com seus respectivos editore/visualizadores
[
{"id": "side-bar-files-open-with",
"children":
[
//application 1
{
"caption": "XMind",
"id": "side-bar-files-open-with-xmind",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "XMind.app", // OSX
"extensions":"xmind", //any file with these extensions
"args":[]
},
"open_automatically" : false // will close the view/tab and launch the application
},
//application 2
{
"caption": "SeaMonkey",
"id": "side-bar-files-open-with-openproj",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "OpenProj.app", // WINNT
"extensions":"xml", //open all even folders
"args":[]
},
"open_automatically" : false // will close the view/tab and launch the application
},
//application n
{
"caption": "Preview",
"id": "side-bar-files-open-with-chrome",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Preview.app",
"extensions":".*", //any file with extension
"args":[]
},
"open_automatically" : false // will close the view/tab and launch the application
},
//application n
{
"caption": "Chrome",
"id": "side-bar-files-open-with-chrome",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Google Chrome.app",
"extensions":".*", //any file with extension
"args":[]
},
"open_automatically" : false // will close the view/tab and launch the application
},
{"caption":"-"}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment