1
0
Fork 0

nvim: update oil

This commit is contained in:
Vladimír Dudr 2024-01-22 12:03:02 +01:00
parent 6221b40791
commit d765cbbd60
2 changed files with 146 additions and 146 deletions

View file

@ -0,0 +1 @@
autocmd BufRead,BufNewFile *.env set ft=env

View file

@ -1,11 +1,10 @@
return { 'stevearc/oil.nvim', return {
dependencies = { 'stevearc/oil.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended dependencies = { 'nvim-tree/nvim-web-devicons' },
},
keys = {
{ '<Leader>fr', ":Oil<CR>" }
},
lazy = false, lazy = false,
keys = {
{ '<Leader>fr', ':Oil<CR>' },
},
opts = { opts = {
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
-- Set to false if you still want to use netrw. -- Set to false if you still want to use netrw.
@ -13,7 +12,7 @@ return { 'stevearc/oil.nvim',
-- Id is automatically added at the beginning, and name at the end -- Id is automatically added at the beginning, and name at the end
-- See :help oil-columns -- See :help oil-columns
columns = { columns = {
"icon", 'icon',
-- "permissions", -- "permissions",
-- "size", -- "size",
-- "mtime", -- "mtime",
@ -21,18 +20,18 @@ return { 'stevearc/oil.nvim',
-- Buffer-local options to use for oil buffers -- Buffer-local options to use for oil buffers
buf_options = { buf_options = {
buflisted = false, buflisted = false,
bufhidden = "hide", bufhidden = 'hide',
}, },
-- Window-local options to use for oil buffers -- Window-local options to use for oil buffers
win_options = { win_options = {
wrap = false, wrap = false,
signcolumn = "no", signcolumn = 'no',
cursorcolumn = false, cursorcolumn = false,
foldcolumn = "0", foldcolumn = '0',
spell = false, spell = false,
list = false, list = false,
conceallevel = 3, conceallevel = 3,
concealcursor = "nvic", concealcursor = 'nvic',
}, },
-- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
delete_to_trash = false, delete_to_trash = false,
@ -49,7 +48,7 @@ return { 'stevearc/oil.nvim',
lsp_rename_autosave = false, lsp_rename_autosave = false,
-- Constrain the cursor to the editable parts of the oil buffer -- Constrain the cursor to the editable parts of the oil buffer
-- Set to `false` to disable, or "name" to keep it on the file names -- Set to `false` to disable, or "name" to keep it on the file names
constrain_cursor = "editable", constrain_cursor = 'editable',
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" }) -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
-- Additionally, if it is a string that matches "actions.<name>", -- Additionally, if it is a string that matches "actions.<name>",
@ -57,22 +56,23 @@ return { 'stevearc/oil.nvim',
-- Set to `false` to remove a keymap -- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions -- See :help oil-actions for a list of all available actions
keymaps = { keymaps = {
["g?"] = "actions.show_help", ['g?'] = 'actions.show_help',
["<CR>"] = "actions.select", ['<CR>'] = 'actions.select',
["<C-s>"] = "actions.select_vsplit", ['<C-s>'] = 'actions.select_vsplit',
["<C-h>"] = "actions.select_split", ['<C-h>'] = 'actions.select_split',
["<C-t>"] = "actions.select_tab", ['<C-t>'] = 'actions.select_tab',
["<C-p>"] = "actions.preview", ['<C-p>'] = 'actions.preview',
["<C-c>"] = "actions.close", ['<C-c>'] = 'actions.close',
["<C-l>"] = "actions.refresh", ['<C-t>'] = 'actions.open_terminal',
["-"] = "actions.parent", ['q'] = 'actions.close',
["_"] = "actions.open_cwd", ['<C-l>'] = 'actions.refresh',
["`"] = "actions.cd", ['-'] = 'actions.parent',
["~"] = "actions.tcd", ['_'] = 'actions.open_cwd',
["gs"] = "actions.change_sort", ['`'] = 'actions.cd',
["gx"] = "actions.open_external", ['~'] = 'actions.tcd',
["g."] = "actions.toggle_hidden", ['gs'] = 'actions.change_sort',
["g\\"] = "actions.toggle_trash", ['gx'] = 'actions.open_external',
['g.'] = 'actions.toggle_hidden',
}, },
-- Set to false to disable all of the above keymaps -- Set to false to disable all of the above keymaps
use_default_keymaps = true, use_default_keymaps = true,
@ -81,7 +81,7 @@ return { 'stevearc/oil.nvim',
show_hidden = true, show_hidden = true,
-- This function defines what is considered a "hidden" file -- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr) is_hidden_file = function(name, bufnr)
return vim.startswith(name, ".") return vim.startswith(name, '.')
end, end,
-- This function defines what will never be shown, even when `show_hidden` is set -- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr) is_always_hidden = function(name, bufnr)
@ -90,8 +90,8 @@ return { 'stevearc/oil.nvim',
sort = { sort = {
-- sort order can be "asc" or "desc" -- sort order can be "asc" or "desc"
-- see :help oil-columns to see which columns are sortable -- see :help oil-columns to see which columns are sortable
{ "type", "asc" }, { 'type', 'asc' },
{ "name", "asc" }, { 'name', 'asc' },
}, },
}, },
-- Configuration for the floating window in oil.open_float -- Configuration for the floating window in oil.open_float
@ -100,7 +100,7 @@ return { 'stevearc/oil.nvim',
padding = 2, padding = 2,
max_width = 0, max_width = 0,
max_height = 0, max_height = 0,
border = "rounded", border = 'rounded',
win_options = { win_options = {
winblend = 0, winblend = 0,
}, },
@ -128,7 +128,7 @@ return { 'stevearc/oil.nvim',
min_height = { 5, 0.1 }, min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window -- optionally define an integer/float for the exact height of the preview window
height = nil, height = nil,
border = "rounded", border = 'rounded',
win_options = { win_options = {
winblend = 0, winblend = 0,
}, },
@ -143,12 +143,11 @@ return { 'stevearc/oil.nvim',
max_height = { 10, 0.9 }, max_height = { 10, 0.9 },
min_height = { 5, 0.1 }, min_height = { 5, 0.1 },
height = nil, height = nil,
border = "rounded", border = 'rounded',
minimized_border = "none", minimized_border = 'none',
win_options = { win_options = {
winblend = 0, winblend = 0,
}, },
}, },
} },
} }