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

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • PATREON
    ► / zazencodes
    SECOND BRAIN - Sign up for free access
    ► zazencodes.substack.com/
    GIT REPO - Neovim Lazy IDE 2024
    ► github.com/agalea91/zazencode...
    GIT REPO - My Dotfiles
    ► github.com/agalea91/dotfiles
    LSP ZERO - Lazy install
    ► github.com/VonHeikemen/lsp-ze...
    0:00 - Intro
    1:17 - Install
    3:40 - Setup config dir
    6:55 - Lazy install
    7:35 - Color scheme
    8:20 - Telescope
    10:00 - File tree
    12:05 - Bufferline
    13:50 - Markdown, comments
    16:55 - Misc options, keymaps
    17:35 - LSP install
    20:35 - Python formatting
    22:15 - Python completion
    26:20 - Auto Session
    28:15 - Outro
  • НаукаНаука

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

  • @wadechang
    @wadechang День назад

    Thanks for the tutorial. Very informative.

  • @infernus9579
    @infernus9579 2 месяца назад +4

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

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

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

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

    Just brilliant!

  • @DAVE-GM
    @DAVE-GM Месяц назад +1

    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!

  • @SahilRai2
    @SahilRai2 20 дней назад

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

    • @ZazenCodes
      @ZazenCodes  20 дней назад

      Nice! I’m using alactritty

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

    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

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

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

      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

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

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

      Haha noted! Thank you

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

    Very good video

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

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

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

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

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

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

      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.

  • @Phoenix-wb7ey
    @Phoenix-wb7ey Месяц назад +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  Месяц назад

      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

  • @XandriaAlexandria
    @XandriaAlexandria 2 дня назад

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

    • @ZazenCodes
      @ZazenCodes  2 дня назад

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

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

    Does this work with mamba as package manager and environments?

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

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

      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.

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

    y u no use mason for lsp installation?

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

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

  • @RohitJuyal-kj2lp
    @RohitJuyal-kj2lp 2 дня назад

    sir do you still use yank to clipboard now?

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

    Hmm human music, i like it.

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

      Peace among worlds ✌️

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

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

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

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

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

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

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

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

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

      That's fair. The friction is real!

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

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

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

  • @No_Underscore
    @No_Underscore 2 месяца назад +7

    black is slow, use ruff instead