My Top Sublime Text 2 Plugins
henriquebarroso.com
henriquebarroso.com
The "Soda Dark" theme goes well with the default color scheme. (The ui theme is separate from the syntax highlighting color scheme, you don't have to use the text colors seen on the github examples)
https://github.com/buymeasoda/soda-theme/
In terms of plugins, apart from the ones mentioned here, Quick File Creator is indispensable: https://github.com/noklesta/SublimeQuickFileCreator
Not a plugin, but if you haven't realised it yet, know that the multiple cursors each come with their own separate clipboard. Learning how to combine this with the move and select by word and the parenthesis-movement commands is what will make the vim users eventually respect you.
Oh and you can hack your language syntax definition files to make more things apart from function definitions turn up in the function browser. This is especially useful for ruby DSLs, sinatra etc.
Well, all this fun talk of SublimeText2, and my .2c .. I have been using ST2 for a long time now as an editor for MOAI, in which facility it really works well and .. well I've come to really love the editor, like love it, but am a vim user, 100%, and often get sad when I switch back and forth .. ;(
ST2, for MOAI and the Lua language, actually is really a sublime IDE experience, and imho the word sublime can be applied to this experience: I am using the same editor on both editor'ish platforms (osx, linux), and then building an app with its own language/VM wordspace that runs on .. everything .. iOS/OSX/Linux/Win/NCl/etc.
Right now in space-cadet mode, hacking on a laptop in some cafe, I sit in SublimeText2 .. hit alt-R, the MOAI app runs, its great, I commit to repo, the buildserver builds and runs the very same app on the nexus7, iphone5, pandora, osx, linux desktops, and various other sundry devices around the place.
In this capacity, ST2 has mastered my needs for integrated development. I guess I should learn how to read HN with it, next ..
My setup:
- Package Control plugin: the very first thing you should setup after installing ST2 (it should really be a part of ST2)
- Next step sync config files over Dropbox to get exactly the same editing environment from Win, Mac, and Linux
- move the /User folder under "Sublime Text 2/Packages" over to Dropbox/ST2/User
- in Win goto CMD and from the %APPDATA%\Sublime Text 2\Packages folder enter: mklink /D "User" "path to\My Dropbox\ST2\User"
- in Mac OSX/Linux goto the Packages folder (you can find the location under >Preferences>Browse Preferences) and enter: ln -s pathto/Dropbox/Sublime\ Text\ 2/User ./User
- the fantastic thing with this setup is that in any new machines, Package Control will automatically take care of installing any missing plugins
- Keybindings: tons of customizations to suit what I am used to and work across all OS's- Theme: Soda Dark
- Colors: Made of Code
- My favorite plugins: Alignment, Bracket Highlighter, Emmett, FileDiffs, SublimeCodeIntel, SublimeLinter, Tag
ST2 is the best investment I have made in software apart from open source.
"ensure_newline_at_eof_on_save": true,
to the user settings fixes this.
First the parent mentioned "if you're on Unx". What makes you think you* are the one correct with your text editor's behavior and that the traditional Unxy way of doing it is not correct? (and OS X is a Unx variant).
Then it's trivial to modify Emacs so that it exhibit the behavior you want. Is it trivial to modify Sublime Text Editor 2 to that it behaves on Un*x like vim and Emacs do?
I'll never ever understand "programmers" who aren't using a programmable text editor.
But I don't care: time is on my side. Emacs was there 35 years and still shall exist long after all these glorified Notepad shall long be dead ; )
It's right because the vast majority of newcomers believe that they are adopting UNIX and having a newline and the end of a file is an important tradition. There are some good places to upset the status quo but this is not one of them.
As long as you (or anyone else) doesn't write any new cooler diffs (though part of what you ask already exists), what they "should do" doesn't matter and doesn't change the fact at all.
Actually it reminds me of the "sufficiently smart compiler": http://c2.com/cgi/wiki?SufficientlySmartCompiler
I'll never understand people that want to spend hours configuring their text editor, despite how much more productive they say it makes them. Sublime is perfectly programmable through judicious use of plugins and snippets anyway.
A subset of that, I'll never understand emacs users.
Emacs (and possibly Vim) could also implement any feature you could reasonably expect from a text editor, and in many cases it already has them, you maybe just don't know.
But this is 2013, and you're not alone, people all around the world are improving Emacs all the time, and have been for 30 years+ ... you don't HAVE to do all the work, you can just use it.
As the man says, Emacs and Vim will be here long after John Skinner has got tired of ST2 and quits developing it.
I have no desires to spend hours configuring my editor, but I need an extensible editor.
> Sublime is perfectly programmable through judicious use of plugins and snippets anyway.
Yes. Sublime qualifies as a programmable editor.
Could you clarify this? I work with text files on both Windows and Linux all the time, and
View -> Line Endings -> {Platform}
seems to convert between EOL conventions on the different platforms as I would expect.
Surely unless you have some ideological reason to pick a FOSS editor, you'll simply use the best one available.
+ Multiple cursors + Column edit + JSON configuration files + Plugin support + Textmate themes + Python code base (easy to create plugins)
It's not particularly difficult to learn Lisp, it needs a nice syntax highlighter to dim away all the parens, but really, it's a very simple language. I'm sure you could write some bad-ass shit if you gave it a little attention.
There are python -> emacslisp bindings available, but I can't speak to that, regarding completeness / stability etc. Frankly I wouldn't suggest anyone waste their time doing that.
But really with such a HUGE resource of functions / libraries, (and some of the cooler features of Lisp, I mean have you seen the loop macro!?) ... it's a bit of a waste to pass it up over its "(( big ears ))"
If ST2 were OSS I could build it for ARM/Linux myself, everything it relies on is already available on those platforms. But it isn't, so I've had to quit using it and recommending it to others.
Use the best tool for the job. Screw extreme philosophies.
Are you of the "anything goes" thinking? I for one, find that attitude TOO extreme. I don't wish to accept (or even tolerate) "anything" just because someone else finds it OK.
I don't feel like preferring a FOSS solution in a situation where there are plenty of good choices is that extreme. That's why I asked.
If anything, I feel like "Use the best tool for the job and ignore all other factors" is an "extreme" stance. (although Stallman's obviously is as well)
(And I'm saying it as a long time Vim user, from the Sun O.S/fvwm days of lore as well as a heavy Eclipse user in the early to mid '00s).
When those free/open-source editors come into the 21th century with regards to native integration/UI I might reconsider.
Though both vim and emacs have gui interfaces, most of the users use them inside a terminal. You can wait till 22nd century, but as long as your definition of 21st century isn't the same as developers definition, not much is going to happen.
BTW what century are terminals? If I have to take a bet, I would say come back in 22nd century, and terminals would still be around and kicking. If it was that black and white(ooh, gui is here; let's switch), the switch would have happened. Personally, vim is part of my work environment(terminator running tmux/screen; vim on 0; repl on 1; dbconsole on 2; running tests on 3; ...) and I don't see how a gui editor is supposed to replace that.
The overwhelming majority of developers edits in a GUI editor though, be it in Visual Studio, XCode, IntelliJ, Eclipse or Vim / Emacs / TextMate / ST2 etc.
>You can wait till 22nd century, but as long as your definition of 21st century isn't the same as developers definition, not much is going to happen.
I don't have to wait. Plenty of other developers live in your "22th century" and offer nice and functional native editors already.
>BTW what century are terminals?
Mid-20th century.
I don't mind the terminal (I use one everyday and have done so since the day's Sun OS was SUN's offering), but it's also another technology stuck in the past.
Not because of the textual nature etc. Because most of the components are crappy old time things, from terminal emulators to userland unix commands, etc.
Bad support for millions of colors, bad support for Unicode, no support for a structured type (e.g JSON), ad-hoc implementations for lots of things given in the desktop. Where's a proper autocompletion in the shell that behaves like in a native app? Where's spell checking with wiggle lines?
Only ZSH and Fish tried a few things to take us further, but still very short of what a desktop could be.
I mean tmux/screen borking the scroll buffer? Is this 2013?
The overwhelming majority of vim/emacs developers use it in a terminal, and are pretty happy with it. When you mentioned open source editors catching up, it isn't going to happen because your requirements are not universal. "Only if it looked shiny" is very low on todo list of vim/emacs users/developers.
> I don't have to wait. Plenty of other developers live in your "22th century" and offer nice and functional native editors already.
My comment about waiting was with respect to vim/emacs(as examples of other open source editors). You can wait till 22nd century; it probably still won't happen. Users are mostly happy; developers don't care.
> Bad support for millions of colors, bad support for Unicode,
My terminal(terminator) does that fine.
> no support for a structured type (e.g JSON), ad-hoc implementations for lots of things given in the desktop.
Why and how would a terminal support JSON? What are those ad-hoc desktop things?
> Where's a proper autocompletion in the shell that behaves like in a native app?
shell has to support autocomplete in million things, compared to your native app which only does one thing say Java. Whether shell offers completion or not depends on the external tool as well. You install some utility shit_load. How on earth is shell going to complete "shit_load -<TAB>".
> I mean tmux/screen borking the scroll buffer? Is this 2013?
tmux/screen scroll buffers work fine. You are just making shit up.
Way to fuck up the discussion in a disingenuous and insulting way by summing down my arguments to "I like shiny things".
I specifically talked about native integration. That has myriads of aspects, of which "oh, shiny" is just an insignificant part of.
As for the "overwhelming majority of vim/emacs" users using them in the terminal, citation needed.
My anecdotal data tell me that they use them in both in both terminal and GUI form (terminal for working on stuff remotely, admin stuff etc, GUI for long term programming sessions).
Plus, no matter what the "overwhelming majority of vim/emacs" do, those do not represent the future or cutting edge of programming editor use in any conceivable way. And that is precisely what we are discussing.
>bad support for Unicode >>My terminal(terminator) does that fine.
Does that answer mean that you don't have the mental capacity to follow the discussion? Maybe you're too tired or something?
Isn't it obvious from my comment that I mean Unicode support THROUGHOUT the system? That one or ten terminals has got it doesn't mean a thing if there are 200 other components involved in doing unicode CLI work. For example GNU/BSD unix userland programs supporting full unicode capabilities. Unicode and font-rendering without X-running, etc etc.
>Why and how would a terminal support JSON? What are those ad-hoc desktop things?
What is this stupid notion that I talk about terminal emulators ONLY? I specifically bloody state that I complain about all terminal-side stuff "from terminal emulators to userland unix commands".
In this case, what I ask for (when giving JSON as an example) is a structured way of communication between userland commands, to go beyond '70s style pipes. Microsoft's Powershell AFAIK has some of that built-in.
>shell has to support autocomplete in million things, compared to your native app which only does one thing say Java.
You'd be surprised. And context-sensitive autocomplete is so solved that it's not even a problem...
>You install some utility shit_load. How on earth is shell going to complete "shit_load -<TAB>".
See how luck of imagination and blind acceptance of what's there cripples programmers?
Off the top of my head: programs could come with definition files for their autocompletion. Adding a program adds those to your shell (in the same way programs come with man-pages).
I seriously hope you don't work in R&D.
>tmux/screen scroll buffers work fine. You are just making shit up.
Only if "switching in copy-mode to scroll, instead of transparently incorporating the terminal scroll buffer" fits your definition of "fine".
Also see https://github.com/SublimeText/VintageEx which adds the vim command line.
For example, supposed I have a row like (making up these names as I go, and suppose the list is longer):
Controller_Section
House_Model
Person_To_Category_Selector
and I want to insert after the first underscore the word class, so I'd get Controller_Class_Section and so on (this is a contrived example, but one has to do these kinds of things sometimes.)In vim, I think I'd record a macro, but I'd probably forget some parts (like moving to the next line at the end) and have to undo and whatnot (could use a regex too, but that's a bit harder--I'm practicing recently to be able to do it more effortlessly.)
In ST2, what you do first is create a cursor at the beginning of each row (option + down arrow on OS X.) Then you move ahead one word (Opt + Right arrow on OS X.) Now the cursor is right before the underscore, even though the underscore is in a different position on each row. You can see that it's in the right place on each row, so it's hard to make a mistake, and if you need to do something more complicated, that remains true. Then, you just type _Class, and it types live on each row, once again making it so you get instant feedback, and it's hard to make a mistake.
That to me is the biggest actual advantage of ST2 over VIM, but there are other reason to not switch, like vim's steeper learning curve (when most of us are already busy, and learning other stuff at the same time), and the fact that some people prefer the mouse, which behaves strangely in vim.
The perhaps the closest thing I can think of for your example would be this (starting in normal mode with the cursor at the beginning of your list):
f_i_Class<Esc>+;.+;.
("Move forward to the next '_', enter insert mode, insert '_Class', leave insert mode, move down one line to the first non-blank character, repeat the forward motion, repeat the insertion, repeat forward motion, repeat insertion." Vim does have word motions, but it includes underscores as parts of words.)Edit - formatting and a clarification that it's the closest I can think of (I'm doubtful it's the closest you can get).
vnoremap @q :normal @q<CR>
You can record the macro in q register, select the visual range, and then do @q to run it over the range. The advantage of doing it thus is you don't have to run the macro manually on every line, and you can undo all change with one u.Also, normal takes ranges(and not just visual ranges). If you want to run the macro recorded in q over lines 15,49, you can do:
:15,49normal @q<CR>
I use the same trick for repeating commands over a range too. vnoremap . normal .<CR>
As usual, it doesn't have to be visual range. But I mostly use visual ranges, and so I have defined shortcuts for visual ranges. :% s/_/_Class_/
Explained: On each line replace the first '_' with '_Class_'To do the task you mentioned in vim I would move the cursor to the first letter of the word Section in the first line. Then I'd insert "Class_" and go back to normal mode. After that I'd move the cursor to the first letter in the word Model in the second line. And then I'd press the dot key and do the same with the other lines in supposedly longer list.
Now I seem to spend a few months with vim as my primary editor, get tired of it, switch to ST2 for a few months and then switch back.
I am posting this again(posted above about running a macro on a range), but I guess lot of people don't know about this.You need not manually press . on every line. You can run . operator on a range. Do a visual select and then
:'<,'>normal .<CR>
The range('<,'>) is inserted automatically when : is pressed from visual mode. So it boils down to visual mode, select, :normal . <CR>You can have any ranges you want.
:15,49normal .<CR>
I have a shortcut for visual range defined in my vimrc vnoremap . :normal . <CR>Your example is not a candidate for a macro, a simple substitution is enough:
V2j to visually select the lines
:s/_/_Class_<cr> a range corresponding to the visual selection '<,'> is inserted automatically before the s
If you are comfortable with ranges, the operation can be done in one go: :.,+2s/_/_Class_<cr>
Also there are already a few plugin authors exploring the multiple cursors idea, however gimmicky it is.I also like that it’s easier to remember most Sublime Text 2 commands – the Command Palette (⇧⌘P) lets you fuzzy search all commands. So you can search for “syntru” and find the option “Set Syntax: Ruby” instead of having to remember Vim’s “:setf ruby”.
Finally, I use Expand Selection to Word (⌘D) to quickly select multiple instances of a variable whose name I want to change – it’s slightly more convenient than it would be in Vim.
On the other hand, I miss Vim’s editing model. It’s a lot more cumbersome to edit line-wise or move the cursor with Sublime Text’s keyboard shortcuts. And Sublime Text’s “Vintage” Vim emulation mode is a poor substitute. As another commenter said, Vintage is in the uncanny valley. Every now and then you run into a Vim command that just doesn’t work and it breaks your flow. For example, Escape is overloaded as both “go from Insert mode to Normal mode” and “collapse multiple carets into one”, and I never remember which it will do when I have a multiple selection in Insert mode.
Part of the reason for the delay is the lack of equivalent Vim workflows in Vintage. This has been improving a lot thanks to the people working on Vintage and at this point the only holes in my set are c-i/c-o and surround.vim shortcuts. I had to re-train myself to go from Esc to ctrl-[ since Esc conflicts heavily in ST2 but I've been meaning to do that for years in Vim anyway so I consider that a benefit.
http://gcollazo.github.com/BrowserRefresh-Sublime/
#ShamelessPlug
https://tutsplus.com/course/improve-workflow-in-sublime-text...
Additionally, as a scientist, I use a lot (and like a lot) https://github.com/SublimeText/LaTeXTools.
It's not like the thing is riddled with outstanding issues.
Emmet is kind of version 2 of zencoding. But for as far as you should concern yourself they are two different plugins.
{
"button": "button3",
"count": 1,
"press_command": "drag_select",
"command": "navigate_to_definition"
}
However, it doesn't work as well for OO code.Does anyone know if that's possible in Sublime Text?
Link to the xterm font: http://yootles.com/outbox/FixedMedium6x13.dfont
PS: It also needs the line spacing set to .8 which I've found a way to do in TextMate and Terminal.app.
See http://www.reddshift.com/2011/10/turn-off-anti-alias-for-sub... for how to turn off anti-aliasing, and https://gist.github.com/1149379#file-sublime-text-2-settings... for line spacing.
I've had some luck using the branch version which you can grab here: https://github.com/Kronuz/SublimeCodeIntel
It should just be a simple configuration option but until it is added then this is a deal breaker.
BUT it seems that this doesn't always work. I just tested with a newly created file and for some reason there was no warning, it just reloaded the file.
On a side note:
Does anybody know of a plugin for ST2, or another editor that works well for coding that allows for a semi-transparent/transparent background? (for Windows) I've been searching for the last few weeks to no avail, and was hoping that somebody here might have encountered something.
I couldn't find anything about this in the docs (just quick browsing) and nothing was apparent in the menus after I've tried to install it. So.. just asking, not trying to start a flame war :)
It allows you to switch between your models, controllers and views really fast.
Link to plugin: https://github.com/SublimeText/CTags
CTags is absolutely fantastic though, I live and die by it in large code bases. It's backed by ctags on the system too, so it has an impressive list of supported languages.
Thanks
SublimeREPL - run an interpreter inside ST2 (Clojure, CoffeeScript, F#, Groovy, Haskell, Lua, MozRepl, NodeJS, Python, R, Ruby, Scala, shell or configure one yourself) https://github.com/wuub/SublimeREPL
However the project control part of Coda is amazing.
So it's a matter of how experienced web developer and what exactly do you do? If you do mostly HTML/CSS/JS, then Coda is for you. If you do mostly other stuff hardcore JS, ruby, php, lua, blah blah blah. I'd say sublime.
It especially is great for ruby/html/css. Give it a shot :)
For one, web developers debug too. Javascript, PHP, Ruby, whatever.
Second, you can very much debug in Sublime (whatever that means). Do you mean something like an integrated debugger, like say XCode/VS have?
A lot of developers use external tools for that, like gdb et al, depending on the language.
Tons of developers of any kind use sublime, from C to Go.
Who programs in languages so mediocre that there are repetition everywhere and that working is so repetitive that having multiple cursors actually helps?
Do you really have to enter the same thing so often that having "multiple cursors" makes you more productive and is considered a "killer feature"!?
All I see is that if you need that you have way too much repetition in your "code".
I don't like repetitive stuff. That's what computers are good for. That's what I do as a programmer: I carefully craft my tools so that all the stupid repetitive tasks are done by my programs (or by my programmable text editor).
I'll say this about multi-cursor, it is one of those things that until you have it, you don't know you missed it.
When I first tried sublime my thought pattern went "Wha? Multi-cursor? When will I ever use -- Oh my god how did I live without this!?"
Simple use case that comes to mind: quick refactorings. I'm a believer in self documenting code, so I'm often changing the names of my function calls as I get deeper into the domain of the problem. With Sublime Text, I highlight the function in question, spam `ctrl + d` a bunch of times to set the multicursors in position, and from there, I'm free to type away whilst the multicursors edit my entire document.
Multiple cursors can be useful for doing things like quick renames, which itself is already useful in a general text editor that is used with many different file formats.
However, for me, they are often more useful because you can pick out general patterns of text/symbols and do the same thing to all of them. Want an extra <th></th> just after each <tr> in four lines of an HTML file? No problem. Want to split a list of function parameters onto separate lines when they don't fit on one any more, or the other way around? No problem.
Sure, in many cases you could do these things with a find-and-replace as well, but that might involve making a selection to limit the scope of the replace operation, setting up some sort of regex to make sure you only find the copies of the original text you actually want, setting up another regex to do the replacement without disrupting anything else nearby, and so on. Using multiple cursors is often much more efficient.