Good article. Sublime Text has a lot of power up its sleave. I think a lot of people ditch Sublime for vim or emacs because they want a more powerful editor without trying to learn the more advanced features of Sublime and customize it to their liking.
I was one of these people, I spent 6 months using Vim and 6 months using Emacs, but eventually came back to Sublime because I could customize it with plugins (like Vintageous) that made it even more powerful and productive than Vim or Emacs. Especially because I wasn't constantly wasting time debugging bugs created by interactions between the piles of hacks all the Vim/Emacs plugins used.
I spent 6 entire months contributing to Spacemacs fixing bugs and broken things and there was no end to them in sight. I realized that while I switched to Emacs to get more work done on my projects, I ended up ditching all my projects in order to fix broken Emacs things. That's when I switched back to Sublime.
I am for many years now primarely vim user. I use it now mainly, because I've got used to it and it's available everywhere. I was once a no-mouse-only-keyboard user, but now it all seem like busy-work. I would prefer just to point out what I want. I am not affraid of typing as I mainly use command line and like to use ocasional pipeline with some awk scripting to achieve output that I want. I find Unix toolset more approachable than vim.
It's just that I feel like every magic incantation of vim commands spends my mental energry. I feel smart after some complex edit with only a couple of keystrokes, but a bit less focused at real issues. Editing is such a small part of programming. I understand that people may not have such problems, but that's me.
My dream editor would be something like Acme [0], but a bit more modern. I even started doing my own experimental editor [1] inspired by Acme. I mainly want a mouse driven editor with easy ties to shell. Unfortunately my development pace has been glacial for some time.
Sublime sounds like exactly what you want. I use the mouse all the time, especially when I'm doing a lot of reading and navigating. For these tasks the mouse is actually substantially faster. But when I already have my hands on the keyboard I can use vim commands to do quick navigation instead of moving my hand to the mouse. I think mouse based interfaces are much better for reading code, which is a lot of what I spend my time doing, and Emacs and Vim don't support that very well.
People may think their ace-jump and fancy motions are faster than the mouse, and they may be faster than the overhead of moving your hand to the mouse, plus the clicking, but when your hand is already on the mouse, the mouse is so much faster.
One great thing about Sublime's vim emulation is it is better about interacting with mouse use than other vim-things, including vim itself.
I also find Sublime is great at not taking "mental energy" like you mention. Multiple cursors can do basically the same thing as vim macros, but with macros I have to think hard about whether my commands will generalize and exactly what I want to record, but in Sublime I can see immediately if things are working (yes Vintageous works with many cursors).
Similarly the infrequently used commands take much less memorizing. I can do weird finds like "find in all .rb files in project, whole words, case insensitive" and then immediately convert my command to a replace without retyping all the other conditions or using an entirely separate command. In Emacs I'd have to Google how to do this since I do this kind of thing infrequently.
For tying to shell there are Sublime Text plugins that could do that, and writing your own would be easy. Personally I use one that allows me to run my selections through a Ruby script, or even evaluate my selection as Ruby. Example: I wanted to sum a comma separated list of arguments, so I select the first comma, spam "cmd+d" to select the rest I wanted (but not the whole file), type "+", select in parentheses, then replace the selection with the ruby evaluation. It was super quick.
I am kinda thinking the same way. What I liked so much about your comment is that I found myself in pretty same position.
I used vim for a few years, got used to that zsh+tmux combo, and my environment was mostly wrapped around Vim (not UNIX like I thought it was). Then after I gave Emacs a shot, I used GUI version, and I saw that it is not the end of the world because I didn't use it as in-terminal editor. I am seriously reconsidering ditching everything and go to Sublime.
Why? It's fast, sleek and it does the job. With Emacs I start working on something, and few hours later I am like "why the fuck am I writing lisp and tweaking emacs". I get it, people that used it during 90s, and for 10+ years, they are set in the stone, and why would they switch. But now I really reconsider my options. Vim is much better in that aspect, I spent years with it and have it much or less to my liking, but I always come to some edge case where I change editor.
For example, I want to practice few exercises from SCIP I need Emacs, because Lisp programming in Emacs is so effortless and good. I want to write some Go I jump to Vim because vim-go just works perfectly for me. When I am doing some admin work on system I run Vim, but when I want to play with Clojure I need to go back to Emacs. You see the trend? How would Sublime cover all those functional languages, is it any good?
If I could have extremely light version of Emacs, that worked in terminal, much better and much more flexible than og Emacs, with good support for REPLs. When you break the no-mouse barrier, you see huge boost of productivity, but later after some time it diminishes and returns. I know I do not want Electron based editor. Terminal preferably but not the key. Something swift and clean. Vim does the job 80% of time but functional languages just work better inside Emacs.
I am holding my breath for Xi Editor [0]. It's written in rust, has some interesting abstractions and implementations, native is priority, and overall looks like potential checker for all my boxes. But it is nowhere near to the point of replacing vim or emacs for me. I rambled too much...
I really suggest you try out Sublime with Vintageous vim emulation. Part of the reason I spent so much time tweaking emacs is that I work in a lot of different languages, and I had to spend many hours setting up each one. Installing and working with new languages in Sublime tends to just work.
With Sublime I tend to use a separate terminal app for doing all my code running and things. So if I'm working in a REPL-like language I do it there. There's also plugins for most languages that do the editor integration I actually want, like autocomplete and highlighting.
The thing is, Emacs can have amazing, if not best support for any language, but if you install it, set it up and tweak it until molecule level. Which is great, but it kinda tires me, you know...
Now, how you manage using separate terminal and Sublime, I mean is there any communication between REPL and Sublime, or you just copy/paste code from editor to REPL? Since in Emacs you can evaluate snippets, functions and do all that nifty stuff... Actually I am afraid maybe to jump and give Sublime a shot, but now it looks like I got nothing to lose. If I manage to cope with REPL in separate terminal app I think I am sold. Magit was nice, but I am fairly proficient in terminal git so it's not a deal breaker, and I never used org-mode (I love paper notebooks for that), so I might be able to adopt to certain extent.
When I'm using a REPL I generally have all my function definitions in a file I edit in Sublime, which I reload from the REPL, then I just type in commands in the REPL to try out those functions. That way I don't have to copy-paste much, but if you don't like that style I think a Sublime plugin that used Applescript to paste into iTerm2 wouldn't be too hard.
Also for git there is https://github.com/divmain/GitSavvy which is almost as good and sometimes better than magit. There's also terminal git, I generally use a combination of terminal and GitSavvy.
That's a pretty neat article. Currently I'm trying to get away from Sublime because it's closed source. I considered Lime Text, the OSS clone, but that project seems to be dead. So I settled for vim. I'm still not as productive as with Sublime, but I'm getting there. Does anybody know a similar article for vim or other editors?
I'm using Visual Studio Code and absolutely loving it. If you document your code (JSDoc) etc, the IntelliSense is absolutely incredible. There's a vibrant plugin community, the only flaws I have found so far:
* You can't add multiple folders to a project. This is fucking irritating.
* The git plugin doesn't work on subfolders - IE because of problem number one, I put a group of (say, microservices) into a parent folder and add that, which in turn breaks the Git plugin.
If you can ignore those things it's bloody brilliant. Obviously after you've added a bunch of extensions and stuff to spruce it up.
1) Uses Chrome's font renderer - it looks terrible on Windows
2) Indent = Tab size
3) Themes can't properly customize some key on-screen assets
4) No macro recording/playback
5) Can't edit enormous files
Other than that the add-on ecosystem can be a bit fiddly, and you won't find syntax highlighting for more oddball things that you'd 100% find for vim or Emacs.
Oh, and sometimes it ends up using 100% of the CPU in the V8 GC. Might be add-on related.
I gave Atom an honest chance for a couple of months and went back to Sublime. Don't understand how people have the energy to put up with an editor that randomly gets sluggish when typing, hogs RAM, crashes spontaneously (requiring a restart), and chokes on large files.
Ideally I'd like to use OSS for everything I can (and sometimes you can, see Transmission), but at times the non-OSS variant is simply the lesser of two evils. I'd rather use native Atom + native Gitkraken, but alas, that'd cost me nearly a gig of ram simply for idling. I won't stand by that kind of inefficiency.
Shouldn't you use the best tools for the job though? Unless you really need that last GB of RAM, it just seems like you're punishing yourself for the sake of an ideal, all to no greater consequence.
A gig of RAM is probably less than a tenth of your total resources. If it makes your job easier, surely it's worth it, no?
The gig of RAM is not the only thing. It works worse on large files. It's not nearly as fluid. Multiselect sometimes craps out. Searches take longer. Battery life is less.
I ideologically like the idea of OSS, but I'm past sacrificing usability for it. Hence I'm on a MacBook with macOS coding in Sublime with 12h battery life, instead of on a XPS13 with ElementaryOS coding in Atom with 7h battery life. Or a bulky, ugly Lenovo with great battery life but a horrible touchpad and a shitty screen. But on all of those situations I'd torrent with Transmission, because it looks beautiful, is consistent, and to top it all off is the lightest and smoothest torrent client there is.
> The gig of RAM is not the only thing. It works worse on large files. It's not nearly as fluid. Multiselect sometimes craps out. Searches take longer. Battery life is less.
These things are true. I still use Atom on my MacBook Pro though because it has, at least in my corner of the world, a much better ecosystem than Sublime. I do keep Sublime around for the rare cases where Atom can't handle something, but if I didn't already have a Sublime license, I wouldn't feel the need to pick one up: Vim is more than capable of handling the large-file case for me. We all have different experiences though.
> Or a bulky, ugly Lenovo with great battery life but a horrible touchpad and a shitty screen.
The new X1 Carbon with the OLED panel is pretty good, I think. Color accuracy is something of an issue, but it does cover Adobe RGB and should be fantastic for anything other than professional-level color-critical work. That's neither here nor there though.
What is it that you have in the Atom ecosystem that's (or a substitute) not installable through Sublime's package control?
> The new X1 Carbon with the OLED panel is pretty good, I think. Color accuracy is something of an issue, but it does cover Adobe RGB and should be fantastic for anything other than professional-level color-critical work. That's neither here nor there though.
Just Googled it. Just from the Google images:
* Why is there 'Thinkpad' sprayed on lower-right corner? Ugly and useless.
* Touchpad mouse buttons, circa 1990
* Red-black color scheme
* Mouse nipple (I know this is Lenovo thing and people actually buy them for it)
I realize style is subjective, but very few people are going to pick the X1 over either the Macbook or the XPS13 in terms of design. And design matters. Not only in a 'oh this looks nice way', people are actually measurably more productive on attractive gear.
I think it's mostly the latter, also Atom doesn't seem to be particularly written for efficiency. Firefox OS phones shipped with less RAM than Atom/VSCode use.
It's a symptom of a larger problem though- inefficiency. It's why everything is nearly instantaneous in Sublime but always has that tiny delay in Atom - plus it chokes on large files. Hell, the Sublime dude even wrote a custom Regex engine just for highly performant searching.
It may be inefficient in terms of memory and CPU resources, but it was very efficient in terms of dev time and allows for easy modification by third parties. I'm not sure Atom would be where it is now if they went the native route.
When I'm doing development, I spend most of my time interacting with Atom. If I had to buy another pair of 16 GB DIMMs just for the sake of running it, I would. This is what I do professionally and I'm happy to throw a little RAM at something that makes my job more enjoyable and myself more productive.
> It may be inefficient in terms of memory and CPU resources, but it was very efficient in terms of dev time and allows for easy modification by third parties
I appreciate easy customization as much as any dev, but, in this case, I don't know if that's an advantage when as a result Atom doesn't do its primary task terribly well: stay open all day, let me type code.
Have you ever used Sublime though? You can modify the user interface any way you want. Theming works extremely well. There's an integrated package manager too, that works superb. Sublime and Atom are pretty much the same feature-wise (they both are available to Linux too), but Sublime does it (for me) in a cleaner, more efficient and native way.
I have used (and still use) Sublime, yes. I switched over from TextMate as soon as I could.
I'm not suggesting Atom is better than Sublime, and there are definitely many cases where Sublime is better than Atom, particularly in terms of performance. I just think Atom gets more abuse than it should given how useful it is in general. Many of the complaints I see are more rooted in what they feel an app should do in the abstract (e.g. idle at under N megabytes of RAM) rather than actual issues that affect their use of the tool.
There's always a tradeoff. 95% of the time I'm not editing files more than a few hundred lines because my code is organised. I'm happy to switch tools for the "anomalous work". Nobody is stopping you using multiple editors, each for a different purpose. I'd prefer a tool that was extremely useful for the mainstay of my work, as opposed to one that makes sacrifices in order to be able to do 100% of it.
1) Arguable. In any case Chrome and everything based on it (i.e. Electron) render fonts too light compared to native apps on Windows, and don't properly respect ClearType settings. I've been told the underlying issue is a design mistake in gamma handling between Chrome and Skia, but I have no idea whether that's true. The fact that more and more apps are Electron based makes this very sad :(
2) You can't set tab = 8 and indent = 2. This isn't common, but sometimes one deals with foreign sources where that's an issue.
4) Repetitive editing tasks where just doing them once is much faster than coming up with a shell/sed/awk/perl/python on-liner. I switch to vi for those right now.
This article seems to mostly be about searching, manipulating words and lines, etc. If that's what you're looking for, vimtutor is a pretty good place to start. It should be available from the command line if you've installed vim.
There are some pretty good github pages out there to help configure your vimrc into a monster. Ultimate vimrc is a pretty good baseline if you take the time to trime away some cruft.
[0] TextMate 2 is quite active on GitHub. I like it because it is open source and it is a native app. I like and use Vim and Sublime also, but having a nice light native text/programmers editor has something going for it. Sublime just doesn't look right to me.
Hi. What would you say is the thing that holds you back to being as productive in vim as in sublime? Maybe we can give you a hand. Is it the plugins? Or getting used to how vim works? There are some pain points in vim, but there are also some pretty neat things about it. I'm far from being an expert, but I have been using it for a few years, so maybe I can give you a couple of tips.
- move back / forward in the history of selected lines
- project-wide search
- quick switch projects while reopening the files where I left off
are all faster (for me) in Sublime. Also auto-completion, though to be fair there are probably packages for this, I just tend to use vim for quick changes and haven't invested in heavily customizing it.
Refactoring is indeed a problem. I try to use an IDE for that (for java I don't use vim anymore; it's complete overkill). If you use python or go, you can find some stuff out there, but sadly vim is not made for this.
I've never really had a problem with goto method definition with ctags, and I've used that with multiple languages. ctags is usually relatively fast generating the tags, and you could probably set up so that it generates it each X seconds if you wanted.
For the project wide search, ctrlP has served me well, although the fuzzy completion is far from good (command-t is way better at that), so I would probably recommend the second one if your project is large.
Regarding switching projects, I've been using tmux for quite some time and it's a blessing. I could not imagine someone spending a lot of time in the terminal with vim and not using tmux or another terminal multiplexer. tmux is for me as important as vim itself. It makes a big difference. I have different sessions for different projects .
You have probably heard about youcompleteme. It's not amazing (doesn't come close to intellij), but it works and it's free, so the last thing I will do is complain :)
I'm not sure I understand the move back/forward in history. Do you mean undoing just some specific selected code?
vim is far from perfect. The more I use other tools, the more I realize it's limited in a lot of ways, but unfortunately when I try to use other editors, I find too many shortcomings too, so right now for me vim is the best I have =)
Regarding jumping back/forward, I didn't describe it super well. Here's the official description [1]:
> Jump Back and Jump Forward - Jump Back allows you to go to previous editing positions. This goes hand in hand with Goto Definition: you can now inspect a symbol definition, and quickly jump back to where you were previously. Jump Back is bound to ^Minus by default.
c-t: will bring you back to the previous location before jumping. this is the right way to do it if you jumped from another file by tag
c-o: if you run commands like gg to go to the top of the file, c-o also tracks this as a previous location. useful to know if you need to check something at the top of the file and you want to go back to where you were before pressing gg. also tracks tags, but of course if you jump to a tag, then gg, then press c-o it will bring you back to the position before pressing gg instead of the file you jumped from for the tag (more often than not im a victim of using c-o with tags)
not related to vim, but try Visual Studio code. Once you personalize its shortcut key bindings (which everyone I know does), it's way better IDE than sublime/atom/etc. It has code definition 'peeking' (staying on the same file while 'peeking' on definition), reference peeking, renaming, etc.
sublime does have 'goto definition' and 'find usages / references', but they're not the same as peeking. They both open the target file (& changes the files you were viewing), whereas peeking just let you stay where you were.
Welcome to vim! I can't recall an article that helped past: disable your arrow keys. Try to avoid using hjkl unless absolutely neccessary. Don't move in insert mode. If you're pressing a key more than once there's probably a better motion.
Komodo Edit has all this features and more, and it's OSS project... also has a vim-compatibility mode, so you can train your vim skills in IDE-like environment, it makes the learning curve easier on you...
Nice article, ideal to get new users started with ST. Couple of remarks:
- fuzzy search example uses ctrl-p, should be ctrl-shitf-p
- idem for wrap lines example
- Put your cursor on a word, then hit ctrl+d it will select that word. just double-clicking seems faster (though I reckon if you'll be using ctrl-d repeatedly afterwards anyway it might not matter)
Some nice tips. ST was great for me for Python work, but became borderline unusable for me because of one weird thing. In HTML mode it autocompletes snippets based on the empty string.
So typing ">" + Enter or even " " + Enter inserts the <a href=""></a> snippet. So I literally can't insert a newline at the end of any content without hitting escape.
Doesn't seem to happen in other languages. But I couldn't find how or why or how to prevent it. So I gave up. In a related note, I found documentation a bit limited.
Have you tried ctrl+enter ? It makes a new line after the current line regardless of where in the line the cursor is. ctrl+shift+enter creates a line above.
I love Sublime Text, I use it for non-development work such as writing text files because of the ease of use.
Would love to venture more into the terminal/tmux/vim land but not lose a lot of the nice key bindings that I have been accustomed to with Sublime. I feel like this is the natural progression of being a productive hacker but will wait probably until the end of the year before making the switch.
> I love Sublime Text, I use it for non-development work such as writing text files because of the ease of use.
It's also one of the only programs that has never lost any of my data, even in the extremely rare event that it crashes it's always preserved everything.
I hate sublime text's vertical editing. It jumps around when I would rather just have it do actual block highlighting the way every other editor that supports block highlighting does it.
If anyone knows how to force it to do that I'm all ears, it's easily my biggest complaint about ST3.
I used to use sublime until recently I started to use Atom and one of the things I like is that you can easily sync your settings to a github gist so that you can use your config across systems
My experience is that the overall Sublime packages are much more stable and do not need so much rework and maintenance. I cannot even count how many times Atom packages failed (maybe it's also just because I cannot see fancy failing error messages of packages in Sublime).
The interface for one. OOTB Sublime Text can't install packages, for example. Once you install Package Manager, discovery is terrible; you have to know the name of the package you want beforehand. On Atom/VSCode you can easily browse all packages and install them from the editor itself.
I was one of these people, I spent 6 months using Vim and 6 months using Emacs, but eventually came back to Sublime because I could customize it with plugins (like Vintageous) that made it even more powerful and productive than Vim or Emacs. Especially because I wasn't constantly wasting time debugging bugs created by interactions between the piles of hacks all the Vim/Emacs plugins used.
I spent 6 entire months contributing to Spacemacs fixing bugs and broken things and there was no end to them in sight. I realized that while I switched to Emacs to get more work done on my projects, I ended up ditching all my projects in order to fix broken Emacs things. That's when I switched back to Sublime.