DEBUG in Neovim. Like a BOSS.

Поделиться
HTML-код
  • Опубликовано: 1 июн 2024
  • 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
  • НаукаНаука

Комментарии • 88

  • @vikingthedude
    @vikingthedude 9 месяцев назад +24

    Bro taking the opportunity to flex his forearms

    • @devopstoolbox
      @devopstoolbox  9 месяцев назад +3

      😂
      I have to get rid of them. They’re too big

  • @AhmadMughal1
    @AhmadMughal1 5 месяцев назад +7

    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 🫶

  • @raenastra
    @raenastra 11 месяцев назад +23

    Thanks for taking the feedback and explaining a setup for a language other than TypeScript! Great video!

  • @gnom-om
    @gnom-om 11 месяцев назад +1

    Love your videos about vim and other terminal staff ! Thanks.

  • @ErmandDurro
    @ErmandDurro 11 месяцев назад +2

    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  11 месяцев назад +1

      Yes!! Let me know how it goes!

  • @WaldirBorbaJunior
    @WaldirBorbaJunior 11 месяцев назад +1

    As always another amazing content. Thank you for sharing your knowledge

  • @christhackrey9516
    @christhackrey9516 11 месяцев назад +6

    You've got the best thumbnails in all of vimspace!

    • @devopstoolbox
      @devopstoolbox  11 месяцев назад

      Haha thanks! I’m trying 😅

  • @fdefontis
    @fdefontis 11 месяцев назад

    Thank you!! Was waiting for this one for a while! Great surprise for today and will try this during the weekend :)

    • @devopstoolbox
      @devopstoolbox  11 месяцев назад

      Yes! Let me know how it goes!!

  • @gothikia
    @gothikia 6 месяцев назад

    Used this as a basis for setting up with C++. Thanks very much! Great video.

  • @evanl5299
    @evanl5299 7 месяцев назад

    Incredible video, amazing quality. Thanks!

  • @geschichte4u251
    @geschichte4u251 7 месяцев назад

    Hey, thanks for an amazing video!

  • @pedrosmmc
    @pedrosmmc 2 месяца назад

    Awesome video content!
    I loved your NeoVim background with that texture and transparency!
    Can you explain how you achieve that effect?

    • @devopstoolbox
      @devopstoolbox  2 месяца назад

      Thanks! TBH this used to be my setup with Wezterm transparency, but this is just a visual editing effect 😅

    • @pedrosmmc
      @pedrosmmc 2 месяца назад

      ​@@devopstoolbox cool! 😄

  • @garciajero
    @garciajero 11 месяцев назад

    Great content man!

  • @yosyad
    @yosyad 11 месяцев назад

    Amazing! Very helpful

  • @bartstavenuiter9895
    @bartstavenuiter9895 11 месяцев назад +2

    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  11 месяцев назад +2

      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

  • @qwarlock4126
    @qwarlock4126 7 месяцев назад

    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  7 месяцев назад +1

      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!

  • @marcellmonteirocruz2475
    @marcellmonteirocruz2475 9 месяцев назад +1

    Really nice video, what's the name of the plugin that autocompletes commands that you used for PackerSync ?

    • @devopstoolbox
      @devopstoolbox  9 месяцев назад +1

      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?

  • @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

  • @rajneesh9775
    @rajneesh9775 17 дней назад

    Is DapUiToggle command removed from the nvim-dap plugin? I am not seeing it after plugin install.

  • @christopheanfry2425
    @christopheanfry2425 3 месяца назад +1

    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  3 месяца назад +1

      Hard for me to say TBH. Try following my dotfiles, although these have changed quite a lot since.

    • @christopheanfry2425
      @christopheanfry2425 3 месяца назад

      @@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

  • @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 месяцев назад +1

      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 8 месяцев назад +1

      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.

  • @tnvmadhav2442
    @tnvmadhav2442 8 месяцев назад

    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  8 месяцев назад

      Thank you! I feel like it’s more about the debugger server rather than vscode but do let me know what you find!

  • @blessdarah1256
    @blessdarah1256 11 месяцев назад

    Please do you have a video of your config? Looks so cool.

    • @devopstoolbox
      @devopstoolbox  11 месяцев назад +1

      ruclips.net/video/aeQn9MRTjxc/видео.html
      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 :)

  • @LuccDev
    @LuccDev 10 месяцев назад

    Niiiice !! Finally someone talking about this in a detailed way.

  • @arturfil
    @arturfil 8 месяцев назад

    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  8 месяцев назад +1

      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

  • @luky5112
    @luky5112 7 месяцев назад +1

    how can i inspect memory in c? like the stack, heap and registers?

    • @devopstoolbox
      @devopstoolbox  7 месяцев назад

      I’m guessing your going to need a similar profiler built for C

  • @user-tg5xx1tn6m
    @user-tg5xx1tn6m 2 месяца назад

    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  2 месяца назад

      Interesting. Is there an m2 specific release? I used an m1 and went ok. To be sure maybe build from source?

  • @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 11 месяцев назад +1

    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  11 месяцев назад

      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 11 месяцев назад

      @@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 11 месяцев назад +2

    Please post a video about setting up DAP with C language

    • @devopstoolbox
      @devopstoolbox  11 месяцев назад +2

      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 11 месяцев назад +2

      I have done it by reading nvim-dap docs. Anyway thanks for your immediate response

    • @devopstoolbox
      @devopstoolbox  11 месяцев назад +1

      @@ragulr1566 🤩

  • @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 месяцев назад +1

      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!

  • @qrockz007
    @qrockz007 3 месяца назад

    nvim-dap-ui is bugged. for instance lua output's goes into REPL pane instead of console pane.

    • @devopstoolbox
      @devopstoolbox  3 месяца назад

      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

  • @MrVanshajSaxena
    @MrVanshajSaxena 9 месяцев назад +1

    5:51

  • @_fellow_
    @_fellow_ 3 месяца назад

    Are you also a climber?

    • @devopstoolbox
      @devopstoolbox  3 месяца назад

      I am :)
      What gave it away?

    • @_fellow_
      @_fellow_ 3 месяца назад

      @@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  3 месяца назад

      @@_fellow_ Haha hilarious, I thought it was the one thing I managed to hide 😂

  • @vaisakhkm783
    @vaisakhkm783 11 месяцев назад +1

    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 7 месяцев назад +1

    Odd starting off with John Carmack who uses jetbrains in a vim video

    • @devopstoolbox
      @devopstoolbox  7 месяцев назад

      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 месяцев назад +2

    Every programmer deserves a better debugger.
    Use an IDE and get rid of this suffering 🤮