The Best Oil.nvim Configuration

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

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

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

    What other config do you use with Oil.nvim?

  • @aquepaique
    @aquepaique 7 месяцев назад +9

    I like using floating window oil, because you can see the file path in the float window title, so helpful.

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

      Oh nice! I'll have to give this a try.

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

      Do you have any config got the float window too or do you use the defaults?

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

      @@ascourter I have this:
      float = {
      padding = 5
      }
      and then when you call the Oil command you just pass in the float flag like so :Oil --float

  • @raenastra
    @raenastra 7 месяцев назад +17

    the natural_order option affects files with numbers. rather than sorting numbers alphabetically, it sorts them numerically. for example, file9.txt and file10.txt will be sorted treating 9 less than 10 (rather than the string "9" being greater than "1")

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

      Ah that makes a lot more sense. Thanks for digging into that and sharing!

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

    Thanks for doing this video. Recently struggling with neovim

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

      You're welcome! Glad I helped. Let me know if there's something I can cover to help ya!

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

    I think natural sort like you have files ["1.txt", "5.txt", "10.txt", "11.txt", "40.txt"]
    Without it (false), it will sort to 1, 10, 11, 40, 5. Because it will compare the each first character
    With the natural sorting, it will sort like what we expect it to be.

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

      I definitely like that better. Thanks for sharing!

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

    Cool config!
    I actually changed the is_hidden_file fuction instead to make all the . Files visable except for .., .git and .DS_Store, and then if i do need to see the .git folder or something like that i can just toggle hidden files with g.

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

    definitely worth to try, thank you

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

      Yup! Thanks for watching

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

    what was that floating command line?

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

      @@monoastro check out my video on the most requested plugin. I'm short, that's noice.nvim

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

    Great video, love oil.nvim!!!

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

      Thanks! I definitely love it as well

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

    solid clean video, i just wanna add you should totally do a vim tips video because that ^v into g, ^A felt like a fighting game combo and i will 100% be doing that just because how it feels

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

      Haha I will definitely put that into another tips video

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

    If you're annoyed by the extra space at the top of the dashboard page you can reduce some spaces in the line 122
    logo = string.rep("
    ", 8) .. logo .. "

    "
    this one --^
    I figured out this earlier and thought of sharing it.
    thx for the vid btw, cant wait for the next one ❤

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

      Nice! Thanks for sharing this. Do you put this in the config function or somewhere else?

  • @艾曦-e4g
    @艾曦-e4g 7 месяцев назад

    Coooool config. IMO, lots of navigator user map ctrl+h/j/l/m to move to pane in neovim and tmux. It conflicts with oil buffer keymaps. Do you know how to remap these keys in oil buffer? Thanks a lot!

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

      I think there might be a bug in Oil.nvim to be able to remap them. But here's an example to at least disable them.
      keymaps = {
      [""] = false,
      [""] = false,
      [""] = false,
      ["q"] = "actions.close",
      },

    • @艾曦-e4g
      @艾曦-e4g 7 месяцев назад

      @@ascourter coool thank you! and oil.nvim cannot change in lazyvim using `keys = `.

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

    Can you please show us how one can get to see images like jpegs, pngs in neovim using maybe something like telescope

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

      I'll bring this to the top of my list and see what's possible

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

      @@ascourter thank you so much,can't wait

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

    Hi, is there any way to use telescope to open the file explorer (oil) in a directory? I mean navigating using both telescope and oil. Also, do you have a discord channel or some social group where I can ask questions?

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

      i set up this
      vim.keymap.set('n', '-', "Telescope fd find_command=fd,-t=d ")

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

      @@MohammadLsk good question. I don't know of a way to combine telescope and oil. I'd guess you could create a telescope extension that uses oil.
      I don't have a discord yet. It's something I should create soon. You might join Josh Medeski's discord for now: discord.com/invite/qQEARWhZ

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

      @@ascourter I appreciate your response. Your content and guidance have been super helpful. I've set up this key mapping for now:
      vim.keymap.set('n', '-', "Telescope fd find_command=fd,-t=d ")

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

    Open with “:Oil -float” in a cool floating window

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

      Love it. Did you customize the window at all?

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

      @@ascourter yes, there is a float-option (same level as view-options):
      float = {
      -- Padding around the floating window
      padding = 2,
      max_width = 90,
      max_height = 0,
      -- border = "rounded",
      win_options = {
      winblend = 0,
      },

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

    Wonderful video, thank you very much, now I don’t have to figure all of this out from scratch.
    I have a question, do you use neo-tree.nvim, or completely rely on oil.nvim? I’m used to neo-tree (I know, the vim overlords will come after me) but I don’t like how it renames and moves files around.
    So wondering if completely replace it or use both.

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

      Thanks! Glad I could help. Haha the vim overlords are definitely going to come knocking... :D I personally rely solely on oil.nvim but when I am working with others I will have neo-tree.nvim open so they can see more easily where we are in the file system. Here's a link to the config I use: github.com/exosyphon/nvim/blob/525694635d0b16f7d461f516b5c8b1a95381c861/lua/plugins.lua#L11

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

      @@ascourter appreciate the response. Will try to use oil exclusively, at least for a month, and see how it feels.

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

    Also, pressing 'g' followed by a backslash to toggle trash is handy

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

      Yeah that is quite handy! Thanks for mentioning that.

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

    Thanks for sharing.

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

      Thanks for watching!

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

    Can you show us your tmux settings and theme?

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

      I sure can! I have a video from awhile ago on setting up tmux but I really need to create an updated one with my latest theme and such. Thanks for requesting this!

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

      Here also is a link to my tmux config github.com/exosyphon/dotfiles/blob/5d6e87a583ff1ac9d244daed26d379627cd04592/.tmux.conf#L1

  • @hanamichi-sakuragi
    @hanamichi-sakuragi 6 месяцев назад

    Any plans to add a flake.nix?

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

      Haha I'll need to get up to speed on Nix first. Definitely on my list!

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

    Thank you!!

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

      Thanks for watching!

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

    Awesome. Thanks

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

      Thanks for watching!

  • @cody_codes_youtube
    @cody_codes_youtube 7 месяцев назад +3

    FAST CODY NOTIFICATION SQUAD

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

      Lightning Fast!

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

    I’ve been using mini.files (more and more of the mini plugins, really), which I find less visually annoying.

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

      It is on my list to check out all the mini nvim plugins. Seems like they are growing in popularity and have a lot of great features. Let me know if you think I should focus on a specific one first.

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

    I still use netrw for browsing, and i use the oil modal when i need to edit files. It's 10000x better than netrw for that.

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

    you don't need gx plugins with neovim@^0.10.0

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

      @@insanity0312 thanks, I'll try removing it and verify nothing breaks

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

      Confirmed! I was able to remove gx.nvim and nothing broke with opening links. Thanks for probing me on this!

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

      @@ascourter Thank you for the video! Cheers.

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

    mini.files

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

      This is on my list to try soon!