feat: open oil.nvim instead of netrw when starting nvim from a directory
This commit is contained in:
parent
214cf0ebdc
commit
30587406dd
2 changed files with 12 additions and 4 deletions
|
|
@ -91,12 +91,12 @@ local disabled_built_ins = {
|
|||
'gzip',
|
||||
'logipat',
|
||||
'matchit',
|
||||
-- "netrw",
|
||||
'netrw',
|
||||
'netrwFileHandlers',
|
||||
'loaded_remote_plugins',
|
||||
'loaded_tutor_mode_plugin',
|
||||
-- "netrwPlugin",
|
||||
-- "netrwSettings",
|
||||
'netrwPlugin',
|
||||
'netrwSettings',
|
||||
'rrhelper',
|
||||
'spellfile_plugin',
|
||||
'tar',
|
||||
|
|
@ -139,3 +139,12 @@ opt.formatoptions = opt.formatoptions
|
|||
+ 'j' -- Auto-remove comments if possible.
|
||||
- '2' -- I'm not in gradeschool anymore
|
||||
opt.iskeyword:append('_')
|
||||
|
||||
-- Open oil.nvim when opening a directory
|
||||
vim.api.nvim_create_autocmd('VimEnter', {
|
||||
callback = function()
|
||||
if vim.fn.isdirectory(vim.fn.expand('%:p')) == 1 then
|
||||
require('oil').open(vim.fn.expand('%:p'))
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
return {
|
||||
'stevearc/oil.nvim',
|
||||
lazy = true,
|
||||
keys = {
|
||||
{ '<leader>e', '<CMD>Oil<CR>', desc = 'Open parent directory' },
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue