Skip to content

Commit

Permalink
add oil.nvim to neovim plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertMenke committed Dec 18, 2024
1 parent 2639d19 commit f20d37f
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/dotfiles.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/git_toolbox_blame.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nvim/lua/my/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ require('lazy').setup {
require 'my.plugins.fidget',
require 'my.plugins.languages.neodev',
require 'my.plugins.diffview',
require 'my.plugins.oil',
-- require 'my.airblade.vim-rooter',
-- Language-specific plugins
-- Rust:
Expand Down
41 changes: 41 additions & 0 deletions nvim/lua/my/plugins/oil.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
return {
{
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
CustomOilBar = function()
local path = vim.fn.expand "%"
path = path:gsub("oil://", "")

return " " .. vim.fn.fnamemodify(path, ":.")
end

require("oil").setup {
columns = { "icon" },
keymaps = {
["<C-h>"] = false,
["<C-l>"] = false,
["<C-k>"] = false,
["<C-j>"] = false,
["<M-h>"] = "actions.select_split",
},
win_options = {
winbar = "%{v:lua.CustomOilBar()}",
},
view_options = {
show_hidden = true,
is_always_hidden = function(name, _)
local folder_skip = { "dev-tools.locks", "dune.lock", "_build" }
return vim.tbl_contains(folder_skip, name)
end,
},
}

-- Open parent directory in current window
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })

-- Open parent directory in floating window
vim.keymap.set("n", "<space>-", require("oil").toggle_float)
end,
},
}

0 comments on commit f20d37f

Please sign in to comment.