Developing a Neovim Docker Plugin from Scratch

Sdílet
Vložit
  • čas přidán 16. 07. 2024
  • Time for a bit of Lua hacking. Ever since I fell down the Neovim rabbit hole I've been having a tonne of fun building little extensions and plugins. And I found that by using Telescope as a framework, it's fairly easy to take any command-line tool that emits JSON and get a nice little browser/manager going. So let me walk you through it.
    We'll start from an empty directory and end with a plugin that lets you browse through all the docker images you have available, and start a VM directly from inside the editor. (VM in ViM!)
    Links:
    * The Docker/Neovim source code: github.com/krisajenkins/teles...
    * Similar, for Kafka: github.com/krisajenkins/teles...
    * Similar, for Quix: github.com/krisajenkins/teles...
    * Telescope's Developer's Guide: github.com/nvim-telescope/tel...
    * My Neovim Config: github.com/krisajenkins/neovi...
    0:00 Intro
    1:15 Setting up for development
    2:55 A simple Telescope picker
    5:25 Dealing with richer data
    7:14 A simple previewer
    9:05 Displaying richer data
    11:29 Nicer display with syntax highlighting
    12:20 Talking to Docker
    15:20 Tidying it up
    16:13 What 'ordinal' actually does
    16:53 This could work with any JSON tool
    17:47 Adding the action to run an image
    22:17 Until next time...

Komentáře • 80

  • @lua5dot1
    @lua5dot1 Před 3 měsíci +21

    kinda speechless over how good this video is, I hope I can explain something this clearly someday

  • @WillEhrendreich
    @WillEhrendreich Před 3 měsíci +37

    That was absolutely epic. I wish I could have seen this video much much earlier in my neovim life. I remember trying to figure out how to do this sort of thing for when I was picking processes to have DAP attach to. It was doable, but difficult, because I don't know what I don't know. Having this incredible, clear demonstration of how to to make this work will help so much when I can't remember how to do it yet again. Haha. Great work, please do more this was chefs kiss.

    • @DeveloperVoices
      @DeveloperVoices  Před 3 měsíci +7

      Thanks! I wish I could have posted it when you needed it, because that would mean I'd discovered Neovim sooner too. 😁

  • @JT-mr3db
    @JT-mr3db Před 3 měsíci +10

    This is the epitome of casual brilliance

  • @Mawkler
    @Mawkler Před 3 měsíci +3

    This is the greatest illustration I've ever seen of how powerful Neovim, Lua and Telescope truly are

  • @s1n7ax
    @s1n7ax Před 3 měsíci +21

    Awesome video. More neovim stuff please

  • @MiguelLopez-mu1ss
    @MiguelLopez-mu1ss Před měsícem +2

    this man went next level... nvim telescope instead of the cli fzf... je suis intrigued

  • @beyond990
    @beyond990 Před 3 měsíci +4

    That was probably the most succinct tutorial/run through I have watch on CZcams, I now need to look at your back catalogue and see what other wonders you have 😊

  • @mananabanana
    @mananabanana Před 3 měsíci +17

    That was amazing pedagogy. You're incredibly clear and engaging. Kudos! 😀

  • @saurabhpradhan1069
    @saurabhpradhan1069 Před 3 měsíci +4

    Using neovim/telescope for years.. but this just blew my mind. Awesome video.

  • @lukeemhigh
    @lukeemhigh Před 3 měsíci +7

    Amazing, this could just be the most useful neovim/lua video I've ever seen. Keep it up!

  • @nickmills8476
    @nickmills8476 Před 3 měsíci +3

    Been using neovim for a couple of years and vim a lot longer, but I gotta say watching the way you use it for programming is a learning experience. I like the way you work!

  • @lpil
    @lpil Před 3 měsíci +2

    Wow Kris! This was my intro to Neovim plugin development and I feel ready to make some useful things!
    It was great to see your workflow here

  • @tubeloupe8444
    @tubeloupe8444 Před 3 měsíci +2

    You, my friend, need to make more videos like this. Great pace, great narration, easy to follow along... Five Stars!
    On an unrelated note, anyone else think the narration bears an uncanny resemblance to that guy on the YT channel who's cracking cryptic Sudoku puzzles? Get these two an audio book deal! (At least for us North American listeners...)

  • @PhanorColl
    @PhanorColl Před 3 měsíci +1

    great video.. I've been using neovim for a long time, but never felt like making my own plugins until now.. Please do more neovim videos.. this is EPIC!!

  • @jmbuhr
    @jmbuhr Před 3 měsíci +3

    Very well explained and great pacing!

  • @snrmwg
    @snrmwg Před 3 měsíci

    This was great to watch. Learned so much, thanks 😊

  • @jwr6796
    @jwr6796 Před 3 měsíci +1

    Maybe I've not been subbed long enough, but this is the first tutorial/walthrough I've seen from you. I'd love to see some other topics!

    • @jwr6796
      @jwr6796 Před 3 měsíci

      Neglected the main purpose if my iriginal comment, which was to say: I love your style/qpproach in these more tutorial-centric videoa!

    • @DeveloperVoices
      @DeveloperVoices  Před 3 měsíci +1

      Glad you like them! Keep an eye on this playlist - I'll be adding more there as they come: czcams.com/play/PLuiPju9KQBnatff3GerbYpqPijpDRJp9p.html 🙂

  • @emilaasa
    @emilaasa Před 3 měsíci

    This is an extremely high quality tutorial type of presentation!
    Crystal clear!

  • @CristianHeredia0
    @CristianHeredia0 Před 3 měsíci

    Brilliant. I’ve been using neovim and docker for years. You just created a super convenient entry point for me to build on.

  • @jeytech
    @jeytech Před 3 měsíci

    This was extremely helpful and insightful, thank you sir! You got yourself a new sub can't wait for more.

  • @Timjstewart
    @Timjstewart Před 3 měsíci

    This video cleared up the mystery of developing a Telescope extension for me and got me really excited about all of the extensions I can build. Thank you so much for your clear explanation, for starting simple and progressively making it more and more powerful!

  • @LukasRotermund
    @LukasRotermund Před 3 měsíci

    Wow! ❤ that's so inspiring! I can't wait to finish my breakfast, jump into nvim and write some telescope plugins 🚀🙌

  • @utvikler-no
    @utvikler-no Před 3 měsíci

    This made my day! Thank you so much!

  • @lv8pv
    @lv8pv Před 3 měsíci

    This is the best "tutorial" on how to start writing plugins to nvim I have seen. THANK YOU so much! Please do more

  • @Echiduna
    @Echiduna Před 2 měsíci

    Love this video. Just made my very first telescope plugin. Thank you for such amazing contents.

  • @WilmanArambillete
    @WilmanArambillete Před 3 měsíci

    amazing video! highly educational and very well explained!! Thanks a lot for these sort of videos

  • @thisbridgehascables
    @thisbridgehascables Před 3 měsíci

    This a great video! Learned a lot from this, also a very useful module since I use docker ..

  • @Incertophile
    @Incertophile Před 9 dny

    Sick video Kris

  • @wilsonpsleung
    @wilsonpsleung Před 3 měsíci

    Simply amazing 👍

  • @jorgeosorio1613
    @jorgeosorio1613 Před 3 měsíci +2

    I love these videos

  • @thenwhoami
    @thenwhoami Před 3 měsíci

    Your content is *chef's kiss*

  • @90hijacked
    @90hijacked Před 3 měsíci

    Welcome to the club! ❤

  • @rafaelcolladojr
    @rafaelcolladojr Před 3 měsíci

    Insane tutorial. Insta-subscribed.

  • @FrancescoPischedda
    @FrancescoPischedda Před 3 měsíci

    Thank you, it was great!

  • @HunterRoMike
    @HunterRoMike Před 3 měsíci

    That was very interesting and engaging!

  • @jrcentralcoastmagician3333
    @jrcentralcoastmagician3333 Před 3 měsíci

    Incredible!

  • @freezingcicada6852
    @freezingcicada6852 Před 3 měsíci

    I'm still a noob, but I enjoyed the thought process and general pacing of the whole video.
    It doesnt have to be "tutorial" either or Neovim specially, initially watched your videos from the Odin interview with Ginger Bill.

  • @yuxiang4218
    @yuxiang4218 Před 2 měsíci

    Great illustration. want to learn more about the how buffer/windows/tab work in neovim

  • @benarcher372
    @benarcher372 Před 3 měsíci

    Stunned.

  • @edgeeffect
    @edgeeffect Před 3 měsíci

    I'm not a neovim person but it's very very nice seeing Lua actually being USED for something.

  • @McCourtRC
    @McCourtRC Před 3 měsíci

    legendary!

  • @IlhanNegis
    @IlhanNegis Před 3 měsíci +1

    that was a gold nugget there

  • @_mateusdigital
    @_mateusdigital Před 3 měsíci

    That's so so cool!!!! Really wished that neoview would be more integrated with game dev flows tho - it's such a pleasure as an text editor, but without the additional tooling involved it's quite difficult to make it usable to day to day game development...

  • @hexomega9445
    @hexomega9445 Před 3 měsíci

    nice vid!

  • @lancemarchetti8673
    @lancemarchetti8673 Před 3 měsíci

    Nice!

  • @mkamp
    @mkamp Před 3 měsíci +1

    One thing I am wondering about. The command returns a number of items, yet in the the entry maker you deal with the entries individually. Where is the splitting happening?
    Absolutely fantastic and so much fun. Thanks for taking us along on the ride and to make it so practical. Can't wait for the next installment.

    • @DeveloperVoices
      @DeveloperVoices  Před 3 měsíci +2

      That'll be Telescope. Somewhere in the telescope codebase there'll be a for loop working its magic. 🙂
      Glad you enjoyed it! Stay tuned for more. 😉

    • @mkamp
      @mkamp Před 3 měsíci +1

      Looking at your debug output again, it seems that you JSON is JSON lines with one JSON per line, so probably telescope is splitting by line. This is also consistent with your yes, no, maybe example before.

  • @spasham74
    @spasham74 Před 3 měsíci

    Beautiful. Thoroughly enjoyed the video. I see you have Kafka telescope extension. Do you mind making a video on that?

  • @tamatotodile
    @tamatotodile Před 3 měsíci

    One of us. One of us. One of us.

  • @qwfp
    @qwfp Před 3 měsíci +2

    Very well explained! But now I'll want to create telescope plugin for pretty much everything..

  • @popplestones886
    @popplestones886 Před 3 měsíci

    How is there not more likes?

  • @djbessel
    @djbessel Před 23 dny

    This is a huge motivator to start trying to write a telescope plugin, thank you! I'm struggling to figure out how command_generator works, I'm trying to construct my json payloads with a shell for loop, and it doesn't like it :). Also I see in your sample code you use finders.new_dynamic instead of finders.new_async_job, so I'm trying to find the docs on how to use all of these.

  • @user-sb9nt9ho6d
    @user-sb9nt9ho6d Před 3 měsíci +1

    I switched it to show me the containers instead of images.

  • @Struck0FF
    @Struck0FF Před 3 měsíci

    I think I’m gonna do the same for k8s

  • @WilmanArambillete
    @WilmanArambillete Před 3 měsíci

    i would like to learn more about lua and neovim

  • @jvdmeulen
    @jvdmeulen Před 3 měsíci

    Very nice, but the thing i'm missing a bit is how you found the commands .. did you ask the community, TJ or searched the readme's / docs?

    • @DeveloperVoices
      @DeveloperVoices  Před 3 měsíci

      Ah, great question. So I started off with this developer's guide: github.com/nvim-telescope/telescope.nvim/blob/master/developers.md
      ...and then the rest I picked up from reading source code.

  • @user-xd5gd4pc9h
    @user-xd5gd4pc9h Před 3 měsíci

    Cooool~ How about building container, pulling image, running command in contain and so on. The thing that bothers me the most is how to edit in container with full neovim ability such as lsp, dap etc. I use -v to mount the directory in host and use the neovim on the host but can no use the lsp like vscode. Is there better solution for that? Thank you in advance!

  • @Lars-ce4rd
    @Lars-ce4rd Před 3 měsíci

    I have to admit reading some of these comments back, I'm thinking they lack a lot of experience. I wonder what kind of superlatives these individuals would dish out on some of TJs videos (creator of neovim). LOL.
    Jokes aside, definitely a great educational video for anyone new to Lua and extending neovim and you deserve big kudos for that!

  • @256k_
    @256k_ Před 3 měsíci

    How do you feel about neovim vs eMacs?

    • @DeveloperVoices
      @DeveloperVoices  Před 3 měsíci

      I really like both of them. Emacs (with evil-mode) was my main editor for years, and I think either is a great choice.
      I find Emacs Lisp to be more fun to write than Lua, because the interactive development experience is absolutely world class. Lua's still good, it's just that elisp is astonishingly good.
      But some of Emacs' UI experience is need of a refresh, which gives Neovim a day-to-day edge. The Neovim team have done a great job of pulling the terminal into the 21st century. :-)

  • @user-tb4ig7qh9b
    @user-tb4ig7qh9b Před 3 měsíci

    Emacs it is really faster with this task i just quit telescope that sometimes miss things out

  •  Před 3 měsíci

    Which plugin did you use to jump around by typing letters? Was it hop?

    • @DeveloperVoices
      @DeveloperVoices  Před 3 měsíci +1

      Funnily enough, I only found out about hop last night. So in the video it was easymotion, but I think it's going to be hop going forward. :-)

    • @qwfp
      @qwfp Před 3 měsíci +1

      @@DeveloperVoices there's also leap.nvim, in case you want a different flavor

  • @jasonrothfuss1631
    @jasonrothfuss1631 Před 3 měsíci

    I really like these ~20min coding videos! Would love to see more like this. Also really enjoyed following along with your Purescript / Quickcheck video - czcams.com/video/4bpc8NpNHRc/video.html

  • @adicide9070
    @adicide9070 Před 3 měsíci

    hmm is this via terminal or with gui app?

    • @DeveloperVoices
      @DeveloperVoices  Před 3 měsíci +1

      Terminal. I'm using Kitty: sw.kovidgoyal.net/kitty/

    • @adicide9070
      @adicide9070 Před 3 měsíci +1

      thanks, I'm familiar :) @@DeveloperVoices

  • @legion_prex3650
    @legion_prex3650 Před 3 měsíci

    awesome! just awesome! you are my man! Unfortunately, i have no idea how to make this work besides running "source". when i startup my nvim, i get a bunch of errors like: [lspconfig] Cannot access configuration for lua_ls. Ensure this server is listed in `server_configurations.md` or added as a custom server.

    • @DeveloperVoices
      @DeveloperVoices  Před 3 měsíci

      Sounds like you need to install `lua-language-server`. On OSX that's `brew install lua-language-server`, but YMMV. :-)

    • @legion_prex3650
      @legion_prex3650 Před 3 měsíci

      made it work to load the plugin via packer. now i have to figure out, how to setup a keybinding and stuff. Oh man, i am new to neovim but loving it :) thanks!