Neovim Lazy Lua IDE - my simple but powerful setup for 2024

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

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

  • @paddypimblett62
    @paddypimblett62 9 месяцев назад +15

    you have a really good talent at explaining things really simple yet informative ; really beginner friendly. great job and keep it up!

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

      Thanks! I appreciate you taking a moment to let me know

  • @DAVE-GM
    @DAVE-GM 9 месяцев назад +6

    Wow! finally, a comprehensive guide to setting up Python with Neovim! Your tutorial is incredibly helpful. I would greatly appreciate it if you could delve deeper into LSP integration related to Python virtual environments. Your insights are invaluable!

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

    Thank you for showing pyright from scratch, I have been struggling with this for a few days and I think this will get me over the wall

  • @friendly__drone9352
    @friendly__drone9352 26 дней назад

    Your videos are great! I expect your channel to really take off soon:)

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

    Thank you for the video. Definitely need to watch it multiple times.

  • @Onyx-it8gk
    @Onyx-it8gk 6 месяцев назад

    Awesome video, thanks! As a long-time Neovim user, I recently moved to Helix. It still has a ways to go for full maturity, but it's very productive.

  • @jeffrey5602
    @jeffrey5602 Месяц назад +1

    for python envs i currently use conda and dynamically just grab the path variable on lsp attach. I just always have the correct env activated before opening nvim. works well for me

    • @dennistanui7085
      @dennistanui7085 18 дней назад

      That makes sense, one thing I didn't understand in the video is do you install the language server in the venv or globally?

    • @jeffrey5602
      @jeffrey5602 18 дней назад

      @you install language servers with the mason nvim plugin

    • @dennistanui7085
      @dennistanui7085 16 дней назад

      @@jeffrey5602 yes I understood that part, and looks like mason installs the binary into its data directory. My question was concerned handling multiple virtual envs, but I think I understand it now

  • @ahasibrifat7568
    @ahasibrifat7568 8 месяцев назад +1

    23:00
    If it's active in the shell it should be active in neovim.
    So just activate it with source venv/bin/activate and then enter neovim

  • @martingg1
    @martingg1 9 дней назад

    Great video! May I ask what terminal you use? Looks so clean. I've started my journey on neovim but haven't found a terminal I like personally.

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

    Thanks for the tutorial. Very informative.

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

    This was really cool, thanks man I am glad I watched this even though it is a python setup and I work on full-stack with node I can now make my own version and extend it when needed. Really appreciate this tutorial ❤

    • @ZazenCodes
      @ZazenCodes  6 месяцев назад +1

      Awesome, thanks!

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

    I typically put my virtual environments as .venv/ in the project dir, that way the local path is the same for all my projects

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

      Thats cool, so you reference a relative path in your neovim config or something like that? I dont really understand.
      The way I do it now is to activate my virtual env first then open neovim.

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

      Atm I just have a line in my zshrc that automatically enters a venv when the .venv folder is present in the cwd. I didn't know that you can directly configure the path for your LSP (like you did at 23:28). So made me think maybe its possible to just use a relative path in the config (./.venv)

  • @don_heidi
    @don_heidi 9 месяцев назад

    I love the overlaying of the relevant information with you talking in the background. Overall, it was great editing. The subtitles placed right in the middle of the screen confused me. And great office setup.

    • @ZazenCodes
      @ZazenCodes  9 месяцев назад

      Haha noted! Thank you

  • @Sloogy82
    @Sloogy82 22 дня назад

    hi there
    Sadly markdown-preview is not supported anymore
    so I receive some failures

  • @TheChameleon84
    @TheChameleon84 5 месяцев назад +1

    You don’t need to do all this complicated setup to get Python autocompletion. I don’t know about pyright, but if you install Jedi instead, all you need is to make sure your Python environment is activated before launching nvim. Jedi will automatically inspect your activated environment and provide autocompletion and hover for your installed modules.

  • @BadlyNeedAHug
    @BadlyNeedAHug 5 месяцев назад

    Any of you guys got an error when loading the Markdownpreview on lazy?

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

    Very nice video. It really helped me get started and also finally use virtualenvs inside vim. There is a small issue I cannot find how to solve. I would also like to add CNTRL + Space to act as CNTRL + n, basically to select suggestions of the autocomplete. Can you give me a hint how to do it? I have tried different things but nothing seems to work. Thank you very much.

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

    How do you get your moonlander to actually keeep its tilt? The wrist wrest doesn’t lock right?

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

    mate, but what about change venvs for each project? Do u have any automatic solution for that?

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

      I tried something, but never could get it working. I activate the virtual environment before going into vim- that works

  • @green3438
    @green3438 9 месяцев назад

    thank you for awesome video! i'm very noob on neovim. by the way i have one question for you from 22:47 on video. actually i want to connect with my conda env so i did 138 line as like ( env_path.join(vim.env.HOME, "/opt/homebrew/anaconda3/envs", "lab", "bin", "python") (lab is for my conda env name). but it seems like not working for me. i made test directory like as you did, and made test.py (also i ensured that i have been installed numpy in my conda env). when i import numpy, there are some error (Unable to import 'numpy' (import-error), Import 'numpy' could not be resolved). can you help me?

    • @ZazenCodes
      @ZazenCodes  9 месяцев назад

      Thank you. I dont believe conda envs should be a problem. In the code you wrote you start your path with vim.env.HOME - remove that part. /opt/hormbrew/… is an absolute path. Also try without using the path.join utility function and just use a string that has the absolute path to your environment

  • @dominiqueehrlich1668
    @dominiqueehrlich1668 5 месяцев назад

    do you have a tutorial on how to setup and configure obsidian within vim?

  • @aleatoirealeatoire-s2j
    @aleatoirealeatoire-s2j 6 месяцев назад

    Hi thank you for your video continue it's very good work :), I want to know , with which key did you replace ESC to activate the different modes (insert,visual,ect ....), because the esc key is rather difficult to reach I don't find it practical do you have any ideas? thx :)

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

      Thanks! I use ctrl+c (command on mac, I think) to go from insert to visual mode. It works by default

  • @wolfisraging
    @wolfisraging 9 месяцев назад

    Just brilliant!

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

    How do you get your sound so clear with the mic so far away? I also have blue yeti, but it sounds like trash wherever I put it 😅

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

      I did some post processing. Also use the cardioid mode

  • @Qazi-it9mo
    @Qazi-it9mo 6 месяцев назад +1

    For some reason, pyright can't recognize pandas dataframes, even though it(maybe not pyright but something) is providing code suggestions. This has been a well documented issue in reddit by many people and I'm facing this too. How did you solve that?

    • @ZazenCodes
      @ZazenCodes  6 месяцев назад +1

      Hmm I’m not sure it never gave me a problem. Try installing a new virtual environment then pip install pyright and pandas and activating it, then run vim and see if that works

    • @thecompanioncube4211
      @thecompanioncube4211 6 дней назад

      There are always some packages that just don't budge. Life of python dev. Sometimes even in VScode packages like opencv refuses to give intellisense

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

    Super cool. I tried your configs, and kinda starting to like it. Can I know which terminal you're using?

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

      Nice! I’m using alactritty

  • @devnchill
    @devnchill 8 месяцев назад +1

    hey in File tree i installed it sucessfully but when i use space e it says that command as not an editor command . Can you please help me with that

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

      Follow the installation instructions on be GitHub repository for the plugin. Then try :NvimTreeOpen and if that doesn’t work it means it was not installed properly

  • @Alanxuyi
    @Alanxuyi Месяц назад

    I am going to do python programing with neovim, but my working is mostly relevant to AI development, and anaconda is a important tool of package management for me, is the neovim works well with anaconda

    • @ZazenCodes
      @ZazenCodes  Месяц назад

      Sure, but I dont use anaconda anymore so I haven’t tried it. Im sure you can find resources online to help

  • @NikitaVorobyov-yl3eh
    @NikitaVorobyov-yl3eh 2 месяца назад

    Thank you!!!

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

      Thanks, I’m glad you liked it

  • @WhatNameHere
    @WhatNameHere 9 месяцев назад

    I’m unable to reproduce the buffer tabs, it replaces current tab with new one when I open any other file from the tree

    • @ZazenCodes
      @ZazenCodes  9 месяцев назад

      Hmm I'm not sure. You could try using regular vim buffer commands (":bn" or ":bp"). This will let you know if they are opening but just not being rendered by the plugin. You can also check the install/usage instructions for "bufferline.nvim" on github. Another plugin you could try is "lualine.nvim" which gives tab info at the bottom of the window, I believe.

  • @rohitbhanot7809
    @rohitbhanot7809 4 месяца назад

    But thats not how you would use python for a real world project, you would use diff interpretor per project most likely. So how would you configure neovim to use diff venv for each project?

    • @ZazenCodes
      @ZazenCodes  4 месяца назад

      How I do it now is just activate the virtual environment before opening nvim

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

    Thanks for effort, Man, But you make a tutorial for windows please

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

    23:13 - Instead of this why not just setup a virtual environment in the python project you are working on, enter it using source myvenv/bin/activate, pip install pyright and then open up neovim?

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

      This is what I’ve started doing. I haven’t needed to install pyright in the venvs though

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

      @@ZazenCodes Thanks, yes you are right, pip install pyright is not required.
      This LSP can be provided by NodeJS using npm commands in the terminal.
      I managed to simplify your setup by discarding mason and mason-lspconfig (seemed overkill) and using the following lines in lua to get C++ and Python LSP stuff working.
      -- LSP Stuff
      require'lspconfig'.pyright.setup{}
      require'lspconfig'.clangd.setup{}
      require'cmp'.setup()
      local cmp = require('cmp')
      cmp.setup({
      sources = {
      {name = 'nvim_lsp'},
      },
      mapping = cmp.mapping.preset.insert({
      -- Enter key confirms completion item
      [''] = cmp.mapping.confirm({select = false}),
      -- Ctrl + space triggers completion menu
      [''] = cmp.mapping.complete(),
      -- Use tab to select next item
      [''] = cmp.mapping.select_next_item(),
      }),
      snippet = {
      expand = function(args)
      require('luasnip').lsp_expand(args.body)
      end,
      },
      })

  • @rzimmerdev
    @rzimmerdev 9 месяцев назад

    Hey there, didn't see you running the code, as of now this is more of a Text Editor setup right? You didn't show any debugging, environment selection or unit testing, or did I miss something?

    • @rzimmerdev
      @rzimmerdev 9 месяцев назад

      Not to criticize or anything, but would like to know if it is possible to do such things in NVIM, I tried using nvim-dap-python, with Anaconda + unittesting some cases, but to no avail.

    • @ZazenCodes
      @ZazenCodes  9 месяцев назад

      ​@@rzimmerdev No worries! Its true this setup doesn't include any help for unit testing or interactive debugging, for example. There are nvim plugins for these things that you can add to your lazy.lua file. I configure my python env in neovim at 23:10 - you can see how I'm telling neovim what python to look for on my computer to provide proper linting. You can write more complicated lua code to automatically find the appropriate python, e.g. if you have a virtual env running. I have not tried this with conda, but you can find see my "dotfiles" repository on github (link in comments) and find my lsp.lua file and look for a function "get_python_path" that might help you

  • @Sam-rb1id
    @Sam-rb1id 5 месяцев назад

    Good video. By the way you dont really need to specify to neovim which interpreter to use. It will use the one available to it. Ie if you activate and env then start neovim and do `:! which python` you will see you are using the python from your venv. So I have a venv for each project and in theat I have my linteres like mypy for example (and black). Now it will use mypy and black and better yet mypy will use the libs in the venv for getting the types and checking exports. This is prob the best and simplest way to do it. Otherwise if you use a mypy in a different env it wont know about the types in the libs you import. I use pylsp with flake8 and mypy because it is a touch more standard than pyright and not everyone I work with is using neovim :)

    • @JazzBrown-ym8ku
      @JazzBrown-ym8ku 5 месяцев назад

      Friend how will “it” know which venv to use for the project, is there a standard naming convention for the venv in the project root say .venv or .env? Appreciate the help, a noob here.

    • @Sam-rb1id
      @Sam-rb1id 5 месяцев назад

      @@JazzBrown-ym8ku it uses whichever venv is currently active. Just in the same way the terminal does

    • @JazzBrown-ym8ku
      @JazzBrown-ym8ku 5 месяцев назад +1

      @@Sam-rb1id Thank you for replying so what one should do is activate a venv in your shell and then run neovim from that shell so that it knows which venv it is in?

    • @Sam-rb1id
      @Sam-rb1id 5 месяцев назад

      @@JazzBrown-ym8ku exactly that :)

    • @JazzBrown-ym8ku
      @JazzBrown-ym8ku 5 месяцев назад +1

      @@Sam-rb1id Thank you, bro. Appreciate the help.

  • @aleatoirealeatoire-s2j
    @aleatoirealeatoire-s2j 4 месяца назад

    Hi alex i'm in windows and i want to know how you do for install your IDE in Windows . I create a alias for change nvim in vim but for this stape ->
    mkdir ~/.config
    cp -r .config/nvim ~/.config/nvim
    i don't know how i can do , in windows the neovim path is C:\Program Files\Neovim do you have an idea . thank you :)

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

    I would pay an obscene amount of $$$ for a web dev course, from html and css on up to fullstack and modern stuff, that included setting up Neovim and then using it exclusively to build things on my Linux machine. Obscene $$$!!! 👍

    • @ZazenCodes
      @ZazenCodes  6 месяцев назад +1

      lol thank you. I'm working on ML courses that just have light frontend- I'm not a web dev

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

      @@ZazenCodes Even better! I found your Patreon. See you there!

  • @jlaviews
    @jlaviews 9 месяцев назад

    Does this work with mamba as package manager and environments?

    • @ZazenCodes
      @ZazenCodes  9 месяцев назад

      I'm not sure. Looks similar to conda for python? I don't use conda with neovim myself but there is probably a way to configure conda env with LSP - if that's what you mean

    • @jlaviews
      @jlaviews 9 месяцев назад

      It is a package manager but much faster than conda. Setting up lsp pyright is cumbersome. Perhaps it had to do with mason being in the middle. It works so much better in viscode.

  • @monumentalmole123
    @monumentalmole123 9 месяцев назад

    Very good video

  • @RohitJuyal-kj2lp
    @RohitJuyal-kj2lp 7 месяцев назад

    sir do you still use yank to clipboard now?

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

      Hell yea love that one

  • @heiah
    @heiah 9 месяцев назад

    y u no use mason for lsp installation?

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

      I believe this setup does include mason - but true, I didn't use it for the demo

  • @MesoCarib
    @MesoCarib 3 месяца назад +2

    For a "simple" setup, wouldn't you just install LazyVim (that has the plugins and configurations)? And then edit that to your liking?

    • @lmnts556
      @lmnts556 2 месяца назад +1

      No, trying to edit a neovim distro to your liking is the opposite of simple. Better of building from scratch so you actually know the config and actually learning the basics of neovim.

  • @somebody3014
    @somebody3014 22 дня назад

    22:00

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

    Hmm human music, i like it.

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

      Peace among worlds ✌️

  • @davidomar742
    @davidomar742 9 месяцев назад +2

    this guy is too attractive to be using vim. Is this AI generated?

  • @BobSmith-u9l
    @BobSmith-u9l 22 дня назад

    Just found this. Decent vid. However the git source does not match the vid at all. Still its useful.

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

    debugger?

  • @anon_y_mousse
    @anon_y_mousse 9 месяцев назад

    I've never gotten a good answer to this question yet, but I'll ask in the hopes that you can answer. Why NeoVim over vanilla Vim? If you want to use Lua for configuration you can still do that for vanilla Vim if you build it manually with Lua support, and you can do the same with Python, Perl, Ruby and some other languages. Most of what you do here with plugins I can do in vanilla Vim with just editing my ~/.vimrc, and some of it I have already been doing for a while. Although, I use regular tabs instead of buffers, and you can open multiple files from the command line into separate tabs with `vim -p foo bar baz`. If you've never built it from source then let me reassure you that it's easy to do. I have to enable mouse support every time I update and I've yet to find a distro that enables that in their build.
    The only other questions I have are why use space for your leader and do you use a different leader for insert mode?

    • @ZazenCodes
      @ZazenCodes  9 месяцев назад +2

      I probably won't give you the answer you're looking for. I went with neovim because that seemed to be where the most development / community support was. I believe that having lua builtin and standard for neovim if a big upside. For me it's time consuming enough to set all this up without any extra work and I want to make it as easy as I can while still getting that awesome vim experience.
      I'm not sure why I use space for leader but I like that I can use my thumb for it. Do you use the default key? In insert mode its still space for me, I just leave insert mode with before I use leader

    • @anon_y_mousse
      @anon_y_mousse 9 месяцев назад

      @@ZazenCodes I'm not sure I remember what the default key is. If it's \ then yes. As for setup, I just keep pulling my same ~/.vimrc forward onto new systems and as long as I've configured the build right, which you can easily put into a bash script and carry as well, then it's just a matter of make -j8 and wait. I only use 8 cores because I have it running in the background. As for using the leader in code, it introduces a visual delay when I have to type an escape in some string, but it doesn't prevent me from continuing to type, so I don't really need to handle it specially. I can't imagine how space has affected your speed. For that matter, I kind of wonder how much time you spend on configuring when you move to a new system. For me, since my home drive is separate I can just keep going and simply use it. If I need a fresh install I clone the repository, configure, make, copy over my config and done.

  • @drkwrk5229
    @drkwrk5229 4 месяца назад

    The keyboard sound is so annoying 🙉

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

    Debugger? Sike

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

    Experts dont use Chrome!

  • @ajudicator
    @ajudicator Месяц назад

    No AI huh

  • @ordinarygg
    @ordinarygg 9 месяцев назад

    Didn't see any benefit over VSCodium yet, a lot of friction for nothing

    • @ZazenCodes
      @ZazenCodes  9 месяцев назад

      That's fair. The friction is real!

    • @badluckprophet9103
      @badluckprophet9103 9 месяцев назад

      There may never be a benefit for you. There are some out of the box like startup time, integration with tmux, native vs emulated vim motions etc. but nothing game changing. Then you need nvim plugins to get up to the baseline of what vscodium offers. Then vscodium extensions and nvim plugins stay pretty neck and neck for offering additional functionality. Then nvim pulls ahead with the last 10% or so of customization because its more flexible IF you want to put the work in. It's little things like luasnips offering more powerful snippet functionality because you can perform function evaluations in the snippet itself, or being able to custom keybind execution of your personal scripts and small programs. For the majority of people vscodium vs nvim will be gui vs terminal. And you'll see more benefit from learning your tool very well then just using another tool. Heck, I might be wrong about that last 10% simply because I don't know vscodium well enough to know there are extensions or built in functionality to do the same things in vscodium that I want to do in nvim.

    • @ordinarygg
      @ordinarygg 9 месяцев назад

      @@badluckprophet9103 I have 2-5 extensions and color theme, for last 5 years worked perfectly and did the job.

  • @adrian-ik8hf
    @adrian-ik8hf 5 дней назад

    Great information, terrible presentation. It took me 3 hours to follow your video, with 2 hours of rewinding. You are pressing too many keys in the same time.

  • @israelomola3806
    @israelomola3806 4 месяца назад

    Jj

  • @No_Underscore
    @No_Underscore 9 месяцев назад +16

    black is slow, use ruff instead

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

      👀

    • @TheRich107
      @TheRich107 6 месяцев назад +1

      I love python and it's libraries
      As the libraries age turn to rust the tooling gets faster 😊

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

      Python is slow, use c++ instead

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

      ​@@Cowboydjrobot compilation is bloat, code in assembly