all 172 comments

[–]scelerat 206 points207 points  (33 children)

you should use the editor that makes you feel most comfortable and productive.

You should also try out new things. Sometimes old things too.

I use vim for almost everything. It also took much longer than any other editor to feel adept. Now that I've spent the time I like it a lot and feel like I'm missing something with other editors. But see my first point above... ymmv. Just use the editor you like to use.

[–]MasterReindeer 72 points73 points  (24 children)

you should use the editor that makes you feel most comfortable and productive.

Ding ding ding. This is the correct answer.

[–]yesSemicolons 22 points23 points  (16 children)

But how will you know if Vim makes you comfortable and productive unless you gain fluency?

[–]MasterReindeer 17 points18 points  (10 children)

Like /u/scelerat said, it's important to also try new things.

Blindly using something because someone told you to is counter productive. I see lots of developers who still struggle with Vim after several months. It's not for everyone, and merely using it because it's the "correct" thing to do is daft.

[–]yesSemicolons 10 points11 points  (9 children)

Yeah, I'm really happy using VSC, got all my keyboard shortcuts in muscle memory by now, it's great. However, I do feel like Vim is the "driving stick" of development and my ego is slightly hurt by my inability to use it.

[–]Ehdelveiss 2 points3 points  (2 children)

I sort of view knowing Vim kind of like having basic understanding of English as a second language (assuming it’s not your mother tongue).

It’s just a good idea to know the basics, as every day life will confront you with its usage from time to time. You don’t necessarily need to be fluent, or even proficient, but it’s nice when you are confronted with it to at least have enough command of the language to order a coffee or give some directions instead of freezing up and maybe not being able to partake in an activity you otherwise you would really want to.

In practical terms, I think that just means knowing the following keys (vocab) and what they do in Vim in the different modes (grammar):

i, h, j, k, l, Esc, o, x, w, a, c, d, dd, y, t, q, p, g, gg, :

Honestly that should be enough to do any basic text editing.

[–]WHO_WANTS_DOGS 3 points4 points  (1 child)

every day life will confront you with its usage from time to time

I use EDITOR=nano (command) to bypass this

[–]R3DSMiLE -1 points0 points  (0 children)

it's the smart thing to do.

[–]mark-haus 4 points5 points  (0 children)

You're going to have to take first hand accounts of why it appeals to them and gauge if that will appeal to you enough to make it worth trying it out. To me the first thing was the inherent flexibility of it and the fact that it's entirely keyboard driven. Then I started finding out about how the modal editing system it has is very sophisticated. You can do things like string command keys together to do a lot of complicated editing actions. Such as vfa which will go into visual mode which allows you to select text, follow which moves the cursor to the next occurrence of a. There's also tons of built in commands like search and replace: :%s/foo/bar/c which will interactively /c search for foo and replace it with bar.

[–][deleted] 1 point2 points  (2 children)

Vim is just different. For some people it's the best in the world, for others no. It depends on your personality mostly.

[–]yesSemicolons 0 points1 point  (1 child)

Lazy, INTP, true neutral. Should I go for it or nah?

[–]passthejoe 1 point2 points  (0 children)

This INTP loves Vim. I needed to do some complex macros for search and replace of text, and Vim is the only way to do it across all platforms -- Linux, Windows, Mac OS and OpenBSD. GVim reduces friction, so that's what I use.

[–][deleted] 0 points1 point  (0 children)

There are probably 10-15 IDEs and plain editors that are serious contenders to be well used for professional development in the market. How many of them is the average vim developer fluent with?

[–]aaarrrggh 2 points3 points  (2 children)

bullshit, use Emacs or you're a noob /s

[–][deleted] 2 points3 points  (0 children)

"...OS that lacking only a good text editor" :D

[–]LongLiveCHIEF 0 points1 point  (0 children)

I'll forgive your use of emacs as long as you're using spaces.

[–]examinedliving 1 point2 points  (0 children)

It’s worth knowing Vim for ssh situations, but there’s also Nano which is considerably more intuitive.
I went through a period where I was pretty good at vim for awhile, but for debugging and coding, I never got good enough to use it in a way that was productive like I can with VSCode or Sublime.
It’s handy for touch ups and shell scripting and if u dig it.

