News for hackers. Stuff that matters.
Re:Supercharge your Sublime Text 3 to increase your producti... by adrianN on Friday January 20, 2017 @09:49AM (#13444127)
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?
Re:Supercharge your Sublime Text 3 to increase your producti... by antihero on Friday January 20, 2017 @10:23AM (#13444405)
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.

It feels faster than Atom, too.

Re:Supercharge your Sublime Text 3 to increase your producti... by gcp on Friday January 20, 2017 @10:27AM (#13444435)
My flaws:

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.

Re:Supercharge your Sublime Text 3 to increase your producti... by tornadoboy55 on Friday January 20, 2017 @10:30AM (#13444465)
1b) Electron is horrible bloat. Sublime uses 70 (idle) to 250 (lots of tabs) mb. VS Code and Atom both use 200-300Mb even when idling.
Re:Supercharge your Sublime Text 3 to increase your producti... by potatosoup on Friday January 20, 2017 @10:56AM (#13444657)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by mattkevan on Friday January 20, 2017 @11:03AM (#13444715)
I was horrified as to what Electron apps do to my laptop's batteries.

Just writing a bit of code in Atom shouldn't rinse a fairly new MacBook Pro in under three hours.

Sublime, on the other hand, lasts all day.

Re:Supercharge your Sublime Text 3 to increase your producti... by gcp on Friday January 20, 2017 @10:32AM (#13444493)
I don't really mind the static overhead as long as it stays fast and if it could deal with 'larger than memory' files sensibly. Alas, it does neither.

I'm very hesitant to standardize on a non-OSS editor, though, so I think Sublime is out for me.

Re:Supercharge your Sublime Text 3 to increase your producti... by tornadoboy55 on Friday January 20, 2017 @10:36AM (#13444523)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by moon_priestess on Friday January 20, 2017 @11:12AM (#13444776)
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?

Re:Supercharge your Sublime Text 3 to increase your producti... by tornadoboy55 on Friday January 20, 2017 @11:23AM (#13444843)
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.

Re:Supercharge your Sublime Text 3 to increase your producti... by moon_priestess on Friday January 20, 2017 @01:14PM (#13445673)
> 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.

Re:Supercharge your Sublime Text 3 to increase your producti... by tornadoboy55 on Friday January 20, 2017 @02:14PM (#13446205)
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.

Re:Supercharge your Sublime Text 3 to increase your producti... by mercurysmessage on Friday January 20, 2017 @11:08AM (#13444752)
Is this just because JS isn't good for desktop, or because Electron is not optimized or efficient?
Re:Supercharge your Sublime Text 3 to increase your producti... by gcp on Friday January 20, 2017 @11:21AM (#13444834)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by antihero on Friday January 20, 2017 @10:34AM (#13444509)
My laptop has 16GB of RAM, I don't really give a fuck about a few hundred MB of RAM in all fairness.
Re:Supercharge your Sublime Text 3 to increase your producti... by tornadoboy55 on Friday January 20, 2017 @10:39AM (#13444547)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by moon_priestess on Friday January 20, 2017 @11:02AM (#13444705)
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.

Re:Supercharge your Sublime Text 3 to increase your producti... by potatosoup on Friday January 20, 2017 @11:07AM (#13444740)
> 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.

Re:Supercharge your Sublime Text 3 to increase your producti... by antihero on Thursday January 26, 2017 @04:49AM (#13490035)
Strange, I've had VS Code open for the last several weeks and it's not been an issue.
Re:Supercharge your Sublime Text 3 to increase your producti... by tornadoboy55 on Friday January 20, 2017 @11:29AM (#13444891)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by moon_priestess on Friday January 20, 2017 @01:20PM (#13445727)
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.

Re:Supercharge your Sublime Text 3 to increase your producti... by antihero on Thursday January 26, 2017 @04:48AM (#13490032)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by gcp on Friday January 20, 2017 @10:46AM (#13444601)
Hell, the Sublime dude even wrote a custom Regex engine just for highly performant searching.

Presumably everything Electron based is using Irregexp under the hood, so I doubt that's a real competitive advantage.

The performance difference between Atom and Visual Studio Code is interesting, given that they're built on the same framework.

Re:Supercharge your Sublime Text 3 to increase your producti... by antihero on Friday January 20, 2017 @10:33AM (#13444500)
1) All fonts look like ass on windows.

2) What exactly do you mean by this?

3) This is true, the scheme is great, but themes aren't really there yet. The default is nice enough, though.

4) Also true, perhaps a plugin could work? I have no idea where I'd use macros though. What do you use macros for?

5) Also true, I use vim for those but it's a rare case.

The CPU issue seems weird, I certainly don't get 100% CPU.

Re:Supercharge your Sublime Text 3 to increase your producti... by gcp on Friday January 20, 2017 @10:42AM (#13444576)
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.

Re:Supercharge your Sublime Text 3 to increase your producti... by antihero on Thursday January 26, 2017 @04:46AM (#13490018)
1) Fair enough, I guess that's a Chrome bug which maybe will be fixed in time.

2) Also fair enough, I don't find that I have to deal with this too much. Can you switch editor for those files? It's only a Cmd+Tab away :)

4) I use multiple cursors for stuff like this.

Re:Supercharge your Sublime Text 3 to increase your producti... by hguant on Friday January 20, 2017 @10:05AM (#13444284)
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.

Re:Supercharge your Sublime Text 3 to increase your producti... by b3b0p on Friday January 20, 2017 @11:23AM (#13444840)
[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.

[0] https://github.com/textmate/textmate

Edit: Assuming you are on macOS.

Re:Supercharge your Sublime Text 3 to increase your producti... by farresito on Friday January 20, 2017 @11:02AM (#13444706)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by tedmiston on Friday January 20, 2017 @11:35AM (#13444931)
Not the parent but for me tasks like:

- basic refactoring

- go to method definition

- 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.

Re:Supercharge your Sublime Text 3 to increase your producti... by farresito on Friday January 20, 2017 @02:08PM (#13446163)
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 =)

Re:Supercharge your Sublime Text 3 to increase your producti... by tedmiston on Friday January 20, 2017 @02:29PM (#13446349)
Thanks, this is really helpful.

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.

[1]: https://www.sublimetext.com/blog/articles/sublime-text-3-bet...

Re:Supercharge your Sublime Text 3 to increase your producti... by farresito on Friday January 20, 2017 @05:55PM (#13447641)
Oh! Yes! There are two ways to do that:

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)

Re:Supercharge your Sublime Text 3 to increase your producti... by devdoomari on Friday January 20, 2017 @10:24AM (#13444411)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by rockdoe on Friday January 20, 2017 @02:54PM (#13446514)
Why do you think it's better than Sublime? Doesn't Sublime have those features mentioned?
Re:Supercharge your Sublime Text 3 to increase your producti... by devdoomari on Sunday January 22, 2017 @04:02AM (#13454349)
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.
Re:Supercharge your Sublime Text 3 to increase your producti... by proaralyst on Friday January 20, 2017 @10:42AM (#13444571)
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.

Have fun!

Re:Supercharge your Sublime Text 3 to increase your producti... by ivanhoe on Friday January 20, 2017 @10:30AM (#13444466)
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...