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.

105 lines
3.3 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months 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. -- columns = {
  10. -- "icon",
  11. -- "permissions",
  12. -- "size",
  13. -- "mtime",
  14. -- },
  15. buf_options = {
  16. buflisted = false,
  17. bufhidden = "hide",
  18. },
  19. win_options = {
  20. wrap = false,
  21. signcolumn = "no",
  22. cursorcolumn = false,
  23. foldcolumn = "0",
  24. spell = false,
  25. list = false,
  26. conceallevel = 3,
  27. concealcursor = "nvic",
  28. },
  29. delete_to_trash = false,
  30. skip_confirm_for_simple_edits = false,
  31. prompt_save_on_select_new_entry = true,
  32. cleanup_delay_ms = 2000,
  33. keymaps = {
  34. ["g?"] = "actions.show_help",
  35. ["<CR>"] = "actions.select",
  36. ["<C-s>"] = "actions.select_vsplit",
  37. ["<C-h>"] = false,
  38. ["<C-t>"] = "actions.select_tab",
  39. ["<C-v>"] = "actions.preview",
  40. ["<C-c>"] = "actions.close",
  41. ["<C-l>"] = false,
  42. ["-"] = "actions.parent",
  43. ["_"] = "actions.open_cwd",
  44. ["`"] = "actions.cd",
  45. ["~"] = "actions.tcd",
  46. ["gs"] = "actions.change_sort",
  47. ["gx"] = "actions.open_external",
  48. ["g."] = "actions.toggle_hidden",
  49. },
  50. use_default_keymaps = false,
  51. view_options = {
  52. show_hidden = true,
  53. is_hidden_file = function(name, bufnr)
  54. return vim.startswith(name, ".")
  55. end,
  56. is_always_hidden = function(name, bufnr)
  57. return false
  58. end,
  59. sort = {
  60. { "type", "asc" },
  61. { "name", "asc" },
  62. },
  63. },
  64. float = {
  65. padding = 2,
  66. max_width = 0,
  67. max_height = 0,
  68. border = "rounded",
  69. win_options = {
  70. winblend = 0,
  71. },
  72. override = function(conf)
  73. return conf
  74. end,
  75. },
  76. preview = {
  77. max_width = 0.9,
  78. min_width = { 40, 0.4 },
  79. width = nil,
  80. max_height = 0.9,
  81. min_height = { 5, 0.1 },
  82. height = nil,
  83. border = "rounded",
  84. win_options = {
  85. winblend = 0,
  86. },
  87. },
  88. progress = {
  89. max_width = 0.9,
  90. min_width = { 40, 0.4 },
  91. width = nil,
  92. max_height = { 10, 0.9 },
  93. min_height = { 5, 0.1 },
  94. height = nil,
  95. border = "rounded",
  96. minimized_border = "none",
  97. win_options = {
  98. winblend = 0,
  99. },
  100. },
  101. })
  102. vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
  103. end
  104. }