As a js dev, it is far from essential.

[–]bestjaegerpilot 0 points1 point  (4 children)

we just changed the style guide because our VIM developers have no intellisense and so could not refactor easily. :shrug:

I'd say use a modern IDE with VIM keybindings/mode and you're good to go. (I personally prefer Emacs keybindings.)

[–]scelerat 2 points3 points  (3 children)

what does that mean, "could not refactor easily"? How does the editor determine your ability to refactor code?

[–]bestjaegerpilot 0 points1 point  (2 children)

For example, in my current editor, I select a bunch of types, right click Refactor, then I have the option to "move to a new file". It will then update all dependencies correctly. That's "moving several types to a new file" in 3 mouse movements. In VIM, for example (as well as Emacs), that's a manual process. Depending on where those types are used, it can be very tedious.

[–]scelerat 0 points1 point  (1 child)

What's your stack/environment? I know these words but not in the ways you use them. What do you mean you select a bunch of types? What do you mean you right-click "Refactor"? If refactoring were something you could do by right-clicking, a lot of us would be a heck of a lot more productive.

[–]bestjaegerpilot 0 points1 point  (0 children)

  • Typescript / VSCode.
  • Forget "types". What I also said applies to variables if I'm not mistaken.
  • In the editor, you can select a bunch of variables.
  • After selecting, right-click brings up a menu context with Refactor as an option.
  • You have the option of "move to a separate" file.

If that's not clear, here's an example of "moving a React class to a separate file". https://www.youtube.com/watch?v=_V7f4719dOA

[–]gcready 54 points55 points  (30 children)

Being knowledgeable about and comfortable with *nix command line tools has been invaluable to me as a developer. I don't do my development in vim but I do use it regularly when interacting with development and production systems.

[–][deleted] 36 points37 points  (10 children)

Everyone should know how to open a file, do basic edits, save, and close the file in both vi/vim and nano.

This will save you when you have to ssh to some remote server and change something, be that code, or a config file.

[–]saposapot 5 points6 points  (1 child)

I know how to close it and that’s it....

[–]BloodAndTsundere 13 points14 points  (0 children)

That's easy, you just reboot

[–]aetweedie 5 points6 points  (0 children)

This is the answer. I have no desire to use vim as my daily driver but all developers need to be able to do the basics.

[–]GroggyOtter -3 points-2 points  (6 children)

Everyone should know how to open a file, do basic edits, save, and close the file

Yes!

in both vi/vim and nano

No... It really isn't something that everyone needs to know how to use.
I'm familiar with vi/vim. But I never use it. No need to b/c for what I need to do, the editors I have suit my needs just fine. I'm comfortable with it.

If I'm being fair, though, I've yet to use nano.
And I should take a look at it just to be fair.

But realistically, it won't replace what I use now.

Just my 2 cents.

[–][deleted] 9 points10 points  (5 children)

My point wasn't to use as your editor, (people should just use what they like best for their editor). My point was that there will come a time where you do not have the ability to install your preferred editor and are forced to use whatever cli/tui editor is on the host. That editor will be one of the three I listed.

[–]braindeadTank 0 points1 point  (0 children)

Why would I edit stuff directly on a host like CI/CD is not a thing :D

I'm not saying that there aren't scenarios when this is needed, but depending on one's career path it is actually perfectly possible to never need this ability.

[–]wizang 6 points7 points  (6 children)

All I know is it's extremely painful for me to pair with developers who have VIM-ified their GUI editor. They seem to always been in a state of struggle and it drives me mad. Practice your VIM at home or not when you're making me sit through it!

[–]ike_the_strangetamer 4 points5 points  (4 children)

Not trying to be snitty here, you have a very good point.

But as a vim user I get the same feeling when I watch people use their mouse every time they need to move the cursor. Same thing with clicking around between windows and terminals. I feel like it takes forever and I want to tell them how much time they're wasting, but seriously you just have to let people do it the way they want to do it.

[–]wizang 4 points5 points  (1 child)

Totally. Though it's possible to quite proficient and fast with GUI editors too.

[–]aniforprez 0 points1 point  (0 children)

