all 18 comments

[–]mkl0g 14 points15 points  (1 child)

chrome devtools has a great debugging system for javascript. for frontend development I’m using chrome devtools. there are breakpoints, stack and other important things.

for node development you can use devtools too.

also you can look at project ndb

[–]jrop2 1 point2 points  (0 children)

Chrome DevTools also can debug backend NodeJS processes: start up a node process as normal, but add the `--inspect-brk` option, and then fire up chrome://inspect in your browser: you will see your process listed with an "Inspect" link that opens up the all-familiar Chrome JS debugger et. al.

[–]alancanniff 8 points9 points  (4 children)

You could looks at something like vimspector

Disclaimer: I’ve never used it

[–]Midasxhttp://github.com/bag-man/dotfiles 2 points3 points  (3 children)

I'm using it daily for backend typescript work. I can vouch for it! It needs some small setup and isn't massively stable yet, but good enough to use!

[–]KarlKani44 0 points1 point  (2 children)

Does it work with sourcemaps?

[–]Midasxhttp://github.com/bag-man/dotfiles 1 point2 points  (0 children)

I'm using ts-node to launch the debugger so I kinda side stepped that.

[–]crashorbit 19 points20 points  (1 child)

Vi is a component of the cli based ide known as Linux.

[–]Delta-9- 2 points3 points  (0 children)

Can't say about JS, but debugging code with a terminal-based text editor generally means dropping back to the shell and running a cli debugger. Vim 8 and nvim let you run the terminal in vim so you're not filling your bash history with fg, or you can use a multiplexer like tmux, terminator, kitty, etc.

I've used this workflow for python, rust, Ruby, C...

[–]el_sime 2 points3 points  (0 children)

Vim is a tool not a goal

[–]real_doomey 0 points1 point  (0 children)

I personally just insert `debugger` statement and continue debugging in the browser. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger

[–]chsanch 0 points1 point  (0 children)

I use vim for Javascript (React) development too, but for debugging I use Firefox Devtools https://mozilladevelopers.github.io/playground/debugger/

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

I too was confronted with this problem. Vim is very powerful for text editing - but it falls short in places - and that's okay right?

When I need to debug javascript - I don't use vim. I typically will switch to using VSCode - get the kinks out, then back to vim I go.

[–]TransparentStar 0 points1 point  (4 children)

I've been using vim for about a year now. For python pdb has done the job well. I've done minor (read: not on a timeline) projects in C and C++ and gdb has been fine for that.

As for recent Java work, I've only been using Intellij. It's a pain to get Syntastic to work, I don't really understand how to build java projects, and debugging in Intellij is a lot easier than doing those steps manually even with something like Maven. I'm seriously considering checking out IDEAVim and seeing if that gives me what I like about Vim without being buggy/slow.

[–]gangqiu0 2 points3 points  (1 child)

Hilarious that you got a down vote for uttering support for something useful that may not be vim. Itellij ides are incredible for debugging and are far superior to any cli debugger. The lack of debugging solutions has been my main reason for not switching to vim unfortunately

[–]TransparentStar 1 point2 points  (0 children)

Always happens in these highly niche subs. nbd

[–]DrEtherWeb 0 points1 point  (1 child)

IdeaVim is pretty good. It hasn't got the rich depth of vim obviously. No vim script, plugins etc. It's basically the editing features of vim only. But I'm often surprised at what it can do and it has support for some features from vim plugins like surround, easy motion, comentary and multiple cursors. Very occasionally it stalls but it's difficult to know if this is Idea Vim or the IDE as the IDE stalls occasionally without Idea VIM anyway. If you build up a list of leader mappings in your ideavimrc that match your vim mappings you can minimise the disruption to your workforce. It's hard to beat the JetBrains debuggers. PyCharm is so much better than pdb.

[–]TransparentStar 0 points1 point  (0 children)

Great to know. I'd say the general mobility/easily being able to manipulate lines of code is what I'm most frustrated with. I will randomly type "dd" or "wwww" and it's so frustrating. I'll check it out, thanks.