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.

89 lines
2.0 KiB

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