mirror of
https://github.com/harivansh-afk/nvim.git
synced 2026-04-15 14:03:51 +00:00
clean config
This commit is contained in:
parent
1db6db7f92
commit
25aded9685
19 changed files with 468 additions and 852 deletions
|
|
@ -1,44 +1,40 @@
|
|||
return {
|
||||
"stevearc/oil.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", "malewicz1337/oil-git.nvim" },
|
||||
cmd = "Oil",
|
||||
event = 'VeryLazy',
|
||||
keys = {
|
||||
{ "-", "<cmd>Oil<cr>", desc = "Open parent directory" },
|
||||
{ "<leader>e", "<cmd>Oil<cr>", desc = "Open file explorer" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("oil").setup(opts)
|
||||
require("oil-git").setup({
|
||||
show_ignored_files = false,
|
||||
show_ignored_directories = false,
|
||||
debounce_ms = 300,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
pattern = "oil://*",
|
||||
callback = function()
|
||||
local dir = require("oil").get_current_dir()
|
||||
if dir then
|
||||
vim.cmd.lcd(dir)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
default_file_explorer = true, -- nvim . opens oil
|
||||
columns = { "icon" },
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
'stevearc/oil.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons', 'malewicz1337/oil-git.nvim' },
|
||||
config = function(_, opts)
|
||||
require('oil').setup(opts)
|
||||
require('oil-git').setup({
|
||||
show_ignored_files = false,
|
||||
show_ignored_directories = false,
|
||||
debounce_ms = 300,
|
||||
})
|
||||
vim.api.nvim_create_autocmd('BufEnter', {
|
||||
callback = function()
|
||||
if vim.bo.filetype == '' then
|
||||
local path = vim.fn.expand('%:p')
|
||||
if vim.fn.isdirectory(path) == 1 then
|
||||
vim.cmd('Oil ' .. path)
|
||||
end
|
||||
end
|
||||
end,
|
||||
group = vim.api.nvim_create_augroup('AOil', { clear = true }),
|
||||
})
|
||||
map('n', '-', '<cmd>Oil<cr>')
|
||||
map('n', '<leader>e', '<cmd>Oil<cr>')
|
||||
end,
|
||||
opts = {
|
||||
default_file_explorer = true,
|
||||
columns = { 'icon' },
|
||||
view_options = { show_hidden = true },
|
||||
keymaps = {
|
||||
['g?'] = 'actions.show_help',
|
||||
['<CR>'] = 'actions.select',
|
||||
['<C-v>'] = 'actions.select_vsplit',
|
||||
['<C-x>'] = 'actions.select_split',
|
||||
['<C-p>'] = 'actions.preview',
|
||||
['<C-c>'] = 'actions.close',
|
||||
['-'] = 'actions.parent',
|
||||
['g.'] = 'actions.toggle_hidden',
|
||||
},
|
||||
},
|
||||
keymaps = {
|
||||
["g?"] = "actions.show_help",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-v>"] = "actions.select_vsplit",
|
||||
["<C-x>"] = "actions.select_split",
|
||||
["<C-p>"] = "actions.preview",
|
||||
["<C-c>"] = "actions.close",
|
||||
["-"] = "actions.parent",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue