mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 19:50:38 +00:00
refactor(gitignore.lua): replace GetProjectRoot function with require statement for
absolute.utils.get-git-root module to improve code organization and readability feat(gitignore.lua): update keymap description to include GitIgnore prefix for clarity and consistency with functionality provided by the keymap
This commit is contained in:
@@ -1,19 +1,11 @@
|
||||
local gitignore = require("gitignore")
|
||||
|
||||
function GetProjectRoot()
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if git_root == nil then
|
||||
return vim.fn.getcwd()
|
||||
else
|
||||
return git_root
|
||||
end
|
||||
end
|
||||
local GetProjectRoot = require("absolute.utils.get-git-root")
|
||||
|
||||
-- Keymaps
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
opts.desc = "Generate .gitignore"
|
||||
opts.desc = "GitIgnore: Generate .gitignore"
|
||||
|
||||
vim.keymap.set("n", "<leader>gi", function()
|
||||
local path = GetProjectRoot()
|
||||
|
||||
Reference in New Issue
Block a user