feat: config option to disable directory hijacking (#76)
This commit is contained in:
parent
57451c517d
commit
3d3df74532
4 changed files with 9 additions and 0 deletions
|
|
@ -132,6 +132,8 @@ require("oil").setup({
|
||||||
conceallevel = 3,
|
conceallevel = 3,
|
||||||
concealcursor = "n",
|
concealcursor = "n",
|
||||||
},
|
},
|
||||||
|
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
|
||||||
|
default_file_explorer = true,
|
||||||
-- Restore window options to previous values when leaving an oil buffer
|
-- Restore window options to previous values when leaving an oil buffer
|
||||||
restore_win_options = true,
|
restore_win_options = true,
|
||||||
-- Skip the confirmation popup for simple operations
|
-- Skip the confirmation popup for simple operations
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ OPTIONS *oil-option
|
||||||
conceallevel = 3,
|
conceallevel = 3,
|
||||||
concealcursor = "n",
|
concealcursor = "n",
|
||||||
},
|
},
|
||||||
|
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
|
||||||
|
default_file_explorer = true,
|
||||||
-- Restore window options to previous values when leaving an oil buffer
|
-- Restore window options to previous values when leaving an oil buffer
|
||||||
restore_win_options = true,
|
restore_win_options = true,
|
||||||
-- Skip the confirmation popup for simple operations
|
-- Skip the confirmation popup for simple operations
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ local default_config = {
|
||||||
conceallevel = 3,
|
conceallevel = 3,
|
||||||
concealcursor = "n",
|
concealcursor = "n",
|
||||||
},
|
},
|
||||||
|
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
|
||||||
|
default_file_explorer = true,
|
||||||
-- Restore window options to previous values when leaving an oil buffer
|
-- Restore window options to previous values when leaving an oil buffer
|
||||||
restore_win_options = true,
|
restore_win_options = true,
|
||||||
-- Skip the confirmation popup for simple operations
|
-- Skip the confirmation popup for simple operations
|
||||||
|
|
|
||||||
|
|
@ -459,6 +459,9 @@ end
|
||||||
local function maybe_hijack_directory_buffer(bufnr)
|
local function maybe_hijack_directory_buffer(bufnr)
|
||||||
local config = require("oil.config")
|
local config = require("oil.config")
|
||||||
local util = require("oil.util")
|
local util = require("oil.util")
|
||||||
|
if not config.default_file_explorer then
|
||||||
|
return
|
||||||
|
end
|
||||||
local bufname = vim.api.nvim_buf_get_name(bufnr)
|
local bufname = vim.api.nvim_buf_get_name(bufnr)
|
||||||
if bufname == "" then
|
if bufname == "" then
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue