News for hackers. Stuff that matters.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by emsy on Tuesday February 12, 2019 @10:30AM (#19144226)
What's your argument here? I don't try to be snarky, but learning a new skill is always slow in the beginning. If anything we should encourage people to learn these skills as early as possible so they can reap the benefits longer. I admit vim's learning curve is pretty steep, and I'm glad I learned it during my bachelor's thesis where I had a lot of time to do so.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by tiuPapa on Tuesday February 12, 2019 @10:33AM (#19144264)
Not OP, but I think the argument is that Vim isn't a magic editor that would make you fast out of the box. And if you just want to get work done without concentrating on learning a new skill, maybe you should look at other options?
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by emsy on Tuesday February 12, 2019 @10:42AM (#19144379)
I can only speak for myself, but I've used vim plugins on almost every IDE I've ever used. Unlike editor shortcuts, which are often exclusive to a certain IDE, vim is transferable and that's how it has one of the best cost/benefit ratios for me.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by SketchySeaBeast on Tuesday February 12, 2019 @10:45AM (#19144413)
> Unlike editor shortcuts, which are often exclusive to a certain IDE, vim is transferable and that's how it has one of the best cost/benefit ratios for me.

Doesn't that just mean you've selected VIM's syntax for all your IDE's? Most IDE's seem to have plugins for other popular editors.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by NegativeLatency on Tuesday February 12, 2019 @12:34PM (#19145586)
Seems like it’s the difference between him being supported in many IDEs and say visual studio shortcuts being supported in some thing like Atom. (Support May exist for this, IDK)
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by SketchySeaBeast on Tuesday February 12, 2019 @12:47PM (#19145700)
True, VIM may not be better, but it's a standard so it's well supported.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by weaksauce on Tuesday February 12, 2019 @12:48PM (#19145709)
No, vim is a layer on top of the ide. normal keyboard shortcuts and other editor features still work in say Xcode or visual studio.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by heavenlyblue on Tuesday February 12, 2019 @01:06PM (#19145872)
So does vim support proper refactoring as it is in IntelliJ IDEA for any locally-scoped variable?
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by antew on Tuesday February 12, 2019 @01:12PM (#19145941)
No, but you can use the Vim plugin for IntelliJ and get it that way! There are Vim plug-ins for every IDE I've used.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by emsy on Tuesday February 12, 2019 @10:52AM (#19144487)
I can't reply directly to SketchySeaBeast but you're right, there are probably alternatives. Emacs shortcuts are widely used on terminal emulators iirc. Vim is just one option for a portable, efficient way to edit text.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by TeMPOraL on Tuesday February 12, 2019 @11:09AM (#19144667)
> And if you just want to get work done without concentrating on learning a new skill

Maybe this is a mindset issue, but I'm having a hard time imagining how one would want to just get the work done, without trying to pick up a skill in the process.

Despite the current UX trends of dumbing down software, it's rare you'll use a tool just once in your lifetime.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by tiuPapa on Tuesday February 12, 2019 @11:26AM (#19144842)
Ah I see your point. What I was trying to say is that learning Vim is a separate commitment. If you are not prepared to make that commitment, Vim will slow you down instead of speeding you up.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by TeMPOraL on Tuesday February 12, 2019 @12:23PM (#19145445)
That's true. And if you really believe you won't be needing vim - or won't be solving the class of problems vim is good for - very often, it may not be worth it to explicitly sit down and learn it. The calculus is correct, but the actual values that go into the equation matter a lot.

My wife has used SublimeText and Notepad++ for total of maybe 10 hours in her entire life. I'm not suggesting her to learn Vim (or Emacs), because the kinds of tasks she does with computers don't benefit that much from a proper text editor. However, most developers spent inordinate amount of time editing plain text files, and a lot of tasks they do in other tools - like task management, time tracking, documentation writing, drawing diagrams, commenting on StackOverflow - could receive stupidly huge efficiency improvements by being done in plain text too. Vim and Emacs are the two tools that are dedicated for precisely this class of problems. In my opinion, the couple dozen hours one has to invest over the course of a month to get some basic proficiency in them is worth the across-the-board payoff in work speed and comfort.

--

One trick I've learned is being explicit and deliberate about learning. To things like learning a new piece of software, recursive Pareto rule applies - 20% of time gives you 80% of value. 4% of time gives you 64% of value. So, say you're willing to entertain the thought of learning a little bit of Vim. Allocate a single pomodoro to it right now, and fire up vimtutor. 25 minutes, full focus. You'll notice it only takes a few minutes to break through your own habits and learn the basics of a new interface. You'll be impressed by how much you've learned in just 25 minutes[0]. Next step: commit to 5 hours over a week. 10 pomodoros. Find some introductory tutorials, and work through them this way.

Personally, I did above trick a couple of times to learn new Emacs features. Getting comfortable with multiple cursors, or with paredit, are things that turned out to take 1 or 2 pomodoros, and have been improving my editing speed and comfort for the past couple years.

--

WRT. mindset, a proper one can smooth out the learning curve quite well. The most basic trick that I see even developers not recognizing is this: every time you click on a button in your program, figure out if there's a keyboard shortcut for it. If there is, try to use it instead. Soon, you'll find yourself working much faster and comfortable than before.

--

[0] - though you'll lose half of it in a day. Committing new skills to long-term memory takes more time and exposure; muscle memory takes even more. Good news is, this happens pretty much by itself, as you apply the new skills to the tasks you're doing.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by kamaal on Tuesday February 12, 2019 @11:48PM (#19150489)
There is bad trend going on in the Industry for a while now. It's basically that people want things designed to be good for newbies and no body else. This makes tools easy to pick up, but it makes it very hard to solve complicated tasks with it.

Most people don't want to put in anything more than 40 hour work week these days. Which also means no time to learn and upgrade your skill set. That is for doing their everyday tasks.

Now selling vim or emacs to this set of people would never work for one reason. They just can't get themselves to spend that time.

That's also a big reason why people hate Nerds. These people spend to get better at things in a way we don't want to.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by nickjj on Tuesday February 12, 2019 @11:43AM (#19145051)
OP here. Yeah that's right.

And truthfully, the productivity wins for me weren't so much tied into being able to input text at a faster rate with Vim.

It was being able to leverage Vim itself to help me rethink and reshape how I organize large amounts of structured text, which saves a lot of time and headaches when dealing with files. Plus there's other wins too with limelight and video editing (an added bonus).

I'm still not 100% as fast as I was with VSCode for inputting and editing text but after 2 weeks of using Vim, it's not a complete train wreck anymore. It was brutal for days, but it's slowly getting better.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by luxpir on Tuesday February 12, 2019 @05:32PM (#19148343)
Get yourself autocomplete set up in Vim. For large amounts of prose with repeated vocabulary it really does save time and effort.

Bonus points for using it in mutt for all electronic correspondence.

Also, why the Dickens are you using Windows when your heart clearly yearns for a nice native i3 setup?

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by nickjj on Tuesday February 12, 2019 @07:59PM (#19149392)
> Also, why the Dickens are you using Windows when your heart clearly yearns for a nice native i3 setup?

That was explained a few weeks ago in this post:

https://nickjanetakis.com/blog/i-tried-linux-as-my-main-dev-...

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by luxpir on Wednesday February 13, 2019 @06:10AM (#19152154)
> Pops and clicks in audio

Ah OK. Haven't had that myself, even using USB audio interfaces in a similar fashion, so I wouldn't put that down to Linux. I use monitor speakers and have good hearing and definitely not getting those issues with a simple pulseaudio setup. I flick between youtube, cmus, recording on my old Zoom H2, audio from a VM etc. so have run the gamut of opportunities for it to pop and click.

Sounds like you had to spend a lot of time troubleshooting and in the end thought it wasn't worth the fight. I hear you, but I would see if I could borrow another audio interface from a store or contact of yours before giving up on OS-freedom for good. The Scarlett is an entry-level device anyway, known to have dubious build quality. I'd also take it up with the manufacturer before looking for more fixes.

Good luck!

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by nickjj on Wednesday February 13, 2019 @08:03AM (#19152695)
Yeah it seems isolated to some type of combo of hardware I have.

After I finish this next course I will try again with a different distro, and then see if my other USB mic that worked on the Chromebook (running native Linux) also works on my main machine.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by mda on Tuesday February 12, 2019 @10:36AM (#19144306)
It is an editor that is hard to learn and master. There are other options you could have some / most of the mentioned benefits with much lower investment. Not everyone has the energy / willpower / time to learn vim.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by jcranberry on Tuesday February 12, 2019 @10:46AM (#19144429)
Vim isn't that hard to learn. I think the idea that someone doesn't have the willpower to learn vim is unlikely to the point of being ludicrous. It took me about two weeks of using vim with a printout until I could use it without thinking or having to reference it.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by Phenix88be on Tuesday February 12, 2019 @10:56AM (#19144520)
Vim is not hard to learn, a few hours give you the basic. Vim is hard to master. 3 years ago I started to use Spacemacs with evil (so vim) and I keep learning new vim tricks.

It's a lot of fun and I really can't go back.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by shriek on Tuesday February 12, 2019 @08:59PM (#19149678)
Isn't that the whole beauty of it? You're learning what you've already learned on top without having to re-learn everything again. That's primarily why I've stuck with it. That and the fact that it's easily programmable even though VimL leaves you wanting more.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by phailhaus on Tuesday February 12, 2019 @10:51AM (#19144483)
Have you ever tried to set up a colorscheme for vim? Add plugins, set keybindings? Imagine a non-engineer trying to do any of these things. Even as an engineer it's taken me years of iteration to get vim to a place where I'm as fast as I am, and I still get frustrated setting up a new computer (and I've gone through the trouble of hosting my dotfiles on GitHub!)
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by alpaca128 on Tuesday February 12, 2019 @11:16AM (#19144732)
It can be tricky, but doesn't depend on the user being an engineer. It mainly requires the right mindset.

Some people find even an iPhone too complicated, others don't mind reading the manual for a minute. For some users Vim just makes sense, while certain people will struggle with saving files in Notepad because they think a specific button is at the wrong place and refuse to learn it any other way than they imagined.

> I still get frustrated setting up a new computer

Why is that? Setting up Vim is the easiest task for me, it's literally just a matter of copying some files.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by phailhaus on Tuesday February 12, 2019 @11:47AM (#19145083)
> It can be tricky, but doesn't depend on the user being an engineer. It mainly requires the right mindset.

A mindset that is suspiciously similar to an engineer's. :P For example, you need the user to memorize the fact that all the configs are in a ".vimrc" file in their home directory. Oh and since it's a dotfile they might not see it immediately. And then if they want to add custom shortcuts they need to learn exactly how the syntax works, the different "modes", the types of remaps, etc. It's a horrible experience for a non-engineer.

> Why is that? Setting up Vim is the easiest task for me, it's literally just a matter of copying some files.

I have a lot of plugins (e.g. syntax highlighting, linting, and autocomplete for different languages), and each of those can have their own dependencies that they require you to install before they'll work.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by TeMPOraL on Tuesday February 12, 2019 @12:31PM (#19145544)
It's absolutely a matter of mindset.

I tend to use the example of a car in these topics, but I have a better one: a coffee maker. There are numerous non-obvious things one has to learn about coffee makers - like how to apply a water filter, and what kind to buy. Like the symbols that mean "not enough water", "not enough coffee", "dredge drawer full", and what to do when they show up. Somehow, I never see anyone complaining about this - because there's a social expectation that people can and should figure this out. The coffee machine comes with a small booklet explaining all of this in pictures and a dozen languages.

Yet somehow, with software people think that the UI should just have a button labeled "get my job done", pressing which will get their job done. It's a really broken mindset, because it's impossible (or rather, it's an AI-complete problem) to have software like that.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by falcrist on Tuesday February 12, 2019 @02:03PM (#19146417)
The coffee maker does indeed come with a booklet that explains what various messages mean, and what actions need to be taken to address these issues. Those steps are maybe two sentences long and generally self evident even without the booklet.

People complain about that, because they think things should be handled and explained within the machine itself. I don't complain about coffee machines, but I agree with the principle. If I have to go searching through manuals to figure out what actions I need to take to get something working, that piece of software has failed at user interface design.

Sometimes it's ok to fail at UI. I don't expect everything handed to me on a silver platter when I'm writing a bootloader for an 8051, but I do expect my tools to be reasonably user friendly. Vim isn't user friendly, and that understandably drives people away. Hell, even emacs can be a pain to work with.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by mcguire on Tuesday February 12, 2019 @04:30PM (#19147727)
Fortunately, many other tools are much easier. They can't be configured; you adapt to them.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by creyes on Tuesday February 12, 2019 @11:10AM (#19144676)
I think that it's probably better to start with a solid vimrc and then make changes from there. Ours is pretty standard and included with our standard dotfiles https://github.com/thoughtbot/dotfiles/blob/master/vimrc

A HUGE problem with developers learning VIM is that they think they have to go from 0 - 100 immediately when you can adopt VIM gradually and still see noticeable efficiency increases.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by phailhaus on Tuesday February 12, 2019 @11:50AM (#19145123)
> A HUGE problem with developers learning VIM is that they think they have to go from 0 - 100 immediately when you can adopt VIM gradually and still see noticeable efficiency increases.

That iterative process is exactly what I'm talking about. It's taken years to develop my vimrc, because starting with a "prebuilt vimrc" means that you don't really understand what is pure vim, what's custom, and what issues you might run into because of those custom settings conflicting with new plugins.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by jcranberry on Tuesday February 12, 2019 @01:12PM (#19145942)
The first time, each of those things probably took me like ten seconds. Cloned into folders specified in readmes. Keybindings are even simpler.

Obviously there can be snags on the road and things get more difficult the more complicated things you want to do, but learning the basic keybindings and being able to efficiently edit files with vim just isn't that hard.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by darkpuma on Tuesday February 12, 2019 @06:05PM (#19148615)
Why should a non-engineer use Vim? If you're writing prose not code, then using vim is like using a Hilti rotary hammer to hang picture frames.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by phailhaus on Wednesday February 13, 2019 @05:07PM (#19157571)
Yep! They shouldn't! That's what I'm arguing :)
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by _of on Tuesday February 12, 2019 @11:34AM (#19144944)
not hard. most of those things can be googled in seconds and copy pasted into .vimrc

I would say vim is easier to configure than, for example emacs

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by phailhaus on Tuesday February 12, 2019 @11:43AM (#19145050)
Non-engineer: "What is .vimrc?" And no, for example solarized takes quite a bit of googling to learn exactly which files to copy from GitHub (red flag: non-engineer has to go to GitHub and download a raw file), and then fiddle with the color settings depending on which terminal you're using.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by mcguire on Tuesday February 12, 2019 @04:44PM (#19147859)
Ever tried changing the color theme in Eclipse?
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by nickjj on Tuesday February 12, 2019 @11:48AM (#19145095)
It's funny you mention printouts. They've been critical for my learning process too. I have a standing desk and as of right now I have 6x sticky notes worth of shortcuts hanging down below my monitor.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by weaksauce on Tuesday February 12, 2019 @12:55PM (#19145782)
I say that vim is easy to learn if you approach it from the idea that it’s a vocabulary to edit text and not a bunch of arcane invocations. Instead of learning di” as a invocation to delete text inside the current or next pair of double quotes on the line you learn it as a verb and target... d deletes i sets the scope inside something and “ is the target. Then the next time you want to delete inside something all you need to do is change the target up to say single quote or paragraph. or you substitute the inner with a mark or a line number or a regex.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by nickjj on Tuesday February 12, 2019 @01:43PM (#19146215)
Yeah once I got to thinking about it being almost like a piano, where you're playing notes or melodies to do something it suddenly all started to click.

But still, I have a lot jotted down. Mainly the hotkeys, but also things just to remind myself that a feature exists (like * to highlight the current word).

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by james_s_tayler on Tuesday February 12, 2019 @06:19PM (#19148723)
I don't have the willpower to learn vim. Everytime I even look at it I think... no. And reach for nano instead and just be inefficient and happy. We're out there.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by creyes on Tuesday February 12, 2019 @10:59AM (#19144555)
Hmmm. I'm not sure I agree with this. That's like saying that people use a screw driver to screw in a nail because it's a much lower investment and not everyone has the energy to use a drill.

The premise of the article is that the VIM is better enough than alternatives that it's worth the learning curve. Just like a drill is better enough than a screwdriver to learn ho to use it. If you want to contest that, that's a different discussion.

If your argument is, "some people don't have the energy to use the best tool for the job"... idk how to respond to that.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by falcrist on Tuesday February 12, 2019 @01:08PM (#19145903)
Doesn't the screw driver/drill analogy work here too? Drills cost a lot more money than screw drivers or hammers, require that you be working with screws rather than nails, and don't work unless you have electricity. Hence, they're not a worthwhile investment for everyone.

If you go far enough, you can cause the analogy to break down, but that's true of any analogy. This breaks down because the ROI for a drill is too short to compare with Vim.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by mcguire on Tuesday February 12, 2019 @04:46PM (#19147876)
So, notepad, then? :-)
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by INTPenis on Tuesday February 12, 2019 @12:48PM (#19145705)
The headline to this story is "Vim is saving me hours of work..." which is a lot like "Find out how to lose 10lbs in one week" or "You too can earn thousands of dollars a week with this easy trick".

And trends go around in IT just like any other field. So before someone jumps into vim to save themselves hours of work they should know that it requires practice use to use well.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by nickjj on Tuesday February 12, 2019 @01:40PM (#19146179)
How would you rewrite the headline based on the article's contents? Keep in mind it has to be 60 or less characters too.

I wouldn't say I am learning Vim due to it being a trend. I'm learning and using it based on problems I discovered using other editors to write books and courses.

Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by IshKebab on Tuesday February 12, 2019 @12:53PM (#19145764)
It's annoying that vim is often the default editor (e.g. for git commit messages), because it really sucks if you aren't a vim user.
Re:Vim Is Saving Me Hours of Work When Writing Books and Cou... by nickjj on Tuesday February 12, 2019 @01:47PM (#19146253)
Even without being a dedicated Vim user, I think using it for git commits can be beneficial.

You can use it to visually warn you that your git commit is going past a certain amount of characters. Basically it can help you create better git commit messages.

But if you hate it and are on a Unix-like environment you can export EDITOR="nano" in your profile and now git should use nano instead. I think there's a git specific setting you can set too if you don't want to do it system wide.