Switching to Neovim & Rebuilding my Configuration

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ย. 2024

ความคิดเห็น • 125

  • @marcotrosi
    @marcotrosi 4 ปีที่แล้ว +57

    attention with the mappings. make sure you use the right one for the purpose, otherwise you overwrite more default commands than you wanted to.
    :map :noremap :unmap Normal, Visual, Select, Operator-pending
    :nmap :nnoremap :nunmap Normal
    :vmap :vnoremap :vunmap Visual and Select
    :smap :snoremap :sunmap Select
    :xmap :xnoremap :xunmap Visual
    :omap :onoremap :ounmap Operator-pending
    :map! :noremap! :unmap! Insert and Command-line
    :imap :inoremap :iunmap Insert
    :lmap :lnoremap :lunmap Insert, Command-line, Lang-Arg
    :cmap :cnoremap :cunmap Command-line
    :tmap :tnoremap :tunmap Terminal-Job

    • @marcotrosi
      @marcotrosi 4 ปีที่แล้ว +2

      @@makc ah no worries. thanks for making videos about Vim. keep it up.

    • @danielstoddart
      @danielstoddart 3 ปีที่แล้ว

      You should always check the mappings before overwriting one that's more essential or at least weigh the tradeoffs.

  • @fooked1
    @fooked1 4 ปีที่แล้ว +37

    If you're working directly on your init.vim file, you don't need to keep closing/opening vim. You can just do :so%
    so == source
    % == current file

  • @EliteTester
    @EliteTester 4 ปีที่แล้ว +17

    I think you can do "map :Goyo" to not have :Goyo show up

  • @brandonduvalbenn3400
    @brandonduvalbenn3400 4 ปีที่แล้ว +7

    Great video. to go back to the previous line and column in the file. Was quite painful to see you scrolling through the config 😅

  • @bufmouse13
    @bufmouse13 3 ปีที่แล้ว +4

    legitimately a great video showing some realworld vim use and customization. Nice job end I hope to see more.

  • @ypaut
    @ypaut 4 ปีที่แล้ว +9

    The config file location reason actually makes a lot of sense to me.
    Being able to just clone a config into .config/nvim/ makes all the difference.
    If you feel irelevant for this, know that what prevents me from switching to NeoVim is that I prefer Vim's icon to NVim's.
    And.. "Vim" sounds better. Right?
    welp

  • @Lowacy
    @Lowacy 4 ปีที่แล้ว

    Thanks for the Lex command, I was looking for a way to make netrw a fixed column size. I changed this command to `nnoremap n :Le :if &ft == "netrw" vertical resize 30 endif ` because it also resized the file window with multiple splits

  • @crispgm
    @crispgm 3 ปีที่แล้ว +1

    I found that though you mapped for reload, actually you quit and reopen to make it work lol.

  • @KaranSingh-wy4df
    @KaranSingh-wy4df 4 ปีที่แล้ว +3

    @Macr good video, I kind of use vimium extension for browser as well. if anyone is looking something like that.

  • @AllanOlsen1970
    @AllanOlsen1970 3 ปีที่แล้ว +3

    make more, nice one! love it, nice explanations, just what I needed.

  • @ProfessorChaos1349
    @ProfessorChaos1349 3 ปีที่แล้ว +1

    Man, hearing your explanation of the line numbers just had me going, "...wtf?".

  • @mihai.craita
    @mihai.craita 4 ปีที่แล้ว +1

    That scrolloff 999 keeps you cursor on the middle of the screen 😀Great video!

  • @AdamMcNutt
    @AdamMcNutt 4 ปีที่แล้ว +10

    You can move your .vimrc file to wherever you like. Just define VIMINIT in your .bashrc to tell it where it lives. To move the .viminfo, define it in the .vimrc.
    Example for .vimrc in your .bashrc:
    export VIMINIT="source ~/.config/.vim/.vimrc"
    Example for .viminfo in .vimrc:
    set viminfo+=n~/.config/.vim/.viminfo

    • @santiagolerin
      @santiagolerin 4 ปีที่แล้ว

      For the .vimrc, you could just move it into .vim and remove the dot from the name

  • @charetjc
    @charetjc 4 ปีที่แล้ว +3

    26:20 scrolloff specifies how close the cursorline can get to the edge of the buffer before scrolling. In your config, scrolloff=999 kept the cursorline in the center of the buffer (except when you're at the top or bottom of the buffer... I think).

  • @maximrittervononciul4681
    @maximrittervononciul4681 4 ปีที่แล้ว

    Well recently NeoVim is developing a native LSP client. So that would be a unique feature :)

  • @SayanChakraborty10397
    @SayanChakraborty10397 4 ปีที่แล้ว

    Hey, very nice video. Took up a lot of things from here. Just one small thing, I also use a shortcut for reloading the init.vim file every time I make changes (because I'm too lazy to quit and open up a nvim instance again),
    I use this mapping: nmap :w :source ~/.config/nvim/init.vim
    I just noticed that you were not saving the file before the source. Hence, probably it was not reloading the changes instantly.
    I saw you remove that command as but you can try using this if you want.
    Great video by the way! Thanks!

  • @heubd
    @heubd 4 ปีที่แล้ว +2

    Thanks for this type of videos, I learn a lot.

  • @dacresni
    @dacresni 4 ปีที่แล้ว

    on a mac, they're still on vim7 so installing neovim and aliasing would keep you from having to build vim8 from source with all the pluggins or installing macvim .

  • @charetjc
    @charetjc 4 ปีที่แล้ว +1

    TIL about :move 22:55. Thanks!

  • @lennartdope
    @lennartdope 4 ปีที่แล้ว +1

    Amazing video! This answers many questions I’ve been having.
    What window manager are you using? And how do you achieve what seems to be a tiling window layout?

  • @Mangeshrex_
    @Mangeshrex_ 3 ปีที่แล้ว

    You Seem a profession editor/AE artist

    • @makc
      @makc  3 ปีที่แล้ว +1

      Not even close, but thx

    • @Mangeshrex_
      @Mangeshrex_ 3 ปีที่แล้ว +1

      @@makc hehe

  • @scaferz9644
    @scaferz9644 3 ปีที่แล้ว +1

    Great videos! i have one question, how do you configure ur macOs so that there is no title bar on the Alacritty terminal? Thanks!

    • @makc
      @makc  3 ปีที่แล้ว +1

      It’s a setting in the alacritty config. th-cam.com/video/eXyrTFNsdHA/w-d-xo.html

  • @saleenapatel
    @saleenapatel 8 หลายเดือนก่อน

    you are awesome 💗

  • @cole92573
    @cole92573 4 ปีที่แล้ว +2

    Thanks for the video. How are you autohiding the window buttons/decorations on macos? cheers

    • @BosEriko
      @BosEriko 4 ปีที่แล้ว

      Bump. I need this, too.

    • @cole92573
      @cole92573 4 ปีที่แล้ว

      @@makc thanks so much! Great videos btw

    • @Nandu2794
      @Nandu2794 4 ปีที่แล้ว

      Bump. Me too...how do you do it?

  • @tent405
    @tent405 4 ปีที่แล้ว

    what is "Ovtober"? Given a date, is that date equally distributed amongst all the days of the week? If not, why not, and how can I graph that distribution? Are there particular dates that are say, more likely to be a Friday, or a Sunday? Calendars are weird.

  • @sgoskz
    @sgoskz 4 ปีที่แล้ว +2

    as for me, neovim doesn't work with the standard input/output correctly when running !commands
    ie bypass write protection via
    :w !sudo tee %
    doesn't work on neovim as you can't type anything when sudo requires you to type your password
    edit: spelling error

  • @JJCUBER
    @JJCUBER 4 ปีที่แล้ว +4

    6:12 correct me if I’m wrong, but isn’t “set nu rnu” the exact same thing as “set number relativenumber?” I think you put them both in by mistake 😅

    • @makc
      @makc  4 ปีที่แล้ว

      I did. Thanks.

  • @MrZombieSwamp
    @MrZombieSwamp 4 ปีที่แล้ว

    great video! thanks a lot.
    Would it be possible to make a video on making certain configurations on init.vim trigger based on different file types?

  • @VioletJewel1729
    @VioletJewel1729 3 ปีที่แล้ว +1

    Switching because neovim stores config in .config?? Wat. Well, just so you know, neovim has builtin lsp and also can use tree-sitter in the nightly build (v0.5). It also has gO to pull up an "overview" in the quickfix. But yes, vim 8.2 and neovim are quite similar otherwise.

  • @avimehenwal
    @avimehenwal 4 ปีที่แล้ว

    Hey there, nice video.
    I am new programmer who recently switched to vim from vscode to save some RAM on my cheap hardware :)
    I think neovim is leading in feratures at the moment with added LSP (language server protocol) support.

  • @mrkoay8607
    @mrkoay8607 4 ปีที่แล้ว +1

    Hi Makc, may i know what's the cool 'vf' alias that you used to view files like Explorer?

    • @s4ecki
      @s4ecki 4 ปีที่แล้ว

      i believe it was vifm

  • @zeocamo
    @zeocamo 4 ปีที่แล้ว +1

    6:57 noemoji fix the 2x char for emoji so the cursor don't f*** up after a emoji

  • @grymmjack
    @grymmjack 4 ปีที่แล้ว

    What is the vf app? Have you seen ranger? I have gruvbox working well in it. Also pygments and scope. Can share if you like.

    • @yangli9282
      @yangli9282 4 ปีที่แล้ว

      some question

  • @CurtisAult
    @CurtisAult 4 ปีที่แล้ว

    here i am watching this seriously and absorbing everything when suddenly "DEE DEE MEGA DOO DOO". I lost my shit. thanks. now let me go replace my drink.

  • @DavidReyes-fw2mq
    @DavidReyes-fw2mq 4 ปีที่แล้ว +2

    Great video, I would love to know the name of that color scheme :D

  • @solvm1652
    @solvm1652 4 ปีที่แล้ว

    Rad vid What are you using to open and close the browser like that? I'm guessing that you are using a hotkey, but what is that wizardry?

    • @solvm1652
      @solvm1652 4 ปีที่แล้ว

      @@makc - but a command line was showing at the top of your browser. what was that feature? how did you get that to show?

  • @hensonjhensonjesse
    @hensonjhensonjesse 4 ปีที่แล้ว +1

    That was cool

  • @hellNo116
    @hellNo116 4 ปีที่แล้ว

    this is really good since it is a mess to navigate others people config files and trying to figure out what they do.
    as a newbie coming from sublime i do need some help.

    • @hellNo116
      @hellNo116 4 ปีที่แล้ว

      @@makc until now I do. The fact I don't have to move my hands is great.
      However vim seems to be really hard to use for big programming projects. I think my ide will be up on the background so making the projects easier. Also debugging them. Even no that I haven't switched that is my workflow.
      The biggest thing missing that I haven't manage to setup is language integration. When I manage to figure that out I'll fully commit. Maybe for me the solution is evil mode on emacs.

  • @Handy-Handy
    @Handy-Handy 3 ปีที่แล้ว

    @MAKC and what's your conclusion about 'relative number'? :)

    • @makc
      @makc  3 ปีที่แล้ว

      I’ve totally removed line numbers at this point (I don’t write much code, so they’re not that useful for me), but it’s probably just a matter of preference. I swapped back and forth a bit before I killed the line numbers entirely.

  • @user-he4ef9br7z
    @user-he4ef9br7z 3 ปีที่แล้ว

    Woah woah woah. There is a big difference between Vim and Neovim. Why is it so heavy otherwise?
    Neovim ships with an entire LuaJIT. You can write your plugins/ modifications in lua instead of vimlang, although vimlang works too. Neovim also has an API so other programs can interact with it. I am running a grammar check plugin which checks English grammar using Java when I am writing my emails in Neovim. Can't do that in Vim.

  • @danielstoddart
    @danielstoddart 3 ปีที่แล้ว

    Why did you quit using NERDTree instead of the native finder? I was using Vimfiler for a while (opens by keying `~` by default), but I went back to NERDTree and it's actively developed.

    • @makc
      @makc  3 ปีที่แล้ว

      It’s pretty rare that I navigate between files in Vim. Don’t need anything to powerful, so I just use :Explore and a fuzzy finder.

  • @zheli2417
    @zheli2417 2 ปีที่แล้ว

    Hi the link of wallpaper is broken can you give me a new link?

  • @fractievoorzitter
    @fractievoorzitter 4 ปีที่แล้ว

    What desktop environment are you using?
    I am just curious since it looks like you are using i3 or sway on mac...

    • @makc
      @makc  4 ปีที่แล้ว

      I'm using standard MacOS, but using "Rectangle" as the window manager.

    • @fractievoorzitter
      @fractievoorzitter 4 ปีที่แล้ว

      @@makc Thank you that looks really cool :)

  • @vitormelo22
    @vitormelo22 3 ปีที่แล้ว

    Muito obrigado, me ajudou muito!

  • @ikrammaududi6205
    @ikrammaududi6205 4 ปีที่แล้ว

    How does he do that at 0:46? What is that?
    I watch other vim users do that as well??

    • @makc
      @makc  4 ปีที่แล้ว

      That’s a cli file manager called “vifm”. You can install it through home brew on Mac, or basically any package manager on Linux.

  • @noib358
    @noib358 4 ปีที่แล้ว

    Totally unrelated, but how did you remove the titlebar from qutebrowser? The only way I know of is by putting c.window.hide_decorations=True in the config.py file, but then I can't move or resize the window.

    • @noib358
      @noib358 4 ปีที่แล้ว

      @@makc If I remember well the problem is with Qt and not qutebrowser, so there's not a lot they can do about it.

  • @aaronyang1284
    @aaronyang1284 4 ปีที่แล้ว

    the way hide the title bar of app in mac plz.

  • @AntiCookieMonster
    @AntiCookieMonster 4 ปีที่แล้ว

    You don't move lines by deleting and pasting them where you need them?
    I also find myself using J to join lines together a lot so I wouldn't overwrite that one.

    • @sripradpotukuchi9415
      @sripradpotukuchi9415 4 ปีที่แล้ว

      notice that he used "xnoremap" instead of "noremap". What this does is it makes that keybinding work only when in visual mode. So if you do 'J' in normal mode, you still will get the Join functionality.

  • @FrancisVidal
    @FrancisVidal 3 ปีที่แล้ว

    What's the font you're using?

    • @makc
      @makc  3 ปีที่แล้ว

      Either Fira Code or Source Code Pro (usually the Nerd Font version)

  • @victornikolov537
    @victornikolov537 4 ปีที่แล้ว

    What it that vf program?
    I was unable to find it in the repo.
    And the browser too

    • @makc
      @makc  4 ปีที่แล้ว

      vifm (The vi file manager) & qutebrowser

  • @samuelpimenta1942
    @samuelpimenta1942 4 ปีที่แล้ว

    Hi, what's your terminal application? Are you using Tmux?

    • @samuelpimenta1942
      @samuelpimenta1942 4 ปีที่แล้ว

      @@makc Thanks for the reply! I found your channel yesterday and I'm amazed! Much success@!

  • @dylanpang5948
    @dylanpang5948 4 ปีที่แล้ว +2

    Hi what font are you using?

    • @daveh7001
      @daveh7001 4 ปีที่แล้ว

      @@makc I think in this video you also used Fira Code.

  • @comed1an
    @comed1an 4 ปีที่แล้ว

    Line numbers and the ruler are not the same piece of information in two places.

  • @ashfaqrobin9302
    @ashfaqrobin9302 4 ปีที่แล้ว

    what terminal you are using?

    • @makc
      @makc  4 ปีที่แล้ว

      Probably alacrity

    • @danielstoddart
      @danielstoddart 3 ปีที่แล้ว

      It's alacritty

  • @dagadbm
    @dagadbm 4 ปีที่แล้ว

    there is a feature on nvim that doesnt exist in vim: native lsp in HEAD nvim

    • @indiaengineering
      @indiaengineering 4 ปีที่แล้ว

      You mean coc and other lsp are part of nvim itself now ?

  • @garkeinen7034
    @garkeinen7034 3 ปีที่แล้ว

    If neovim doesn't add features over vim, how comes it does have 20MiB more?

    • @makc
      @makc  3 ปีที่แล้ว

      Bloat?

    • @garkeinen7034
      @garkeinen7034 3 ปีที่แล้ว

      @@makc But then Luke Smith sure wouldn't use it. Is there really nothing more to it?

  • @marufjony
    @marufjony 4 ปีที่แล้ว

    Can you please tell me which browser you are using?

  • @fugh7098
    @fugh7098 4 ปีที่แล้ว

    what browser do you use?

  • @hendrykhoza4782
    @hendrykhoza4782 4 ปีที่แล้ว

    What browser do you use

    • @makc
      @makc  4 ปีที่แล้ว +1

      Qutebrowser & Firefox

  • @tanaoduy8400
    @tanaoduy8400 4 ปีที่แล้ว

    Hi, i install neovim but when run has error: zsh: command not found: nvim. Can you help me? Sorry my eng not good.

    • @charetjc
      @charetjc 4 ปีที่แล้ว

      If you're running from a bash/zsh shell that was open before installing neovim, you may have to run `hash -r` to force the shell to reload available commands the shell has cached.
      Otherwise, `find / -type f -name nvim` to find where you installed neovim to, then make sure your PATH environment variable includes the folder path.

  • @itachicodes2506
    @itachicodes2506 ปีที่แล้ว

    what coloscheme is that?

    • @makc
      @makc  ปีที่แล้ว +1

      Gruvbox

    • @itachicodes2506
      @itachicodes2506 ปีที่แล้ว

      @@makc thank you king

  • @nickytope
    @nickytope 4 ปีที่แล้ว

    You left all your plugins in the folder ~/.vim/plugged

  • @hi_im_julian_kirsch
    @hi_im_julian_kirsch 4 ปีที่แล้ว

    How did you tweak your Mac setup to look like i3?

  • @MarkusBurrer
    @MarkusBurrer 3 ปีที่แล้ว

    I know many differences between vim and neovim.
    e.g. Lua, asynchronous or, in 0.5, Lsp Support and Tree Sitter

  • @imetatroll3745
    @imetatroll3745 4 ปีที่แล้ว

    read only

  • @SanixDarker
    @SanixDarker ปีที่แล้ว

    nvim has popups vim doesn't !

  • @sergey_c
    @sergey_c 4 ปีที่แล้ว

    NVim - is the thing in itself. As long as it open source, it has very low quality support for web programming. I would never choose it as standalone IDE. I wish to but I can't.

    • @Chex_Mex
      @Chex_Mex 3 ปีที่แล้ว

      Check out neovim vscode. You can have a full on neovim text editor open and get all the nice tools of vscode as well. I just setup it up and it's definitely blowing my mind that something like it is possible

    • @sergey_c
      @sergey_c 3 ปีที่แล้ว

      @@Chex_Mex , the current stable release version is 0.4.4(c). This is from official site. I'm using webstorm. It has builtin vim like editor. It costs not so many from my point of view. I'm working as a professional web developer and can't wait any further for at least 1.0 version.

    • @Chex_Mex
      @Chex_Mex 3 ปีที่แล้ว

      @@sergey_c Oh, I know, if you use neovim's nightly version instead and the neo vim vscode extension you can do what I was saying. Unlike other vim extensions, you aren't emulating vim but it's just full on nvim in there. You can use any plugins you install and your entire config file. And it's all free :).
      Give it a shot if you ever have the time, I was using webstorm as well until recently.

    • @sergey_c
      @sergey_c 3 ปีที่แล้ว

      @@Chex_Mex , he he. And if if if ... I've been linux user for more than 10 years. It means spend lot of time for configuration. I'm ready to spend some amount of money to skip all that configuration stuff.

    • @Chex_Mex
      @Chex_Mex 3 ปีที่แล้ว

      @@sergey_c Completely fair to be honest. Although part of the nice thing about this is that you can use your neovim configs and get most of the same functionality for free.

  • @konrain7299
    @konrain7299 4 ปีที่แล้ว

    neovim will be bloated junkware...keep it simple and use vim and setup a personal config.

    • @danielstoddart
      @danielstoddart 3 ปีที่แล้ว

      I'm always amused by troll comments on editor configuration videos

  • @Microphunktv-jb3kj
    @Microphunktv-jb3kj 4 ปีที่แล้ว

    highlight paragraph lol... it's made for highlighting code... it highlights everything ... empty lines are indicators basicly. well whitespace essentially...
    I was about to comment, that ur plug list gives me ocd... that why the fuck you dont have co c , git, fugitive, fzf, sneak and some other stuff.. but u sayd in the video that ur not actually a coder, but writing a lot in vim... what you are writing about then? blogs? bookS?