From 6aa492bca8b6cd1b1cf534507e1aea332be36641 Mon Sep 17 00:00:00 2001 From: David Ibia Date: Wed, 3 Jan 2024 01:44:36 +0100 Subject: [PATCH] chore(.gitignore): update .gitignore file to include Lua-related files and directories 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 --- .gitignore | 47 ++++++++++++++++++++++++++++++ lazy-lock.json | 3 +- lua/absolute/after/gitignore.lua | 26 +++++++++++++++++ lua/absolute/after/lsp-config.lua | 10 +++---- lua/absolute/after/poet-v.lua | 4 +++ lua/absolute/plugins/gitignore.lua | 9 ++++++ lua/absolute/plugins/poet-v.lua | 7 +++++ 7 files changed, 100 insertions(+), 6 deletions(-) create mode 100644 lua/absolute/after/gitignore.lua create mode 100644 lua/absolute/after/poet-v.lua create mode 100644 lua/absolute/plugins/gitignore.lua create mode 100644 lua/absolute/plugins/poet-v.lua diff --git a/.gitignore b/.gitignore index 4c49bd7..1a94c64 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,48 @@ +#--------------------------------------------------# +# The following was generated with gitignore.nvim: # +#--------------------------------------------------# +# Gitignore for the following technologies: Lua + +# Compiled Lua sources +luac.out + +# luarocks build files +*.src.rock +*.zip +*.tar.gz + +# Object files +*.o +*.os +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + + .env diff --git a/lazy-lock.json b/lazy-lock.json index 0f51f30..0b1d19b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -11,11 +11,11 @@ "dashboard-nvim": { "branch": "master", "commit": "63df28409d940f9cac0a925df09d3dc369db9841" }, "dressing.nvim": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" }, "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, + "gitignore.nvim": { "branch": "master", "commit": "e0e0c511595681ef826a91a9e8449e86049406a0" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lspkind.nvim": { "branch": "master", "commit": "7f26cf5e27e2bd910ce0ea00c514da2bf97423b8" }, "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, - "magma-nvim": { "branch": "main", "commit": "ff3deba8a879806a51c005e50782130246143d06" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "9e82ded0515186edd4f69e4ce6b1a5f1b55b47e9" }, "mason.nvim": { "branch": "main", "commit": "a09da6ac634926a299dd439da08bdb547a8ca011" }, @@ -33,6 +33,7 @@ "nvim_lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "poet-v": { "branch": "master", "commit": "85a5dd44d89602cc3dccd2489924e9c7caab0044" }, "rose-pine": { "branch": "main", "commit": "92762f4fa2144c05db760ea254f4c399a56a7ef5" }, "telescope-dap.nvim": { "branch": "master", "commit": "4e2d5efb92062f0b865fe59b200b5ed7793833bf" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, diff --git a/lua/absolute/after/gitignore.lua b/lua/absolute/after/gitignore.lua new file mode 100644 index 0000000..72f91de --- /dev/null +++ b/lua/absolute/after/gitignore.lua @@ -0,0 +1,26 @@ +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", "gi", function() + local path = GetProjectRoot() + + gitignore.generate(path) +end, opts) + +-- Global Settings + +vim.g.gitignore_nvim_overwrite = true diff --git a/lua/absolute/after/lsp-config.lua b/lua/absolute/after/lsp-config.lua index aaab7d3..77342d2 100644 --- a/lua/absolute/after/lsp-config.lua +++ b/lua/absolute/after/lsp-config.lua @@ -111,11 +111,11 @@ lspconfig["emmet_ls"].setup({ filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" }, }) --- configure python server -lspconfig["pyright"].setup({ - capabilities = capabilities, - on_attach = on_attach, -}) +-- -- configure python server +-- lspconfig["pyright"].setup({ +-- capabilities = capabilities, +-- on_attach = on_attach, +-- }) -- configure python lsp lspconfig["pylsp"].setup({ diff --git a/lua/absolute/after/poet-v.lua b/lua/absolute/after/poet-v.lua new file mode 100644 index 0000000..e2582f3 --- /dev/null +++ b/lua/absolute/after/poet-v.lua @@ -0,0 +1,4 @@ +vim.g.poetv_executables = { "poetry", "pipenv" } +vim.g.poetv_auto_activate = 1 +vim.g.poetv_set_environment = 1 +vim.g.poetv_statusline_symbol = "🐍" diff --git a/lua/absolute/plugins/gitignore.lua b/lua/absolute/plugins/gitignore.lua new file mode 100644 index 0000000..af33c7e --- /dev/null +++ b/lua/absolute/plugins/gitignore.lua @@ -0,0 +1,9 @@ +return { + "wintermute-cell/gitignore.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + }, + config = function() + require("absolute.after.gitignore") + end +} diff --git a/lua/absolute/plugins/poet-v.lua b/lua/absolute/plugins/poet-v.lua new file mode 100644 index 0000000..c100708 --- /dev/null +++ b/lua/absolute/plugins/poet-v.lua @@ -0,0 +1,7 @@ +return { + "petobens/poet-v", + config = function() + require("absolute.after.poet-v") + end, + +}