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',
|
'gzip',
|
||||||
'logipat',
|
'logipat',
|
||||||
'matchit',
|
'matchit',
|
||||||
-- "netrw",
|
'netrw',
|
||||||
'netrwFileHandlers',
|
'netrwFileHandlers',
|
||||||
'loaded_remote_plugins',
|
'loaded_remote_plugins',
|
||||||
'loaded_tutor_mode_plugin',
|
'loaded_tutor_mode_plugin',
|
||||||
-- "netrwPlugin",
|
'netrwPlugin',
|
||||||
-- "netrwSettings",
|
'netrwSettings',
|
||||||
'rrhelper',
|
'rrhelper',
|
||||||
'spellfile_plugin',
|
'spellfile_plugin',
|
||||||
'tar',
|
'tar',
|
||||||
|
|
@ -139,3 +139,12 @@ opt.formatoptions = opt.formatoptions
|
||||||
+ 'j' -- Auto-remove comments if possible.
|
+ 'j' -- Auto-remove comments if possible.
|
||||||
- '2' -- I'm not in gradeschool anymore
|
- '2' -- I'm not in gradeschool anymore
|
||||||
opt.iskeyword:append('_')
|
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 {
|
return {
|
||||||
'stevearc/oil.nvim',
|
'stevearc/oil.nvim',
|
||||||
lazy = true,
|
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>e', '<CMD>Oil<CR>', desc = 'Open parent directory' },
|
{ '<leader>e', '<CMD>Oil<CR>', desc = 'Open parent directory' },
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue