summaryrefslogtreecommitdiffstats
path: root/plugin/50-dotfiles.lua
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-06-02 20:48:26 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-06-02 20:52:11 +0200
commit223ae1c75db0fe331eea8174bb549f540a2d257b (patch)
tree41071e812426793a6c0a43b742b96d34e7f4877d /plugin/50-dotfiles.lua
parent3bb05edd275a252113d0cf8cfd702007a054bc02 (diff)
downloadnvim-config-223ae1c75db0fe331eea8174bb549f540a2d257b.tar.gz
nvim-config-223ae1c75db0fe331eea8174bb549f540a2d257b.zip
misc(nvim): remove 50-dotfiles.lua
The `DotfilesOn` and `DotfilesOff` commands have been replaced with `dotfiles on|off`.
Diffstat (limited to 'plugin/50-dotfiles.lua')
-rw-r--r--plugin/50-dotfiles.lua49
1 files changed, 0 insertions, 49 deletions
diff --git a/plugin/50-dotfiles.lua b/plugin/50-dotfiles.lua
deleted file mode 100644
index fc48014..0000000
--- a/plugin/50-dotfiles.lua
+++ /dev/null
@@ -1,49 +0,0 @@
---
--- dotfiles plugin
---
-
--- Returns true if the current buffer is part of the Dotfiles repository
-local function detect_dotfiles_file()
- if vim.env.DOTFILES_DIR == nil then
- return false
- end
- local ret = vim.system(
- { "git", "--git-dir=" .. vim.env.DOTFILES_DIR, "--work-tree=" .. vim.env.HOME, "ls-files" },
- { text = true }
- ):wait()
- local buf_file_name = string.sub(vim.api.nvim_buf_get_name(0), #vim.env.HOME + 2)
- for _, dotfiles_filename in ipairs(vim.split(ret.stdout, "\n", { trimempty = true })) do
- if dotfiles_filename == buf_file_name then
- return true
- end
- end
- return false
-end
-
-vim.api.nvim_create_autocmd("BufEnter", {
- desc = "Detect dotfiles file",
- group = vim.g.dotfiles.augroup,
- callback = function()
- vim.b.dotfiles_file = detect_dotfiles_file()
- end,
-})
-
-local function check_gitgutter()
- if vim.g.gitgutter_enabled == 1 then
- return true
- end
- vim.notify("GitGutter is not enabled!", vim.log.levels.WARN)
- return false
-end
-
-vim.api.nvim_create_user_command("DotfilesOn", function()
- if check_gitgutter() then
- vim.g.gitgutter_git_args = "--git-dir=" .. vim.env.DOTFILES_DIR .. " --work-tree=" .. vim.env.HOME
- end
-end, { desc = "Activate dotfiles (set git env)" })
-
-vim.api.nvim_create_user_command("DotfilesOff", function()
- if check_gitgutter() then
- vim.g.gitgutter_git_args = ""
- end
-end, { desc = "Deactivate dotfiles (unset git env)" })