mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 11:40:36 +00:00
feat(gitignore.lua): add Lua script to generate .gitignore file using gitignore.nvim plugin chore(lsp-config.lua): comment out configuration for pyright server feat(poet-v.lua): add poet-v plugin for managing Python virtual environments
27 lines
520 B
Lua
27 lines
520 B
Lua
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
|
|
|
|
-- Keymaps
|
|
|
|
local opts = { noremap = true, silent = true }
|
|
|
|
opts.desc = "Generate .gitignore"
|
|
|
|
vim.keymap.set("n", "<leader>gi", function()
|
|
local path = GetProjectRoot()
|
|
|
|
gitignore.generate(path)
|
|
end, opts)
|
|
|
|
-- Global Settings
|
|
|
|
vim.g.gitignore_nvim_overwrite = true
|