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