Vim Doesn't Need Built-In Debuggers

preview_player
Показать описание
One of the common questions about using Vim instead of IDEs is "how can I debug my code", and in this video I will explain why the fact that Vim doesn't include many debuggers built in is actually a good thing.
Рекомендации по теме
Комментарии
Автор

I think you actually showed why IDE is great for debugging. To complete similar basic workflows you need to perform way more actions and memorize more stuff then click play button on your ide. Instead you could show what is possible to achieve with gdb and where it is stronger than its simplified IDE integration

Zmeu
Автор

Vim may not need one... but Vim does have one... since vim 8.0. one that uses GDB.

:packadd
:Termdebug <binary>

Also, it's possible to get a graphical look at where you're at in your code, where breakpoints are set, etc. when using GDB's TUI option

gdb -tui <binary>

It's kind of buggy though (src lines get wonky and duplicated).

all that to say, in VSCode you can still debug with GDB and run all the same commands GDB supports.

I do most of my debugging in GDB, but can't deny the convenience of modern IDEs ability to visual the code space with me having to type a million commands all the time.

ChrisCox-wvoo
Автор

I like vim, but you can get much more productivity on vscode, plus you don’t need to know many different tools to debug, also you have plenty of good extensions like those to access databases, reading drawio files, etc

TheWellington
Автор

i like forcing my debugger into vim, if you get good at working with lua, then you have one program with similar keybinds for many tasks. But a seperate debugger is nice. Peronally, I have a sperate window just for debugging with nvim on tmux. Just because i have a window for coding, debugging, running commands / watching output, etc..

jefferymuter
Автор

Yep, shoehorning a graphical debugger in Vim always seems non functional. That said, if you need an external IDE to get the nice debugging experience, then you lose all the point of having a lightweight editor since you now need to run Vim + your IDE.

LuccDev
Автор

Thanks @ChrisCox-wv7oo for pointing out that Vim can connect with GDB, if you want more information check out ":help Termdebug", this can be handy in case you are using GDB as the debugger.

nirlichtman
Автор

Totally get what you're saying. I tried a full nvim setup but moved back to JetBrains mainly because of the debugger. In Python, seeing N-darrays visually is a game-changer. And in CLion, seeing all variables at a glance is nice, but vim-bindings would be cool. I use gdb and lldb features in CLion too, like custom struct prints. For me to go back to nvim, it'd need a solid debugger that can automatically recognize start points in code and save them in a window for easy access later on. In the video, the gdb setup seemed like a lot of steps, especially for new projects. Just pressing 'debug' in any JetBrains IDE, even with custom setups like cmake, is so much simpler.

mdxggxek
Автор

wtf are you using windows terminal in linux?

AdamS-lomr
Автор

oh lol, i am not going to watch 10 next videos in the playlist all generically titled "cool commands to save time" 🤣😂
i am not sure there's much that can be done about it though..

yash
Автор

0:53 python's pudb is good. rest all (gdb, chrome web tools, python's default pdb) suck one way or the other.
or, jetbrains' ide (intellij, pycharm, etc) debuggers are good too. they too don't throw much at the editor, rather focus on making the data (values, variables etc) while debugging to be easier to access and watch

yash
Автор

It's a shame that so many other languages don't have a simple CLI debugger.

trev-dev
Автор

I feel like this experience is still limited, or at least clunky compared to something like the JetBrains debuggers (IntelliJ, Clion, PyCharm). Being able to set like points directly from your editor, and do things like add conditional breakpoints and watches, all with the same auto complete that you get in your editor is a game changer.

AkilManivannan
Автор

Why still vim bro it's 2024. Last day i tried to i stall typescript, jsx, react support to neovim, boy it was disaster. Community is sparse: lazyvim, spacevim, nvchad, lunarvim, coc.nvim etc for plugin installs: vim-plug, packer, lazy, vundle. You're like installing all other crap like 20, 30+ plugins and merge them to work some of them works some of them not working perfectly and you gotta be searching their half-made documentation sometimes maintainers leaving the project to die and plugin dies, some of them update their own plugins and your vim system breaks. Boy that was a big disaster for me, i spent my 8 hours to make it work and couldn't do that. I don't have that free time, i installed vs code and installed all of my plugins with just a one button, works perfectly fine. Why do you guys put of that whole plugin hell crap ? Is it just cool ?

-Engineering-
Автор

I really, really like your videos. No irrelevant graphics and music just strait to the point and your videos are very competent - big thanks for sharing your knowledge!

As a hobby programmer with one year of C experience and some dyslectic issues, I badly need an IDE, where I e.g. can look at memory while I single step through the code. I have the impressions that pro's like you, uses Vim.

I changed from Windows to Linux Mint six months ago, so your channel is absolute gold for me. :o)

grimvian
Автор

ConqueGDB plugin for Vim. You're welcome.

obiwankenobe