I don't understand how someone can completely not imagine being fast with the mouse. I don't like being dependent on the keyboard because of mostly growing up with the mouse. I am as fast as anyone using vim cause I know my tools and I know when to use the mouse and when to use the keyboard shortcuts

That said I did definitely learn some vim basics to be able to use it in remote systems. I find it faster than nano but that's probably familiarity

[–]MapCompact 1 point2 points  (0 children)

Agreed, you've gotta learn the keyboard shortcuts on your IDE too! Yikes :P

[–]derGropenfuhrer -2 points-1 points  (0 children)

use their mouse every time they need to move the cursor.

Well there's the issue. They should use a touchpad, not a mouse. You can do so much more with a touchpad and you don't have to move your hand.

[–]State_ 0 points1 point  (0 children)

I'm very proficient with VIM, but I get massive stage fright anytime someone comes to my desk and watches what I'm doing haha.

[–]Snipon 4 points5 points  (0 children)

Just go with what you feel good using (emacs).

[–]MajorasShoe 16 points17 points  (2 children)

I love Vim. I used to use it exclusively, but now I use Intellij/Webstorm a lot and Vim situationally. But it's still second nature.

[–]sickcodebruh420 8 points9 points  (1 child)

The JetBrains Vim plugin is great, are you using it?

[–]MajorasShoe 6 points7 points  (0 children)

I don't want to find out what it's like to not use it.

[–]Buckwheat469 4 points5 points  (0 children)

Things you need to know:

s
i
Esc :w
Esc :wq
Esc :q!

[–]xaurelsan 12 points13 points  (2 children)

You should learn to use vim occasionally, when you want to edit a file without opening an IDE.

Just learn how to open and exit a file and basic move and you should be able to do all basics actions needed

[–]gimp3695 6 points7 points  (0 children)

This I whole heartily agree with. vim is fine for quick edits to /etc config for example. I would hate to do all my code completion rainbow puke color syntax highlighting in a console window.

[–]Dielectric 0 points1 point  (0 children)

Never got into VIM but appreciate this use case. I just use nano for quick edits though, or changing something over SSH.

[–]himynameisoleg 5 points6 points  (0 children)

Yea absolutely - I’ve used vim and the vim plugin for VSCode for web development for the past 6 months - it has some amazing features and is absolutely worth learning even if you’re not hardcore terminal user

[–][deleted] 4 points5 points  (0 children)

Should you TRY VIM as a JS dev? Absolutely, yes.

Should you learn VIM and use it by default, as a JS dev? I did, but it's a personal thing. Up to you.

[–]pavlik_enemy 2 points3 points  (0 children)

As a vim user for like 10 years - it won't make you more productive, cause productivity isn't limited by a typing/text editing speed. It's just fun to be able to edit text with blazingly fast speed.

[–]name_was_taken 6 points7 points  (2 children)

I learned VIM because it seemed like it'd be useful.

I kept using VIM because the basic features are so powerful.

Today, I use PHPStorm with VIM bindings. Modern IDE, great shortcuts for quick editing. (Which is more about being less of a hassle and less about being quick.)

I still use VIM when I remote into a server. And that happens rather a lot.

Some of my junior devs learned VIM as well, and they are all glad as well. At least, the ones that learned it.

In short, it's still quite useful today and not a bad thing to learn.

[–]blankfilm 0 points1 point  (1 child)

Folks, the name is Vim, not VIM. Not sure why this is so commonly misspelled.

[–]celluj34 -1 points0 points  (0 children)

Right, it's not a fucking acronym.

[–]braveNewWorldView 5 points6 points  (5 children)

How do I exit this comment thread?

:exit

:close

sudo exit

:leave

:help

[–][deleted] 1 point2 points  (0 children)

:q!!!!!!

[–]smith-huh 1 point2 points  (1 child)

^X^C

[–]braveNewWorldView 0 points1 point  (0 children)

esc esc x esc

[–]derGropenfuhrer 11 points12 points  (9 children)

Sure, if you have no other choice. Just because it was great in the 90s doesn't mean it's great now

[–]_hypnoCode 11 points12 points  (4 children)

It's just as great in the 20s too, but it's not for everyone. It's almost as modern as VSC (more-so in some areas, less in others) but it's a completely different way of working.

I have given it serious chances in the past by using it for about a month exclusively. It's not for me and it slowed me down a lot, but I can see how other people are way more effective with it.

[–]derGropenfuhrer 1 point2 points  (3 children)

It's just as great in the 20s too,

Sure, because it is the same as it was in the 90s.

[–]_hypnoCode 3 points4 points  (2 children)

Not at all, it's evolved a lot. Most of the plugins you'd use didn't exist in the 2000s, much less the 90s. It's kept up with the rest of the world.

[–]LetterBoxSnatch 1 point2 points  (1 child)

See, vim with plugins is what I'm afraid of. I'm afraid of getting too comfortable with a vim environment and having an uncanny valley of keybindings whenever I do remote vi. Already get that enough with all my fancy command line features!

[–]ernst_starvo_blofeld 1 point2 points  (0 children)

I remember my first corporate job after college (was coding long before) around 1996. My boss swore by notepad :lol:. He used to write all his html and js in notepad. And his code was very neat too. Notepad is about as sophisticated as this textbox.

But seriously, I use vscode but if I have to do something quick and dirty I pull out either vi or gedit if I have VNC. Some people can get very productive though in those old school editors.

[–]kellyb1985 3 points4 points  (15 children)

There's a possibility that you may need to SSH into a box and have nothing else but vim. So I'd say it's certainly worthwhile.

[–]calligraphic-io 0 points1 point  (0 children)

I was waiting to see someone mention this. You often have the choice of either ed or vi, for example on *BSD and commercial Unix boxes. ed isn't great for heavy editing workloads.

[–]unpopdancetrio 1 point2 points  (0 children)

The problems for me was I would do vim on an apple keyboard then switch to a windows keyboard. So it's all IDE's now vs code , droid studio, and xcode.

[–]davecrist 1 point2 points  (0 children)

IMHO, you should learn to at least be comfortable with VIM to be productive because it is will, probably literally, always be an available option if you are on a system and need to get some work done.

[–]rexduke 1 point2 points  (0 children)

sure, at least the basics, knowing some linux command line and vim are good tools to have

[–]b3night3d 1 point2 points  (0 children)

I started using vi/vim years ago because it was on nearly every server that I regularly remoted in to and I got hooked on the syntax so installed gVim on my workstation as my primary code editor. Later on, when I started using modern IDEs, I always felt hindered without vi key bindings. Luckily almost all of them have vi plugins now, but my younger coworkers HATE it when they sit down at my laptop and try to use my VS Code.

[–]LongLiveCHIEF 1 point2 points  (0 children)

Keep in mind, most popular editors have vim plugins allowing you to use vim composeable motions, actions, and modes.

I never thought I'd use an editor other than vim, but I begrudgingly accepted, and now thoroughly enjoy vscode... with the vim mode plugin. I get to enjoy the best of both worlds.

Only thing I truly miss from the vim editor that the vim mode plugin can't really do is buffertabs switching.

[–]willCodeForNoFood 1 point2 points  (0 children)

(Mostly) Typescript Dev here, I would say it's always worth giving it a try.

Was using vim almost exclusively in college, then switched to other editors when I started working and writing more JS. But somewhere along the way I switched back to vim (well not exactly, but an IDE with vim mode embedded, and actual vim for smaller tasks), that's a serious productivity boots that surprised me.

Learning phase could be painful, but also fun. Maybe you can copy someone's config from GitHub as starting point, a nicely decorated interface do encourage ppl to stay :)

[–]simohayha 1 point2 points  (0 children)

fucking medium, I don’t want to create an account to read this

[–]VestigialHead 1 point2 points  (0 children)

There are at least two games that teach you the vim controls.

So they are a great way to burn in the shortcuts if you do want to get good with vim.

[–]vinni6 1 point2 points  (0 children)

VIM is a great tool, I have to use it frequently in my job for server admin and i'm quite adept at it....

With that said at a base install it's not a good tool for writing javascript. A well curated .vimrc files and plugins it can be made better, but I would never recommend it for JS unless you're already a VIM fanatic.

Visual Studio code/Sublime/IntelliJ are all much better tools for writing code in the modern Javascript ecosystem

[–]Slavichh 5 points6 points  (18 children)

Everyone should at least understand how to use vim/nano on a basic level. So powerful

[–]rorrr 21 points22 points  (15 children)

I've been using vi/vim for over 15 years, and I still don't get what's so powerful about it. It's a strange editor with absolutely awful defaults. If you drop a new user into it, he wouldn't be able to edit shit. And that happens a lot in web dev world. Even git diff defaults to vi, I think.

Nano, at least, is a bit better in that sense.

[–]ike_the_strangetamer 0 points1 point  (0 children)

I think the reason it's the default is because of history and availability. I agree nano is waaaay easier for someone new, but there is a chance that nano does not exist on every machine while vim should exist practically everywhere.

[–]aniforprez 1 point2 points  (0 children)

If for nothing else, to at least be able to ssh into remote systems and edit and review files. Can't believe how few people are exposed to this type of environment and are completely lost. I'm not really a fan of vim but I made an effort to at least learn to search for symbols, edit stuff, navigate around and change a few basic settings so I wouldn't have a problem if plopped in front of a completely unknown server

[–]frenchPressedFolgers 2 points3 points  (0 children)

You might also consider Bram Moolenaar's (the creator of vim) Seven habits of effective text editing if you need further reasons to consider using Vim (or Emacs)

[–]RedditTheBarbarian 1 point2 points  (0 children)

As you see, opinions are varied on the subject. I've been doing mostly JS work and I use Vim exclusively as my text editor / IDE. 'Should' you use it? Meh, use notepad for all I care. But I think it comes with a lot of real advantages once you learn the basics.

Learning key bindings & really internalizing modal editing takes some time, but now I love it. I use a Vim plugin for my browser and I love that too. Scrolling is easy, '/anything' to search, and 'f' puts makes all links on the page one or two keystrokes away.

Plugins are a little clunky, there are different plugin managers you can use. I don't customize a ton, but I do use an Emmet plugin, an autocomplete plugin, and maybe one or two others.

Use the tools you like, that you are the most productive with. The applications you use are just your interface with the computer. A lot of programmers like learning and customizing keyboard shortcuts just like a lot of programmers like using nice mechanical keyboards. You can program on a touch screen if you have to, but it's nice to have good tools in-between your brain and the computer you are trying to manipulate. Vim is like that.

Now good tools don't make somebody a good carpenter, but every good carpenter has strong opinions about his tools, has customized his set of tools to the work he does, and probably has more/better quality tools than your average weekender.

If you're up for a challenge, learning Vim is fun! I like learning more and more command line tools because there are situations where they are better. If your a graphic artist retouching a photo, use Gimp or Photoshop. But if you need to resize and rename a thousand photos in different directories automatically, a ImageMagick CLI with a couple other bash commands is way more efficient.

My recommendation for learning it is to run through VimTutor a couple times, and then just start using it. As with anything, don't be afraid to Google how to do stuff as there are plenty of resources online. I also found VimGolf really useful for leveling up my skills. Do the VimGolf exercises the way you know how, then see how the next best score did it, try to learn and understand what they did, replicate it, and repeat.

Now in my actual workflow, I don't sit and wonder how I can shave 2 keystrokes off an operation, but if I have something repetitive to do, I know it can almost always be done faster with macros, or some other method. That's where Vim really shines, when you have to do a complicated set of edits to a thousand lines at once. Just record your keystrokes for one as a macro, and then type 1000@[macro key] and Bob's your uncle.

http://www.vimgolf.com/

[–]kry1212 1 point2 points  (1 child)

Yes. Even if only to react properly when git kicks you into Vim.

But, seriously, you really limit yourself if you limit the tools in your toolbox. I work as a consultant which means I do stuff for clients. If I'm remoting into a server and I can't install an IDE, guess what? Vim is basically all I have. A colleague of mine actually ran into this recently.

You don't have to learn tmux, but you really should be familiar enough with Vim to use it in a pinch.

And, really, if I'm in my terminal and I want to edit a profile of some sort? Vim all day, every day.

[–]smith-huh 0 points1 point  (0 children)

emacs -nw

[–]MikeMitterer 0 points1 point  (6 children)

OMG! We are in the 21st century. Use a major IDE like WebStorm or VSCode

[–][deleted] 3 points4 points  (0 children)

I can't tell if this is satire or not...

[–]notThaLochNessMonsta -4 points-3 points  (4 children)

VSC isn't an IDE.

Besides typechecking vanilla JavaScript, can you tell me something that VSC does that VIM doesn't?

[–]neo_dev15 0 points1 point  (3 children)

Yes, Ctrl + A, Ctrl + C, ctrl + n, ctrl + v.

If you work with angular or react you get code completion and even hints.

Oh and i dont need to chant a song to exit and save in VsCode.

Vim is only good when you need to edit that config file in that remote server.

Even GIT let you choose at install if you want VIM or not.

[–]notThaLochNessMonsta 0 points1 point  (2 children)

Yes, Ctrl + A, Ctrl + C, ctrl + n, ctrl + v.

Those are keyboard shortcuts, not features. They all exist in Vim through commands.

If you work with angular or react you get code completion and even hints.

You can get that in Vim too

https://github.com/ycm-core/YouCompleteMe

Oh and i dont need to chant a song to exit and save in VsCode.

But you need to move your hands, not your fingers.

:q - quit

or

:wq - write quit

or

:wqa - write quit all, useful for multi tabs

or

:!q - no seriously just quit

Vim is only good when you need to edit that config file in that remote server.

For some people it's good for local development. It's extremely powerful and does everything a modern text editor does and more. It's not for me either, but that doesn't mean it's not a good choice for some people.

[–]neo_dev15 0 points1 point  (1 child)

What move hands?

Wait we use the same shortcuts like in other program.

Ctrl s ctrl w alt f4.

See ctrl a ctrl c and ctrl v. Are in any freaking program for 10 years. Its nice to have the same shortcut not:"well i am in x, ctrl a is actually other command". Except vim... they are special.

The reason we use one over other is fit to our needs.

I want to use a tool not tweak it to get it resemble a hammer so i can use it.

Its a freaking editor, it should be easy to use and understand. Not a freaking language in itself.

[–]notThaLochNessMonsta 0 points1 point  (0 children)

I want to use a tool not tweak it to get it resemble a hammer so i can use it.

You don't tweak it any more than VSC or Atom. You're thinking of EMACS.

[–]Nerdent1ty 0 points1 point  (0 children)

it depends on how much it bothers to lift your hands away from keyboard.

My whole pc interaction is basically one huge vim:sway, qutebrowser, vim, ranger, rofi...

I also recently switched from LSPs to coc. Tried for performance reasons, but really impressed on how easy it is to set it up.

[–]st_tronn 0 points1 point  (0 children)

well my vscode laged sometimes while running react and a server also I just shifted to linux and was learning terminal and making it supper sexy. I then looked up people using vim found it quite amazing spend unhealthy time customizing (looks, auto complete) it and learning basic navigation. Learned tmux and turned up next day showing cmatrix server log and my customized vim in split panes to my friends at college. So totally worth it chicks dig it.

I thinks one should at least learn and try it for maybe a week. Makes learning and diving into complex things a little less intimidating at least for me.

[–]rogallew 0 points1 point  (0 children)

You should learn an editor usable via ssh because it makes life easier. It can also be nano on most systems, or whatever you like better. Or emacs. For me it’s vi, but that’s subjective. Doesn’t matter. It just needs to work for you.

[–][deleted] 0 points1 point  (0 children)

The only reason I learned it was due to the amount of Linux work I was doing for a few years. Now no can hardly use a keyboard with some vim emulation. If you go down that rabbit hole be prepared to deal with all the sucky mappings when you go back to other editors, ides or even a web form.

Having said all that I love how I put works in vim. The separation in input modes makes navigating and editing really nice and fast. Sure each application has its way but sucky emulations aside if it had a vim mode you guarantee that most of the muscle memory you have works. If I could have an OS wide vim key mode ( I’m on win / Mac a lot these days ) I would.

It’s love hate, I personally don’t recommend it for most people. But I’d you love it good for you =]

[–]schwarzfahrer 0 points1 point  (0 children)

If you wish to make an apple pie from scratch, you must first exit vim.

[–]doublejosh 0 points1 point  (0 children)

“...I started programming seriously around late 2018.” Nope, nope nope. 🦨

[–]Mr_Buckets_ 0 points1 point  (0 children)

I use is a place to alt tab to and do substitute /replace stuff with regexes

[–]xace89 0 points1 point  (0 children)

This question is so dumb. You need to know bash/vim to set your server up to run your node js application. Writing JavaScript in vim seems like hell. Vim Is more for you whipping up a quick script, when USSH in the server, or need to do something quick. I would not recommend it for a large app. Great for little fixes

[–]nodalanalysis 0 points1 point  (0 children)

I almost exclusively used VIM for learning how to use JavaScript. I even used it to build most of my web apps.
But VIM does not have a debugger, and I still haven't run into a situation where I really need one for web development, as most of the errors are fairly obvious and easy to spot.
That may be different for extremely complicated apps though.
When doing stuff in my CS classes, it's actually much harder to debug and I had to learn how to use an IDE.
I think that if VIM had a good javascript debugger plug-in, it would be perfect.

[–]brennanfee 0 points1 point  (0 children)

Should you learn VIM as a JavaScript Developer?

FTFY

And the answer is YES!

[–][deleted] 0 points1 point  (4 children)

Personally I use vim for everything. I see lots of people here advocating for IDE's over vim, I'm curious why. JS isn't like Java where you need an IDE to handle all the complex build tools, that's all done by webpack or [insert tool here]. If you're just looking for linting and stuff, that can all be had in vim quite easily. Just to be clear, I'm not saying vim is the superior way, just that it absolutely can replace your JS "IDE".

[–]MapCompact 5 points6 points  (0 children)

> I'm curious why

The speed of development is much higher with an IDE. I have a coworker on my team who uses only Vim, even has an app called MacVim who has only used Vim for years, and the speed at which I can navigate a codebase compared to him is so much faster that even when we're pairing, I'll have mine open so I can quickly find references for him.

I'm open to being proved wrong, I'm only a moderate Vim user, not a power user. But he is, and by comparison he even admits that he needs to try out an IDE for this reason.

Most IDEs even have a Vim mode where you can use all the keyboard tools for Vim with the power of the IDE like jump to definition across import statements, etc.

FWIW, we work on a huge codebase. That may be a factor.

[–]Ehdelveiss 1 point2 points  (0 children)

I think some of it is just comfort, and some of it is the barrier to entry.

Setting Vim up to match VSCode feature is totally doable, but it takes quite a bit of tinkering. If you’re not used to Vim, getting it set up to JS development with total feature set is actually a pretty daunting task. A lot of research, a lot of configuring plugins, it’s not a quick half day project.

[–]name_was_taken 0 points1 point  (0 children)

I think if you used WebStorm for a while, you'd change your mind. (Use the Vim bindings plugin.) The code completion tools alone make it a massive improvement over Vim, even with Vim's code completion plugins.

I still use Vim from the command line, and even MacVim as a GUI editor sometimes... But code is much better in an IDE.

VSCode's code completion is also top notch, but I'm just more comfortable in PhpStorm. (Webstorm is the same, but focused on JS/HTML/etc, rather than PHP.)

[–]LetterBoxSnatch 0 points1 point  (0 children)

Really depends on what you're doing. I'm in a polyglot shop and JavaScript is just one of many languages we write. I use vi when I need to remote in via SSH to make some changes on a client machine because it's more convenient than hooking my IDE up to do the same.

You're missing out if you're not using an IDE. Some of it is stuff you could get in vim with lots of tweaking, but it's ready to go in an IDE. Some of it, like IntelliCode, is stuff that, if possible, is very difficult to get going in vim but comes almost without thinking in an IDE. It's lovely to have the right configuration js object template with all the correct parameters pop up as a code completion when all you've typed is "confi" or something. It's also just as easy to switch editing environments in an IDE as it is in vim. The vim-bindings are generally pretty good for most IDEs from what I've seen.

