Oil.nvim - My Favorite Addition to my Neovim Config
Ғылым және технология
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
Пікірлер: 171
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
Ай бұрын
What a pity we can't move file by appending 'other_dir/' to it's name. Is this related with plugin's philosophy?
Loving these videos breaking down your config! Thanks teej, keep 'em coming!
@teej_dv
Ай бұрын
two more coming this week :)
@lpanebr
Ай бұрын
Me too!
Saying what command you ran ("dt.") is freaking gold for anyone that isn't yet a vimzard. Cheers for the content!
@nemethda
Ай бұрын
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
Ай бұрын
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
Ай бұрын
@@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
Ай бұрын
Oh wow. That is great. I always used ci( or ci[.
Big fan of Oil, editing your project files as a buffer feels really intuitive compared to other file exploring alternatives in nvim
oil's SSH feature is really nice for viewing/editing files on remote machines in a pinch
Your daily uploads are awesome. Keep the fire going
This is my favorite way to explore new plugins! Thank you teej!
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
Ай бұрын
nice!
@dakata2416
Ай бұрын
@@teej_dvthese types of videos where you show an interesting plugin are very useful! Keep it up TJ!
Loving these smaller videos showcasing plugins TJ!!! Keep them coming please!
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
Ай бұрын
Love the mini plugins, will check that one out.
Hey teej, I really enjoy these plugin videos!
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
Ай бұрын
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
Ай бұрын
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
Ай бұрын
@@casraf you can enter a new directory before you :w to create it :)
@casraf
Ай бұрын
@@stevearc is that so? I'll try! Maybe I thought I did but didn't
@mzzzchael
Ай бұрын
haha i actually ran into that issue before, lost some files. when i tried to paste and save it said those were invalid files 😢
I wish I knew this existed before today! Fits perfectly with my workflow.
Thanks for the video helped me set it up, that shortcut was genius.
Oil is da 💣. Great video!
love this series!
Teej you're a great explainer!
OMG, I was looking for the Ctrl+v thingy for ages, thanks!
My favorite plugin ever
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.
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!
Very awesome, thanks for sharing
Great video! Thanks a lot!
I need more of this type of videos
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
Oil is amazing, been using it for a long time
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!
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
I love that you can duplicate the line and it will create a copy of the file! I use that a lot.
Great video, keeping learning small details almost every time, was unaware of 'e!', and oil.nvim looks handy
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.
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.
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.
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 👌
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).
love it
thanks TJ
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!
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
Oiled up nvim 😈
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.
Oil is really cool, I've been using it for a while now. Way better than file tree for sure
Oil is life.
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.
Okay, just ditched nnn for this. Just feels awesome.
Agreed! You have to convince Prime too! :D
@lpanebr
Ай бұрын
It'll be a hard pitch! Maybe if they change the name to coconut-oil though...
Yesss! Welcome to the oil.nvim hype train!
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
Ай бұрын
I was just thinking this would work well with a terminal based file manager. Care to share your setup?
@oalfodr
Ай бұрын
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
I've used the ranger file manager's `:bulkrename` command for similar stuff in the past.
NOICE!
So it’s like Emacs’s dired?
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.
Hey fam, great content, one question though - why are you wearing headphones while recording YT videos?
*laughs in dired*
@samgould8567
Ай бұрын
Guffaws in Dirvish
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
Oil was what I wanted for so long. VSC*de in shambles after this video dropped.
@vsz-z2428
Ай бұрын
vsc*de was in shambles before this video
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
Loving oil, but need a command to quickly open directories within the oil buffer to move files over "greater distances".
Could you please do a video on how you manage project scooped neovim configurations?
I like to open a split and move files from one place to another. Can be in 2 places at one time.
oil nvim is the best :)
Looks cool! How did you do the "multi-cursor" edit of all file names at 3:58?
@teej_dv
Ай бұрын
that's "visual block" mode - press ctrl-v and do some movements, then "i" to insert some text. it's builtin!
@oliverfoxi
Ай бұрын
@@teej_dv do you mean "". Cause "i" is used for "select in something" feature
@teej_dv
Ай бұрын
sorry, ya, was typing on mobile haha
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
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!
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?
Time to get oiled.
Entirely unrelated, but what was the theme you had in your vim9script to lua transpiler video? it was really nice
@teej_dv
Ай бұрын
It should be basically the same theme but probably different background color - i changed to a darker background awhile ago
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.
This is basically emacs' directory editor Dired
Imo oil.nvim is what neovims native file explorer should be.
How did you add `example-` prefix to all file names that fast?
Is this the same as dired in emacs?
@defnlife1683
Ай бұрын
Cannot unsee.
Absolutely love oil.nvim
@teej_dv
Ай бұрын
same :)
Is there any plugins that allow to move/rename file then it will automatic update the import path code?
Cool plug-in. Can it work on permissions?for example, make a file executable chmod +x?
@mjaysmileofficial
Ай бұрын
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
Ай бұрын
ya, I think it would be possible to do quite easily
@nasso_
Ай бұрын
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 .
So it's like "dired" for emacs, only not as evolved.
Lessgo
@teej_dv
Ай бұрын
MORE GO
@nasso_
Ай бұрын
batgo btw
Is that what they mean by oiling up?
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.
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.
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.
Me when I have been using VIFM for years...
I prefer floating telescope-file-browser but oil is really good, nonetheless
So basically nvimtree but in buffer with command access?
What happens inside a git repo? Normally mv means delete+new file, not the same as git mv
@RegrinderAlert
Ай бұрын
Git mv does the exact same thing but also the staging (git add) for convenience. So indistinguishable results.
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
Ай бұрын
Tea tree oil
@ficolas2
Ай бұрын
@@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.
how did you add "example" to every file like that?
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
Ай бұрын
have you tried using :b to select buffers by name?
How did you rename all other files 4:00? It could be done using :normal but I can't see you typing it.
@luckyLaserface
Ай бұрын
I think he did ctrl-v for blockwise visual mode and then GIexample-
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
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
Ай бұрын
I really like the mini plugins, I will check out files
I have a list of plugins to add and play with, but no chat pressure to rewrite my config.
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
Ай бұрын
> 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
Ай бұрын
@@yochem9294 steal away my friend. Spread the word 😂😂
Can oil move files between folders?
@vsz-z2428
Ай бұрын
yea!
I can finally move off nvim-tree!
How did you do that example thing in 3:59
@luckyLaserface
Ай бұрын
I think he did ctrl-v for blockwise visual mode and then GIexample-
@edwinnnn7782
Ай бұрын
@@luckyLaserface thanks, I think I learn something new from neovim everyday lol
I need lotion.nvim for my arch bros.
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
three videos in a row?! Additions? Oil?? Watch now
@teej_dv
Ай бұрын
(don't tell anyone but two more still coming this week)
I think instead of :e! you should be able to just press u to get the original directory back