Oil.nvim - My Favorite Addition to my Neovim Config

Sdílet
Vložit
  • čas přidán 14. 05. 2024
  • I've really been enjoying oil.nvim lately - it's a great plugin that makes it so easy to edit, and do some simple navigation through the filesystem with neovim:
    Oil: github.com/stevearc/oil.nvim
    Configuration: github.com/tjdevries/config.nvim
    Oil Config: github.com/tjdevries/config.n...
    Links
    Twitch: / teej_dv
    Twitter: / teej_dv
    Github: github.com/tjdevries
    Neovim: BTW
    #neovim #programming #lua
  • Věda a technologie

Komentáře • 170

  • @raoulkent
    @raoulkent Před měsícem +52

    Saying what command you ran ("dt.") is freaking gold for anyone that isn't yet a vimzard. Cheers for the content!

    • @nemethda
      @nemethda Před měsícem +2

      same here, I stopped the video right away to try it :) I've been using "f" for these type of actions but didn't know about "t"

    • @cwjdog57
      @cwjdog57 Před měsícem +6

      I swear every time I watch someone talk about their config I learn a new command
      cib ("change inner bracket") was the first one for me of that (deletes content in between brackets/parens and enters insert mode)

    • @vinothkmr
      @vinothkmr Před měsícem

      ​@@cwjdog57ca( (change around brackets) would include those brackets as well.
      This can be used for also any symbol as well, like quotes or # comment blocks

    • @Perry3D
      @Perry3D Před 27 dny +2

      Oh wow. That is great. I always used ci( or ci[.

  • @riccardoshrives5881
    @riccardoshrives5881 Před měsícem +54

    Loving these videos breaking down your config! Thanks teej, keep 'em coming!

    • @teej_dv
      @teej_dv  Před měsícem +20

      two more coming this week :)

    • @lpanebr
      @lpanebr Před měsícem +2

      Me too!

  • @stevearc
    @stevearc Před měsícem +40

    Glad to hear you're enjoying oil nvim! There are more features, but honestly I mostly just use it like you do. The main motivation for writing it was that I could never remember the keymaps for mark+move multiple files in lir 😅

    • @iusehjkl
      @iusehjkl Před měsícem +1

      What a pity we can't move file by appending 'other_dir/' to it's name. Is this related with plugin's philosophy?

  • @ShallowClone
    @ShallowClone Před měsícem +26

    Big fan of Oil, editing your project files as a buffer feels really intuitive compared to other file exploring alternatives in nvim

  • @zacbackas
    @zacbackas Před měsícem +13

    oil's SSH feature is really nice for viewing/editing files on remote machines in a pinch

  • @MohammadLsk
    @MohammadLsk Před měsícem +2

    Your daily uploads are awesome. Keep the fire going

  • @aoshifo
    @aoshifo Před měsícem +1

    This is my favorite way to explore new plugins! Thank you teej!

  • @nasso_
    @nasso_ Před měsícem +47

    my favorite feature is the ability to move files by just cutting and pasting file/directory names anywhere (to a different directory)
    it even works ACROSS SPLITS!!!! this is crazy

    • @teej_dv
      @teej_dv  Před měsícem +10

      ya, it just makes me nervous because i'm worried i'll lose the file somehow LUL but it's a very cool one (didn't want to be responsible for people messing it up though haha)

    • @casraf
      @casraf Před měsícem +3

      It's a little tricky to paste files into a new directory, because when I want to create one I have to save, and if I already deleted the files to be pasted in the new dir, the save for creating the dir also deletes the files. So if you're careful about the order it's possible, but could definitely use improvement

    • @stevearc
      @stevearc Před měsícem +4

      @@casraf you can enter a new directory before you :w to create it :)

    • @casraf
      @casraf Před měsícem +1

      @@stevearc is that so? I'll try! Maybe I thought I did but didn't

    • @mzzzchael
      @mzzzchael Před měsícem +3

      haha i actually ran into that issue before, lost some files. when i tried to paste and save it said those were invalid files 😢

  • @yyvan5125
    @yyvan5125 Před měsícem

    Hey teej, I really enjoy these plugin videos!

  • @Majiy00
    @Majiy00 Před měsícem

    Loving these smaller videos showcasing plugins TJ!!! Keep them coming please!

  • @SickMcNugget
    @SickMcNugget Před měsícem +17

    At the moment I use Netrw for all this stuff, but it feels a bit obtuse at times. Anything more complex then what you showed in this video I would have done on the command line anyway, so I think I'll be adding oil to my config. Thanks for the spotlight!

    • @teej_dv
      @teej_dv  Před měsícem +2

      nice!

    • @dakata2416
      @dakata2416 Před měsícem

      ​@@teej_dvthese types of videos where you show an interesting plugin are very useful! Keep it up TJ!

  • @bloodandbonezzz
    @bloodandbonezzz Před 7 dny

    Thanks for the video helped me set it up, that shortcut was genius.

  • @danieldosen5260
    @danieldosen5260 Před měsícem +1

    I wish I knew this existed before today! Fits perfectly with my workflow.

  • @user-st3yv3to8r
    @user-st3yv3to8r Před měsícem +6

    Love oil, but recently switched to mini.files. The same "file-system as buffer" stuff, but easily allows viewing parent directories(multiple levels if needed) and previews

    • @teej_dv
      @teej_dv  Před měsícem +1

      Love the mini plugins, will check that one out.

  • @casperon7
    @casperon7 Před měsícem

    OMG, I was looking for the Ctrl+v thingy for ages, thanks!

  • @adriancostin9138
    @adriancostin9138 Před měsícem

    Man, did I love the Ranger file manager for this type of stuff. Sadly couldn’t get it on Windows. Glad you shared this so I can get some of that juicy file manipulation from Neovim. Thank you!

  • @shock9616
    @shock9616 Před měsícem +1

    OIl is one of my favourite plugins! I've been transitioning to Neovim over the last year or so from Sublime/VS Code/Atom/etc. and one of the things I've really enjoyed is being able to build my own workflow instead of just having a VS Code-ified editor like before. Using Oil and Telescope for file structure editing and navigation instead of a sidebar file tree has been by FAR the most impactful change and I honestly can't go back.

  • @ChrisPatti
    @ChrisPatti Před měsícem +3

    Oil is da 💣. Great video!

  • @friendly__drone9352
    @friendly__drone9352 Před měsícem

    Teej you're a great explainer!

  • @adibhanna
    @adibhanna Před měsícem

    love this series!

  • @comfysage
    @comfysage Před měsícem

    i'd love a video covering your opions on some of the major neovim distros. maybe about ur issues with some of their designs or their configuration

  • @doop9713
    @doop9713 Před měsícem +1

    Very awesome, thanks for sharing

  • @TheBeatlemobile
    @TheBeatlemobile Před měsícem +1

    My favorite plugin ever

  • @_bitties
    @_bitties Před měsícem

    I need more of this type of videos

  • @Gustafonair
    @Gustafonair Před měsícem

    Great video, keeping learning small details almost every time, was unaware of 'e!', and oil.nvim looks handy

  • @yodokoro
    @yodokoro Před měsícem

    Damn, I’ll definitely check this one out! I’ve been struggling for a while with files manipulation when doing big refactoring in my monorepo and this will help for sure! I’m also navigating a lot to neighbour files and was thinking of adding a keymap that would open telescope with only the files of the current directory and under. For now I heavily use :e %:h/* to move between neighbour files quickly

  • @niza.v1
    @niza.v1 Před měsícem

    Oh, this is exactly what I need! I use netrw as I’ve also started to appreciate the simplicity of having the editor full screen. But netrw is such a pain when it comes to moving lots of files, especially in nested folders. I’ve always resorted to writing a shell script for such cases, but now, I can just use this instead!

  • @will_1536
    @will_1536 Před 2 dny

    Oil is amazing, been using it for a long time

  • @JoshMedeski
    @JoshMedeski Před měsícem

    I love that you can duplicate the line and it will create a copy of the file! I use that a lot.

  • @rodelias9378
    @rodelias9378 Před měsícem

    Great video! Thanks a lot!

  • @maleldil1
    @maleldil1 Před měsícem

    Oil is amazing. I basically live in the terminal, and moving many files, mass renaming etc. just isn't as convenient as it is in a GUI, but I could never get the hang of a terminal file manager like Ranger. Oil completely changed that; I use it for so many things. I even have an alias to open it from the shell (alias vf 'nvim -c Oil'), so it effectively becomes a file manager for me.

  • @manideeppolireddi
    @manideeppolireddi Před měsícem

    Try this... delete a file with `dd` and then go the folder you want and press `p` to move the file to a different folder. It feels great that this even works 👌

  • @2mbst1
    @2mbst1 Před měsícem +1

    I'm using oil for over a year now and have been doing some *aggressive* things in it, deleting, moving, copy, pasting, renaming pasted folders that were delete, doing this over several splits of oil. And it handled everything perfectly and I never lost a file. Which makes sense, when you know how it's doing its thing under the hood.
    I also never got used to the floating window. It competes with my mental space of telescope/fzf-lua. I have mapped `_` to `vnew %:h` and `-` to open oil at cwd.
    I'm usually a purist when it comes to plugins; but oil is one of the exceptions in my config.

  • @j1d7s
    @j1d7s Před měsícem

    rtoil has been a mainstay in my collection of plugins, I really don't like / need file trees. One cool thing I thought you did not mention is when you copy / paste in oil, the content of the newly created file is a copy of the old one!
    One thing I could not configure, but it does not bother me a lot, is that keeps splitting the oil window even when configuring keymaps as in your example. This interferes with seamlessly jumping between Neovim and tmux panes.
    UPDATE: I found out what I did wrong. There is an additional setting in my oil configuration which comes _after_ the key mappings which is `use_default_keymaps`. Setting it to `false` made it work.

  • @Redyf
    @Redyf Před měsícem

    Oil is really cool, I've been using it for a while now. Way better than file tree for sure

  • @daltonyon
    @daltonyon Před měsícem

    Whats is this? hahahha awesome plugin, I have been using netrw since the beginning that I work with neovim and I always have problems to delete or move dirs that have files inside, Oil will help me a lot!!!
    Thanks Tj

  • @_bradleystrider
    @_bradleystrider Před měsícem

    I used to have nvim-tree but literally only when the thing that I wanted to do was edit a directory, like change the folder structure or add multiple files to it. oil fills that specific need because that is exactly what it is useful for, and it's so much better at it than ur traditional file tree plugins

  • @mainendra
    @mainendra Před měsícem

    Recently I've started using mini nvim plugins and mini files has similar features with tree like structure. might be a good one to explore.

  • @user-xw2zr2lw9e
    @user-xw2zr2lw9e Před měsícem +1

    Oiled up nvim 😈

  • @Morpheus451
    @Morpheus451 Před měsícem

    Renaming files in a vim buffer is extremely efficient. I use ranger as file manager, which has this function as bulkrename. But oil.nvim might still be helpful when I’m already in nvim at the time.

  • @redcoreit
    @redcoreit Před měsícem +1

    Agreed! You have to convince Prime too! :D

    • @lpanebr
      @lpanebr Před měsícem +2

      It'll be a hard pitch! Maybe if they change the name to coconut-oil though...

  • @casperon7
    @casperon7 Před měsícem

    Hey fam, great content, one question though - why are you wearing headphones while recording YT videos?

  • @ejreillyxyz
    @ejreillyxyz Před měsícem

    if you're digging oil you'll probably really enjoy mini.files - it's just a bit less obtrusive imo. thanks for all the info teej!

  • @eamonburns9597
    @eamonburns9597 Před měsícem

    I just discovered that you can change the permissions using oil! In the setup, add "permissions" as one of the columns, and you can just edit the rwx for the user/group/other. E.g. if you have a script, with the following permissions "rw-r--r--" and you change it to "rwxr-xr-x" it becomes executable!

  • @adjbutler
    @adjbutler Před měsícem

    love it

  • @MartialBoniou
    @MartialBoniou Před měsícem +1

    I use and recommend mini.files (very fast navigation with h/l, previews, files' creation/deletion like oil.nvim). I mapped:
    - to mini.files in the current directorry;
    - pv to mini.files at the root of the git/darcs project (pv: project view)
    I didn't like oil.nvim (or vim-vinegar) the last time I tried it: there's an ugly side effect that breaks Netrw (you may still need; in my setup, when there's no file, it opens Netrw and no plugin (execept colorscheme) is loaded thanks to the lazy package manager).

  • @thepatzer
    @thepatzer Před měsícem

    Yesss! Welcome to the oil.nvim hype train!

  • @josecarloscirqueirajunior2914

    thanks TJ

  • @RedOchsenbein
    @RedOchsenbein Před měsícem

    Okay, just ditched nnn for this. Just feels awesome.

  • @gideonidoko
    @gideonidoko Před měsícem

    I recently moved to Netrw from neo-tree because of the fs in buffer feature. Netrw, although somewhat lumpish, does everything I need from navigation to file editing right now. Oil looks pretty amazing though and I’ll give oil a try.

  • @redbrick808
    @redbrick808 Před měsícem

    Oil is life.

  • @jimhrelb2135
    @jimhrelb2135 Před měsícem

    Oil was what I wanted for so long. VSC*de in shambles after this video dropped.

    • @vsz-z2428
      @vsz-z2428 Před měsícem

      vsc*de was in shambles before this video

  • @oalfodr
    @oalfodr Před měsícem +1

    I have integrated oil in my lf file manager config to be used for bulk rename. While exclusively in nvim, I use it for navigation to neighboring files

    • @IainSimmons
      @IainSimmons Před měsícem

      I was just thinking this would work well with a terminal based file manager. Care to share your setup?

    • @oalfodr
      @oalfodr Před měsícem +1

      Sure. I have GitHub link in profile. My current setup requires tmux to show nvim with oil in a same window but could be changed

  • @rika-chan
    @rika-chan Před měsícem

    I've used the ranger file manager's `:bulkrename` command for similar stuff in the past.

  • @freedo201
    @freedo201 Před měsícem

    NOICE!

  • @Argletrough
    @Argletrough Před měsícem +6

    *laughs in dired*

  • @rwz
    @rwz Před měsícem

    Loving oil, but need a command to quickly open directories within the oil buffer to move files over "greater distances".

  • @RazoBeckett.
    @RazoBeckett. Před měsícem

    Using this for long, I use oil for renaming and create and changing file location the functions which are not available telescope i mostly use telescope for navigation and i'm pop up window guy. Its nice plug in

  • @alihammadshah
    @alihammadshah Před měsícem

    Could you please do a video on how you manage project scooped neovim configurations?

  • @lmnts556
    @lmnts556 Před měsícem

    I like to open a split and move files from one place to another. Can be in 2 places at one time.

  • @danielschmitt5750
    @danielschmitt5750 Před měsícem +1

    Imo oil.nvim is what neovims native file explorer should be.

  • @frankslsh
    @frankslsh Před 26 dny

    About file trees etc, I find them useful to keep the left portion of the screen occupied, so that the editor is almost at the center, otherwise, having a pretty big screen I always have to keep my eyes looking left instead of in front of me, I find this annoying. There are other plugins like no-neck-pain, etc but I think having something useful in that portion of the screen is more important. What do you think about it?

  • @tobias-edwards
    @tobias-edwards Před měsícem

    Looks cool! How did you do the "multi-cursor" edit of all file names at 3:58?

    • @teej_dv
      @teej_dv  Před měsícem +1

      that's "visual block" mode - press ctrl-v and do some movements, then "i" to insert some text. it's builtin!

    • @oliverfoxi
      @oliverfoxi Před měsícem

      @@teej_dv do you mean "". Cause "i" is used for "select in something" feature

    • @teej_dv
      @teej_dv  Před měsícem

      sorry, ya, was typing on mobile haha

  • @Avbanks23
    @Avbanks23 Před měsícem +1

    This is basically emacs' directory editor Dired

  • @a_maxed_out_handle_of_30_chars

    oil nvim is the best :)

  • @sutirk
    @sutirk Před měsícem

    When i heard about Oil i thought it was perfect! Until i actually decided to use it. There's a few things that simply don't work the way i think, for example renaming file to newdir/file is ok but renaming it to existingdir/file gives you an error, and using caw to change the file name brings up an otherwise invisible id into your buffer which is quite annoying
    I'm currently using mini.files (aka 'the floating one') and i think it's a much better experience, it works the way I think and its crazy smooth to navigate up and down directories. That being said, i would also prefer it not floating, but i couldn't find out if that's possible yet.

  • @muizzyranking
    @muizzyranking Před měsícem

    Time to get oiled.

  • @tauiin
    @tauiin Před měsícem

    Entirely unrelated, but what was the theme you had in your vim9script to lua transpiler video? it was really nice

    • @teej_dv
      @teej_dv  Před měsícem

      It should be basically the same theme but probably different background color - i changed to a darker background awhile ago

  • @neovimnewb
    @neovimnewb Před měsícem

    Awesome video! The gx command (to open links in the browser for example) doesn't work when I use oil.nvim (there is a closed issue on that though :/). Any workarounds? Thanks

  • @jacderida
    @jacderida Před měsícem

    It's an amazing plugin! It's even replacing vifm for me. The *only* weakness I found is that I can't see the file attributes to check last modified date. Most of the time I don't need that, but I was using it in a directory where I needed to see which copy of a file was the most recently modified, so that I could delete the others. As far as I can tell, you can't get the attributes. Shame.

  • @edwardminnix7438
    @edwardminnix7438 Před měsícem +2

    So it’s like Emacs’s dired?

  • @SiddharthPant
    @SiddharthPant Před měsícem

    After using oil other file managers feel claustrophobic. As working on DevOps tasks there are lots of yamls and dirs I have to create where I don't need a file tree but need a good dir manager. Oil fits that purpose perfectly.

  • @frederickmichaud6783
    @frederickmichaud6783 Před měsícem

    Cool plug-in. Can it work on permissions?for example, make a file executable chmod +x?

    • @mjaysmileofficial
      @mjaysmileofficial Před měsícem +1

      oil has a very handy way of extending its capabilities, for example, there is no built-in keymap to open something using xdg-open, but I added it with a few lines and it just works

    • @teej_dv
      @teej_dv  Před měsícem

      ya, I think it would be possible to do quite easily

    • @nasso_
      @nasso_ Před měsícem

      im assuming u could recreate vinegar's . (dot) command that enters command mode with the name of the file at the end of the command so u can do .!chmod +x
      i think you probably dont want to remap . directly though to keep the default behaviour of repeating the last action. but maybe something like .

  • @iamreinder
    @iamreinder Před měsícem

    Until you run into random Neovim crashes when trying to create a file or a directory. I really liked oil.nvim but the random crashes got more and more. Even on a fresh config. And the creator can’t seem to reproduce it. I switched to Mini.files that has the same functionality but uses more like a ranger type layout as an overlay instead of a new buffer. It works really well.

  • @ficolas2
    @ficolas2 Před měsícem

    I really like the idea of editing files with oil, however I feel like I need a tree.
    Currently I use nvim-tree, never use it on the side, only like netwr, fullscreen, but I can also :Oil to edit the directory with oil.
    Imo it would be awesome if oil had a tree

    • @billeterk
      @billeterk Před měsícem

      Tea tree oil

    • @ficolas2
      @ficolas2 Před měsícem

      @@billeterk I think Olive would be a sick name for a plugin like that
      I thought about making it myself, and then saw how big Oil.nvim source is for s plugin that relatively simple, and I don't think I will.

  • @casraf
    @casraf Před měsícem +2

    Absolutely love oil.nvim

  • @Twixmonster2
    @Twixmonster2 Před měsícem +2

    Is this the same as dired in emacs?

  • @Luclecool123
    @Luclecool123 Před měsícem +1

    Me when I have been using VIFM for years...

  • @emiliano19746
    @emiliano19746 Před měsícem

    I prefer floating telescope-file-browser but oil is really good, nonetheless

  • @mohitkumar-jv2bx
    @mohitkumar-jv2bx Před měsícem +1

    This looks really coool. but for my most used operations, adding/renaming/deleting files and directories, NvimTree is more than enough.
    But really cool that Oil treats the "Directory View" as a text buffer, just like i treat my whole life as a text buffer.

    • @yochem9294
      @yochem9294 Před měsícem +1

      > just like i treat my whole life as a text buffer.
      Saying this is the most Vim thing ever, definitely gonna steal it 😂

    • @mohitkumar-jv2bx
      @mohitkumar-jv2bx Před měsícem

      @@yochem9294 steal away my friend. Spread the word 😂😂

  • @s-xatya5088
    @s-xatya5088 Před měsícem

    Is there any plugins that allow to move/rename file then it will automatic update the import path code?

  • @elliotalderson6609
    @elliotalderson6609 Před měsícem

    I started using nvim tree or smth like that just to modify and see structure of a filesystem with hints about git and lsp. Everything else telescope handles better IMO

  • @Denis-ez8gd
    @Denis-ez8gd Před měsícem

    How did you add `example-` prefix to all file names that fast?

  • @jerrygreenest
    @jerrygreenest Před měsícem

    3:57 it's so weird to see multi-cursor without actually multi-cursors and it's just applied after the fact. Still powerful tool though

  • @FlyingCable98
    @FlyingCable98 Před měsícem

    I used this a while ago but it would leave hidden .oil files/directories all over the place and I couldn't work out why. I use mini.files now

    • @teej_dv
      @teej_dv  Před měsícem +1

      I really like the mini plugins, I will check out files

  • @SPYFFzero
    @SPYFFzero Před měsícem

    What happens inside a git repo? Normally mv means delete+new file, not the same as git mv

    • @RegrinderAlert
      @RegrinderAlert Před měsícem +1

      Git mv does the exact same thing but also the staging (git add) for convenience. So indistinguishable results.

  • @cpakkala
    @cpakkala Před měsícem +2

    So it's like "dired" for emacs, only not as evolved.

  • @SyedMSawaid
    @SyedMSawaid Před měsícem

    Is that what they mean by oiling up?

  • @no_name4796
    @no_name4796 Před měsícem +2

    Personally for everything outside editing text, i just use the terminal.
    Want to move into directories? Zoxide
    Want to list files? lsd
    Want to list files in a cool way? lsd --tree
    Want to do crazy stuff? There are tons of utils to do whatever you want.
    In neovim i like to just have a single window open and i just move around buffers with :bn / :bp or with lsp keybindings

    • @Argletrough
      @Argletrough Před měsícem

      have you tried using :b to select buffers by name?

  • @TehKarmalizer
    @TehKarmalizer Před měsícem

    I have a list of plugins to add and play with, but no chat pressure to rewrite my config.

  • @ambuj.k
    @ambuj.k Před měsícem

    I need lotion.nvim for my arch bros.

  • @arjunsahlot
    @arjunsahlot Před měsícem

    I think instead of :e! you should be able to just press u to get the original directory back

  • @akshettrj
    @akshettrj Před měsícem

    Lessgo

  • @guillemgarcia3630
    @guillemgarcia3630 Před měsícem

    I can finally move off nvim-tree!

  • @quieneemi
    @quieneemi Před měsícem

    three videos in a row?! Additions? Oil?? Watch now

    • @teej_dv
      @teej_dv  Před měsícem +2

      (don't tell anyone but two more still coming this week)

  • @ArtMoskvin
    @ArtMoskvin Před měsícem

    How did you rename all other files 4:00? It could be done using :normal but I can't see you typing it.

    • @luckyLaserface
      @luckyLaserface Před měsícem

      I think he did ctrl-v for blockwise visual mode and then GIexample-

  • @rib9985
    @rib9985 Před měsícem

    So basically nvimtree but in buffer with command access?

  • @oliverfoxi
    @oliverfoxi Před měsícem

    I use filetree mainly to put my code in the centre of the screen)

  • @superstayup
    @superstayup Před měsícem

    Also, oil is superior to dired's C-x C-q (Editable Dired) because Neovim is superior to Emacs. Based and nvimpilled!

    • @teej_dv
      @teej_dv  Před měsícem

      very big brain argument

  • @edwinnnn7782
    @edwinnnn7782 Před měsícem

    How did you do that example thing in 3:59

    • @luckyLaserface
      @luckyLaserface Před měsícem +1

      I think he did ctrl-v for blockwise visual mode and then GIexample-

    • @edwinnnn7782
      @edwinnnn7782 Před měsícem +1

      @@luckyLaserface thanks, I think I learn something new from neovim everyday lol