You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.0 KiB

1 year ago
1 year ago
1 year ago
  1. return {
  2. "stevearc/oil.nvim",
  3. opts = {},
  4. commit = '18272aba9d00a3176a5443d50dbb4464acc167bd',
  5. -- Optional dependencies
  6. dependencies = { "nvim-tree/nvim-web-devicons" },
  7. config = function()
  8. require("oil").setup({
  9. default_file_explorer = true,
  10. buf_options = {
  11. buflisted = false,
  12. bufhidden = "hide",
  13. },
  14. win_options = {
  15. wrap = false,
  16. signcolumn = "no",
  17. cursorcolumn = false,
  18. foldcolumn = "0",
  19. spell = false,
  20. list = false,
  21. conceallevel = 3,
  22. concealcursor = "nvic",
  23. },
  24. delete_to_trash = false,
  25. skip_confirm_for_simple_edits = false,
  26. prompt_save_on_select_new_entry = true,
  27. cleanup_delay_ms = 2000,
  28. keymaps = {
  29. ["g?"] = "actions.show_help",
  30. ["<CR>"] = "actions.select",
  31. ["<C-s>"] = "actions.select_vsplit",
  32. ["<C-h>"] = false,
  33. ["<C-t>"] = "actions.select_tab",
  34. ["<C-v>"] = "actions.preview",
  35. ["<C-c>"] = "actions.close",
  36. ["<C-l>"] = false,
  37. ["-"] = "actions.parent",
  38. ["_"] = "actions.open_cwd",
  39. ["`"] = "actions.cd",
  40. ["~"] = "actions.tcd",
  41. ["gs"] = "actions.change_sort",
  42. ["gx"] = "actions.open_external",
  43. ["g."] = "actions.toggle_hidden",
  44. },
  45. use_default_keymaps = false,
  46. view_options = {
  47. show_hidden = true,
  48. is_hidden_file = function(name, bufnr)
  49. return vim.startswith(name, ".")
  50. end,
  51. is_always_hidden = function(name, bufnr)
  52. return false
  53. end,
  54. sort = {
  55. { "type", "asc" },
  56. { "name", "asc" },
  57. },
  58. },
  59. preview = {
  60. max_width = 0.9,
  61. min_width = { 40, 0.4 },
  62. width = nil,
  63. max_height = 0.9,
  64. min_height = { 5, 0.1 },
  65. height = nil,
  66. border = "rounded",
  67. win_options = {
  68. winblend = 0,
  69. },
  70. },
  71. progress = {
  72. max_width = 0.9,
  73. min_width = { 40, 0.4 },
  74. width = nil,
  75. max_height = { 10, 0.9 },
  76. min_height = { 5, 0.1 },
  77. height = nil,
  78. border = "rounded",
  79. minimized_border = "none",
  80. win_options = {
  81. winblend = 0,
  82. },
  83. },
  84. })
  85. vim.keymap.set("n", "-", function()
  86. vim.cmd("Oil")
  87. end, { desc = "Open parent directory" })
  88. end,
  89. }