aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimen A. W. Olsen <hello@simenandre.no>2024-12-27 21:02:58 +0100
committerSimen A. W. Olsen <hello@simenandre.no>2024-12-27 21:02:58 +0100
commit807903b91c013b56e77f9f70758bd137e42cbb65 (patch)
tree35cb07e80feb7bcaaf1b9994bcbef6abcced4358
parent17a5f795123841fab25165c6916a287a8b68fc8f (diff)
downloadconfig.nvim-807903b91c013b56e77f9f70758bd137e42cbb65.tar.gz
config.nvim-807903b91c013b56e77f9f70758bd137e42cbb65.zip
update oil config and lock file
-rw-r--r--lazy-lock.json12
-rw-r--r--lua/simenandre/plugins/oil.lua97
2 files changed, 53 insertions, 56 deletions
diff --git a/lazy-lock.json b/lazy-lock.json
index ed66b45..7f22452 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -1,33 +1,31 @@
{
- "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
- "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
- "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
- "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
+ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
+ "blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" },
"conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" },
"copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" },
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
+ "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" },
"gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" },
"grug-far.nvim": { "branch": "main", "commit": "f47594f05d10b0bedfc0ed78e488e7fd714d57be" },
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
"lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" },
"lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" },
- "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.nvim": { "branch": "main", "commit": "e50cf9de614500a20e47cfc50e30a100042f91c3" },
- "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" },
"nvim-dap-go": { "branch": "main", "commit": "5511788255c92bdd845f8d9690f88e2e0f0ff9f2" },
"nvim-lspconfig": { "branch": "master", "commit": "46ce5fd8c081f179a509da423077f8372e63ffc4" },
"nvim-treesitter": { "branch": "master", "commit": "b7160e87aadbb3f5f6ee87ce139406fe3433044e" },
- "oil.nvim": { "branch": "master", "commit": "f60bb7f793477d99ef1acf39e920bf2ca4e644de" },
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "319c01b99b7a8c9ac2066bf0efd4d6ec68fef444" },
"tokyonight.nvim": { "branch": "main", "commit": "4b386e66a9599057587c30538d5e6192e3d1c181" },
+ "trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" },
"vim-sleuth": { "branch": "master", "commit": "cd9d382e33bb817abe7f10cdc3a606bf1d491d75" },
+ "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" },
"which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" }
}
diff --git a/lua/simenandre/plugins/oil.lua b/lua/simenandre/plugins/oil.lua
index dff5e1e..7b4ca42 100644
--- a/lua/simenandre/plugins/oil.lua
+++ b/lua/simenandre/plugins/oil.lua
@@ -1,58 +1,57 @@
--- helper function to parse output
-local function parse_output(proc)
- local result = proc:wait()
- local ret = {}
- if result.code == 0 then
- for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do
- -- Remove trailing slash
- line = line:gsub("/$", "")
- ret[line] = true
- end
- end
- return ret
-end
-
--- build git status cache
-local function new_git_status()
- return setmetatable({}, {
- __index = function(self, key)
- local ignore_proc = vim.system(
- { "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" },
- {
- cwd = key,
- text = true,
- }
- )
- local tracked_proc = vim.system({ "git", "ls-tree", "HEAD", "--name-only" }, {
- cwd = key,
- text = true,
- })
- local ret = {
- ignored = parse_output(ignore_proc),
- tracked = parse_output(tracked_proc),
- }
-
- rawset(self, key, ret)
- return ret
- end,
- })
-end
-local git_status = new_git_status()
-
--- Clear git status cache on refresh
-local refresh = require("oil.actions").refresh
-local orig_refresh = refresh.callback
-refresh.callback = function(...)
- git_status = new_git_status()
- orig_refresh(...)
-end
-
return {
"stevearc/oil.nvim",
opts = {},
-- Optional dependencies
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
+ -- helper function to parse output
+ local function parse_output(proc)
+ local result = proc:wait()
+ local ret = {}
+ if result.code == 0 then
+ for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do
+ -- Remove trailing slash
+ line = line:gsub("/$", "")
+ ret[line] = true
+ end
+ end
+ return ret
+ end
+
+ -- build git status cache
+ local function new_git_status()
+ return setmetatable({}, {
+ __index = function(self, key)
+ local ignore_proc = vim.system(
+ { "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" },
+ {
+ cwd = key,
+ text = true,
+ }
+ )
+ local tracked_proc = vim.system({ "git", "ls-tree", "HEAD", "--name-only" }, {
+ cwd = key,
+ text = true,
+ })
+ local ret = {
+ ignored = parse_output(ignore_proc),
+ tracked = parse_output(tracked_proc),
+ }
+
+ rawset(self, key, ret)
+ return ret
+ end,
+ })
+ end
+ local git_status = new_git_status()
+
+ -- Clear git status cache on refresh
+ local refresh = require("oil.actions").refresh
+ local orig_refresh = refresh.callback
+ refresh.callback = function(...)
+ git_status = new_git_status()
+ orig_refresh(...)
+ end
require("oil").setup({
columns = { "icon" },
keymaps = {