DEBUG in Neovim. Like a BOSS.

  Рет қаралды 46,404

DevOps Toolbox

DevOps Toolbox

Күн бұрын

Neovim is an amazing environment but it always had one major "flaw" is it was aiming for a place among other IDEs - a debugging functionality.
Since in its core, Vim is a text editor, every other functionality is provided by plugins. But it's not all that difficult! With a small set of plugins we can run a debugging session, with nice visualization and expression console right in Neovim!
LINKS AND TOOLS MENTIONED
▶ Lex Friedman / John Carmack interview: • John Carmack: Best pro...
▶ DAP: github.com/mfussenegger/nvim-dap
▶ DAP Virtual Text: github.com/theHamsta/nvim-dap...
▶ Adapter for Golang: github.com/leoluz/nvim-dap-go
MY FAVOURITE GEAR
* If you enjoy my content, using the links below will help me with a small commission, so thank you!
⌨️ My keyboard is the wonderful HHKB: amzn.to/3HwJG60
🔗 The HHKB is wired with a high quality coiled cable: amzn.to/3DCA87d
⌨️ Backup keyboard (for traveling mainly) - Nuphy Air60: amzn.to/3R3M7jz
🖥️ My ultra wide 49" monitor: amzn.to/3JbVThC
🎙️ Microphone - Shure MV7X: amzn.to/3kA7tZZ
🦾 Boom Arm - amzn.to/3ZmQgln
🎤 Audio Interface (for XLR microphones) - Focusrite Scarlett Solo: amzn.to/3Z3fBkQ
🦾 Heavy Duty Monitor Arm: amzn.to/3kKp7tS
🖱️ Mouse - MX Master 3: amzn.to/3DiZmaj
📷 Camera - ZVE10: amzn.to/3I1jfVS
🎥 Lens - Sigma 1.4 16mm: amzn.to/3BfFN15
CONSIDER SUPPORTING THIS CHANNEL
☕ Buy me a coffee: www.buymeacoffee.com/omerxx
🎷 60 day free Epidemic Music!: share.epidemicsound.com/w6zfxo
MY KEY LINKS
🍿 Subscribe: www.youtube.com/@devopstoolbo...
🌍 My website: omerxx.com
🗞️ Dev & Ops tools Telegram channel: t.me/espressops
🎙️ DevOps Topeaks Podcast: topeaks.buzzsprout.com
⏱ Timestamps
00:00 - Intro
01:00 - What it looks like
02:45 - Debugging terminology explained
03:45 - Using the UI
04:55 - Configuration
06:12 - Example debug session
08:16 - Customization
09:00 - Final words
#neovim #debug #debugtips #devops #ops #productivity #dev #terminal #tmux #system #sysadmin #cloud #cli #ops #ricing #linux #macos #commandline #typing #keyboard #tutorial #beginner

Пікірлер: 90
@vikingthedude
@vikingthedude 9 ай бұрын
Bro taking the opportunity to flex his forearms
@devopstoolbox
@devopstoolbox 9 ай бұрын
😂 I have to get rid of them. They’re too big
@raenastra
@raenastra Жыл бұрын
Thanks for taking the feedback and explaining a setup for a language other than TypeScript! Great video!
@gnom-om
@gnom-om Жыл бұрын
Love your videos about vim and other terminal staff ! Thanks.
@ErmandDurro
@ErmandDurro Жыл бұрын
Really great content. Thanks a lot for this one. It was really useful for me to see the setup of debugger in Neovim. I have used Neovim for more than 1 year now but with no debugger at all. Now I'll try these plugins that you mentioned since I am using go as well 😃
@devopstoolbox
@devopstoolbox Жыл бұрын
Yes!! Let me know how it goes!
@WaldirBorbaJunior
@WaldirBorbaJunior Жыл бұрын
As always another amazing content. Thank you for sharing your knowledge
@fdefontis
@fdefontis Жыл бұрын
Thank you!! Was waiting for this one for a while! Great surprise for today and will try this during the weekend :)
@devopstoolbox
@devopstoolbox Жыл бұрын
Yes! Let me know how it goes!!
@AhmadMughal1
@AhmadMughal1 5 ай бұрын
switching to Neovim was one of the best decisions i made and i mostly work in web dev and a little python and rust for my side projects. Vscode could be regarded as the best experience especially if you are working in web dev but what most people forget is that installing 10 plugins to provide info and utilities is only going to help not make you a better programmer and most of the essential plugins are already available in neovim. For me atleast neovim provided a much much better experience and feels way more like an IDE after setting it up rather than VScode's impersonation of an IDE and switching actually made it more clear how much of a memory hog VScode is.(aka i can run 2 environments due to FullStack development and my laptop does not die completely on running). Anyone that is still in doubt take some time to learn neovim and using terminals like kitty or tmux in tandem and i promise it will be a far better experience.
@devopstoolbox
@devopstoolbox 5 ай бұрын
This is a wholesome comment 🫶
@gothikia
@gothikia 7 ай бұрын
Used this as a basis for setting up with C++. Thanks very much! Great video.
@devopstoolbox
@devopstoolbox 7 ай бұрын
🙏🏽
@evanl5299
@evanl5299 8 ай бұрын
Incredible video, amazing quality. Thanks!
@devopstoolbox
@devopstoolbox 8 ай бұрын
Thanks buddy! 🙏🏽
@geschichte4u251
@geschichte4u251 8 ай бұрын
Hey, thanks for an amazing video!
@christhackrey9516
@christhackrey9516 Жыл бұрын
You've got the best thumbnails in all of vimspace!
@devopstoolbox
@devopstoolbox Жыл бұрын
Haha thanks! I’m trying 😅
@garciajero
@garciajero Жыл бұрын
Great content man!
@LuccDev
@LuccDev 11 ай бұрын
Niiiice !! Finally someone talking about this in a detailed way.
@yosyad
@yosyad Жыл бұрын
Amazing! Very helpful
@devopstoolbox
@devopstoolbox Жыл бұрын
😉
@bartstavenuiter9895
@bartstavenuiter9895 Жыл бұрын
Nice vid. Using dap as well. I used intellij ide with the same results. I was wondering if you could see value of a parameter in a pop-up when you are on the variable. That is sometimes handy when dealing with arrays
@devopstoolbox
@devopstoolbox Жыл бұрын
Hmmm 🤔 definitely interesting ! Sounds like this would require some lua and can be VERY helpful. At the end of the day , the UI is a bunch of buffers, that you can open wherever you choose, I don’t see a reason why you couldn’t. BTW, you could switch you main screen the variable console buffer for quick investigation and then scroll it back
@rajneesh9775
@rajneesh9775 Ай бұрын
Is DapUiToggle command removed from the nvim-dap plugin? I am not seeing it after plugin install.
@marcellmonteirocruz2475
@marcellmonteirocruz2475 10 ай бұрын
Really nice video, what's the name of the plugin that autocompletes commands that you used for PackerSync ?
@devopstoolbox
@devopstoolbox 10 ай бұрын
I’ve moved from Packer to Lazy since:) but vim should be aware of exposed methods for different plugins. Is that not something you get trying to run tab completions?
@qwarlock4126
@qwarlock4126 8 ай бұрын
Hey love your vids. They are really making me excited about code and neovim! A couple of questions. How did you get the Red Dot in your config file? Sorry if this is easy and I dont know it. Also, how did you get Telescope and other pop ups to be so nicely styled? I am using capucino and mine does not look so vibrant. I know not substantive... but really curious how you got yours looking so cool!
@devopstoolbox
@devopstoolbox 8 ай бұрын
Hello mate! Thanks for the kind words:) The red breaking point is just a configuration of the plugin where I replaced the icons. Checkout my dotfiles here: dotfiles.omerxx.com Let me know if you don’t find what you’re looking for!
@qwarlock4126
@qwarlock4126 7 ай бұрын
@@devopstoolbox Hey rock star... I got the char to show by adding some fonts that
@qwarlock4126
@qwarlock4126 7 ай бұрын
@@devopstoolbox Hey rock star. I found a little more info. I needed to install the font that had U1F534 in it. Then the dot shows up. In windows or linux it will always be the set foreground colour and will on linux have lines through it. Android and Macs will show it as a big red circle. Even as a greed dot.... it totally serves the purpose. Thanks for the great vids and I will look forward to many more!
@pedrosmmc
@pedrosmmc 3 ай бұрын
Awesome video content! I loved your NeoVim background with that texture and transparency! Can you explain how you achieve that effect?
@devopstoolbox
@devopstoolbox 3 ай бұрын
Thanks! TBH this used to be my setup with Wezterm transparency, but this is just a visual editing effect 😅
@pedrosmmc
@pedrosmmc 3 ай бұрын
​@@devopstoolbox cool! 😄
@Oysy
@Oysy 8 ай бұрын
Great video! How are you highlighting the line that you are currently breaked on?
@devopstoolbox
@devopstoolbox 8 ай бұрын
Hey! Thanks! So break line is just a feature of DAP, which you can match to whatever you want as a key map, and the sign is also controlable (in my case - a big red dot), the line is auto marked by DAP when you're in a debug session. I didn't make any special changes there but you're more than welcome to check my dotfiles: dotfiles.omerxx.com
@tnvmadhav2442
@tnvmadhav2442 9 ай бұрын
I find vscode debugger for my django apps really slow (startup and repl dev cycle takes a ~minute) But my golang debugger in code is pretty fast. Maybe neovim based debugger will fix my django debugging experience. I subscribed, thanks!
@devopstoolbox
@devopstoolbox 9 ай бұрын
Thank you! I feel like it’s more about the debugger server rather than vscode but do let me know what you find!
@arturfil
@arturfil 9 ай бұрын
Amazig video! I'm using golang all the time so this works perfect! I was wondering if you have something similar for python
@devopstoolbox
@devopstoolbox 9 ай бұрын
Nice! Let me know how it goes! TBH most of my work these days is purely Go, but Python should work exactly the same only with another debugger backend. You should be able to use the UI and DAP exactly the same
@randomdude5430
@randomdude5430 8 ай бұрын
Thanks for the cool video. I didn't see anything mentioning about that you have to have dlv installed as prerequisite if anybody wonders why it's not working on his/her machine.
@devopstoolbox
@devopstoolbox 8 ай бұрын
If I missed that you’re absolutely right. And while we’re at it it’s important to add that you’d have to use the debug server that matches the language you’re working with
@christopheanfry2425
@christopheanfry2425 4 ай бұрын
When I set the keymap for the debugger I have an error saying that telescope can’t be found. I’ve verified and telescope is not using any of the keymaps I use for the debugger. Any keymap gives me the error. Do you have an idea on what’s happening?
@devopstoolbox
@devopstoolbox 4 ай бұрын
Hard for me to say TBH. Try following my dotfiles, although these have changed quite a lot since.
@christopheanfry2425
@christopheanfry2425 4 ай бұрын
@@devopstoolbox thanks so much for your reply. I’m using lazyVim and on their website they have the setup for DAP. It works fine now
@qsmfoui
@qsmfoui 8 ай бұрын
how can i inspect memory in c? like the stack, heap and registers?
@devopstoolbox
@devopstoolbox 8 ай бұрын
I’m guessing your going to need a similar profiler built for C
@user-tg5xx1tn6m
@user-tg5xx1tn6m 3 ай бұрын
I tried using it on my M2 Mac Air and can't debug go, but python does, I don't know if DLV is not compatible with Arm's macOS
@devopstoolbox
@devopstoolbox 3 ай бұрын
Interesting. Is there an m2 specific release? I used an m1 and went ok. To be sure maybe build from source?
@IWorkInPixels
@IWorkInPixels 9 ай бұрын
I would very much like to know if there's a way to set up run configurations in the DAP, like PyCharm has, so that I can define a custom command, with custom environment variables and other settings, and then debug using the normal DAP process. That's the only feature left that I have in PyCharm but not Neovim.
@devopstoolbox
@devopstoolbox 9 ай бұрын
Trying to follow: are you referring to changing code *while* debugging or something else?
@IWorkInPixels
@IWorkInPixels 9 ай бұрын
@@devopstoolbox I'm trying to have a config file, similar to launch.json in VSCode or the run configs in PyCharm that contains all the environment variables, command and parameters, etc that I need to run my code (the one I'm working on now is an AWS lambda so it is more complicated than just running the python file) and then once it runs that code I need to be able to step though it with my existing breakpoints.
@IWorkInPixels
@IWorkInPixels 9 ай бұрын
I have gotten as far as learning how to get the local sam container running entirely from the command line, and set up with a debug port open, but I'm not sure how to get nvim-dap to attach to that port and communicating with the aws lambda function within so I can debug using neovim.
@blessdarah1256
@blessdarah1256 11 ай бұрын
Please do you have a video of your config? Looks so cool.
@devopstoolbox
@devopstoolbox 11 ай бұрын
kzbin.info/www/bejne/l5a0n2yDh7mdrsU This is a video of what I got, the config is in my dotfiles repo (omerxx/dotfiles) and a video is coming up soon enough :)
@saragadamsuresh
@saragadamsuresh 10 ай бұрын
what if i want to use DAP for java do i need a JAVA adapeter for DAP, like wise javascript adapter for JAVASCRIPT? C adapter for DAP in case of C/C++ language ? Any ways this is the unique video i am looking for.. thankyou
@devopstoolbox
@devopstoolbox 10 ай бұрын
Hi! Yes, exactly, here's a list of available adapters: microsoft.github.io/debug-adapter-protocol/implementors/adapters/ And specifically for Java: github.com/Microsoft/vscode-java-debug
@lintaoamons5712
@lintaoamons5712 Жыл бұрын
I always wanted to have some fzf CMd searching and triggering ability. Vim built-in `:` can only strictly match what user is typing and can only use arrow keys or tab to switch cmds
@devopstoolbox
@devopstoolbox Жыл бұрын
You can achieve that with telescope for pretty much anything. What would you like to have it for ? Literally commands you type? As in the command history like you have in your terminal?
@lintaoamons5712
@lintaoamons5712 Жыл бұрын
@@devopstoolbox LintaoAmons/easy-commands.nvim I want to have VSCODE/IDEA like command fzf search and trigger function~ Right now I am using fzf-lua to achieve this
@ragulr1566
@ragulr1566 Жыл бұрын
Please post a video about setting up DAP with C language
@devopstoolbox
@devopstoolbox Жыл бұрын
Hi! While I’m not coding in C I don’t think it would be any different. Only instead of using the last bit here that’s basically a go-delve server, you’d use a C debugger!
@ragulr1566
@ragulr1566 Жыл бұрын
I have done it by reading nvim-dap docs. Anyway thanks for your immediate response
@devopstoolbox
@devopstoolbox Жыл бұрын
@@ragulr1566 🤩
@qrockz007
@qrockz007 4 ай бұрын
nvim-dap-ui is bugged. for instance lua output's goes into REPL pane instead of console pane.
@devopstoolbox
@devopstoolbox 4 ай бұрын
I don't remember seeing that... but yeah it can get clunky. It's usually my go to but I'm wondering whether its clunkiness is what's stopping others from taking it on
@Selbstzensur
@Selbstzensur 5 ай бұрын
I like neovim but i prefer classical gui based ide's, because i had always the expierience that vim/neovim is a neverending story for me. I'm to impatient for it, to come to a point where i'm very happy with it.
@devopstoolbox
@devopstoolbox 5 ай бұрын
I get it. But you’ve got lazy nvChad and the likes or simply kickstarter.nvim And, if at the end of the day you don’t want to configure anything, checkout Helix!
@Selbstzensur
@Selbstzensur 5 ай бұрын
@@devopstoolbox does one of them support dotnet?
@Selbstzensur
@Selbstzensur 5 ай бұрын
@@devopstoolbox i tried nvChad and it's not as userfriendly as any other modern gui based ide or texteditor. First you have to know which key is the leader key in the base dir. Then you must know how to change the working dir in nvimtree. All things you have to look up. These are all things that you get for free in an modern editor, because you can use a mouse pointer and context menü's. I dislike neovim and will stay at jetbrains products, because they work out of the box fine!
@chrishoppner150
@chrishoppner150 17 күн бұрын
Yeah. That was John Carmack in the same interview he shat all over vim as an editor.
@devopstoolbox
@devopstoolbox 17 күн бұрын
Yep :) that was why I got it! I love the irony! And I think the description is a little extreme, and explained why he preferred other editors…
@MrVanshajSaxena
@MrVanshajSaxena 9 ай бұрын
5:51
@devopstoolbox
@devopstoolbox 9 ай бұрын
Is working for you?
@_fellow_
@_fellow_ 4 ай бұрын
Are you also a climber?
@devopstoolbox
@devopstoolbox 4 ай бұрын
I am :) What gave it away?
@_fellow_
@_fellow_ 4 ай бұрын
@@devopstoolbox haha you made a comment in one of your git videos about climbing and then someone below mentioned your forearms. I also climb too. Anyway I appreciate your content!
@devopstoolbox
@devopstoolbox 4 ай бұрын
@@_fellow_ Haha hilarious, I thought it was the one thing I managed to hide 😂
@vaisakhkm783
@vaisakhkm783 11 ай бұрын
Neovim is PDE.. not IDE
@devopstoolbox
@devopstoolbox 11 ай бұрын
Yes, I agree. However referring to it as “just a text editor” isn’t doing justice IMO
@vaisakhkm783
@vaisakhkm783 11 ай бұрын
@@devopstoolbox 🙃 i would argue it's just a text editor without plugins... so i use it with -U=NONE flag in my scripts, like as a pager for manpages because it has nothing for a ide without plugins... compared vscode (yes, an ide), which has lot of stuff build in like a git integration and project management and complete intelinse for javascript without any plugin
@devopstoolbox
@devopstoolbox 11 ай бұрын
@@vaisakhkm783 let me put it like that: you’re right. And the main reason I use vim is not because of its IDE capabilities that I can easily get with a bunch of plugins, but for its text editing features! So you’re point is made, but I take productivity of writing as the top priority and the rest comes next. Since I get everything - lsp, git, debugger etc (yea with plugins) where I can customize and play with the env, it’s a no brained for me
@vaisakhkm783
@vaisakhkm783 11 ай бұрын
​@@devopstoolbox yes yes... XD... - it's a text editor for those don't know about plugins... - it's a IDE for those nvim distribution users who doesn't customize anything... - it's a PDE for those who configure more than actually code (which is me XD)
@doresearchstopwhining
@doresearchstopwhining 8 ай бұрын
Odd starting off with John Carmack who uses jetbrains in a vim video
@devopstoolbox
@devopstoolbox 8 ай бұрын
Like a good dev, I cherry picked 🤣
@cpplain
@cpplain 7 ай бұрын
What’s odd is a comment that assumes a non-vim user (John Carmack) couldn’t possibly say something relevant for vim users.
@devopstoolbox
@devopstoolbox 7 ай бұрын
@@cpplain 😅
@khanra17
@khanra17 11 ай бұрын
Every programmer deserves a better debugger. Use an IDE and get rid of this suffering 🤮
@devopstoolbox
@devopstoolbox 10 ай бұрын
Neovim IS an IDE 😉
The Ultimate Database Control. Right WITHIN NEOVIM
9:35
DevOps Toolbox
Рет қаралды 51 М.
I Love Neovim But I WONT Use It | Prime Reacts
23:22
ThePrimeTime
Рет қаралды 107 М.
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 3,9 МЛН
Hot Ball ASMR #asmr #asmrsounds #satisfying #relaxing #satisfyingvideo
00:19
Oddly Satisfying
Рет қаралды 49 МЛН
Why oil.nvim is the best directory plugin
9:12
Andrew Courter
Рет қаралды 21 М.
I FINALLY configured nvim-dap to debug Node.js apps!!!
16:56
Lazar Nikolov
Рет қаралды 10 М.
How Neovim saved me at least 30 minutes today
8:12
Rasmus Bergström
Рет қаралды 8 М.
5 Command Line Tools That Boost Developer Productivity (2023)
8:02
Automatically Execute *Anything* in Nvim
11:03
TJ DeVries
Рет қаралды 67 М.
simple neovim debugging setup (in 10 minutes)
9:36
TJ DeVries
Рет қаралды 24 М.
We may have killed p10k, so I found the perfect replacement.
19:48
Dreams of Autonomy
Рет қаралды 72 М.
How To Use lazy.nvim For A Simple And Amazing Neovim Config
25:44
Josean Martinez
Рет қаралды 152 М.
My Neovim & Tmux Terminal Dev Workflow As A Principal Engineer
9:22
DevOps Toolbox
Рет қаралды 35 М.
Tmux From Scratch To BEAST MODE
12:44
DevOps Toolbox
Рет қаралды 94 М.
DC Fast 🏃‍♂️ Mobile 📱 Charger
0:42
Tech Official
Рет қаралды 485 М.
Ждёшь обновление IOS 18? #ios #ios18 #айоэс #apple #iphone #айфон
0:57
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 3 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 6 МЛН