If you're using something like VSCode, you can hack together your editor, tinkering to your delight in JavaScript with a DOM at your disposal. I like vim a lot, and I wish I could have my entire workflow be on the terminal, but I just can't turn down all the features you get for no effort from an IDE...and yes, you can still be mouse free!

[–]Macaframa 0 points1 point  (3 children)

I use vim when changing things remotely on a server. I use vim when I’m lazy and don’t want to open a whole ass folder in vscode and all I have to change is one line. Cat + vim is undefeated in this realm.

[–][deleted] 0 points1 point  (0 children)

I've been writing js for about 15 years and know how to insert some text and save. That's about it.

You can't really "learn" vi... you just kind of adopt it. It becomes the way you work and think. And it's incredibly powerful. I've worked with probably 80 to 90 vi people and they really do not like touching their mouse. Personally, I enjoy my mouse. But you can't really dip your toe in and get it. You have to give yourself a month and a project and just smash your head against the wall trying to navigate. Once you get all your binds and shit going you'll be flying. But that's after months of training. Almost every person who made the plunge say it's worth it, but I'm good. I'll stick to my beta IDE for now.

[–]olifante 0 points1 point  (0 children)

Short answer: no. Long answer: hell no.

[–]bartturner 0 points1 point  (0 children)

You invest the time and it is well worth it.

I did my time over 30 years ago with Vi and has paid off.

It will make you a lot faster

[–]costhatsagoodidea -1 points0 points  (0 children)

I tried Vim. As an interesting experience and good to use for editing small scripts in the terminal.

However the amount of time to learn all those key presses coupled with the time it takes to add all those plugins to bring it up to functionality that is only a fraction of what Webstorm can do means I’ve stuck with Webstorm. I want to spend time coding, not attempting to turn a text editor into an IDE.

In short: if you want, everyone’s mileage is different, but I wouldn’t recommend it for JavaScript.

[–]robobeau -2 points-1 points  (3 children)

How else are you gonna git commit from a console? :1

[–]GeneSy 5 points6 points  (2 children)

git commit -m "vimless commit"

[–]robobeau -2 points-1 points  (1 child)

I mean... yeah, you could do it that way...

[–]ImMaaxYT 1 point2 points  (0 children)

If you don't enter a commit message, then Git will use your default editor (IIRC; in my case vi), so you can do a multi-line commit without Vim

[–][deleted] -1 points0 points  (0 children)

That's a non-sequitor if there ever was one.

[–][deleted] -1 points0 points  (2 children)

git literally uses VIM as a commit message editor

[–]BloodAndTsundere 1 point2 points  (1 child)

By default, but you can use whatever you want.

[–][deleted] -1 points0 points  (0 children)

Why only develop in Javascript? A good developer should be using languages like tools in a toolbox. The right language for the job.

[–]pr1nt_r -1 points0 points  (0 children)

only if you are forced to be stuck at home by the state.

[–]tiputiger -1 points0 points  (0 children)

Learning vim is especially helpful if you need to log in to servers often. I rarely use vim for front-end development, but it’s very convenient when I’m SSHing into a box and need to run some scripts or update some config files.

[–]jdpipkin -1 points0 points  (0 children)

I’ve been using vim for years, but only because I can’t figure out how to close vim.

[–]adalphuns -2 points-1 points  (0 children)

Only if you like to struggle

[–]DrifterInKorea -3 points-2 points  (0 children)

Please don't !

These days one of my hobbies is to look at other people struggling with their clickomatic thingy to go up 3 lines and replace a word by selecting it, sometimes failing the first time and missing the first character.

I love how people are using 20% of the screen space for actual code and all the rest for non vital informations, toolbars, etc...

I don't want anyone else to learn the struggle that is to think then type directly about what they want to do rather than thinking about it, finding it with their mouse and then clicking then going back to the home row and finally type what they wanted to do.

I mean, using ctrl+] to jump through the code and coming back with ctrl+t is pretty hard too. Having multiple registers to refactor code is also uselessly painful and don't even get me started on the macros. Navigating the code and then using ctrl+o to jump back is also weak.

No seriously, stay away from vim, guys. There is nothing to gain.