chore: add new plugins

This commit is contained in:
2024-03-22 12:52:52 +02:00
parent 8e6bda8ac0
commit 1c8d7d92a8
16 changed files with 163 additions and 82 deletions

View File

@@ -1,6 +1,7 @@
return {
"hrsh7th/nvim-cmp",
event = { "InsertEnter", "CmdlineEnter" },
commit = "b356f2c",
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-cmdline",
@@ -13,7 +14,7 @@ return {
dependencies = { "nvim-lua/plenary.nvim" },
event = { "BufRead pyproject.toml", "BufRead requirements.txt", "BufRead requirements_dev.txt" },
},
-- { "kristijanhusak/vim-dadbod-completion", dependencies = { "tpope/vim-dadbod" } },
{ "kristijanhusak/vim-dadbod-completion", dependencies = { "tpope/vim-dadbod" } },
"SergioRibera/cmp-dotenv",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
@@ -24,10 +25,12 @@ return {
"chrisgrieser/cmp-nerdfont",
"petertriho/cmp-git",
"davidsierradz/cmp-conventionalcommits",
"ryo33/nvim-cmp-rust",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local compare = require("cmp.config.compare")
local kind_icons = {
Text = "󰉿",
Method = "󰆧",
@@ -82,7 +85,7 @@ return {
{ name = "buffer", keyword_length = 4 },
{ name = "neorg" },
{ name = "pypi" },
-- { name = "dadbod" },
{ name = "dadbod" },
{ name = "env" },
{ name = "calc" },
{ name = "emoji" },
@@ -116,7 +119,7 @@ return {
neorg = "[neorg]",
crates = "[crates]",
pypi = "[pypi]",
-- dadbod = "[dadbod]",
dadbod = "[dadbod]",
env = "[env]",
buffer = "[buf]",
})[entry.source.name]
@@ -136,6 +139,29 @@ return {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
filetypes = {
sorting = {
priority_weight = 2,
comparators = {
-- deprioritize `.box`, `.mut`, etc.
require("cmp-rust").deprioritize_postfix,
-- deprioritize `Borrow::borrow` and `BorrowMut::borrow_mut`
require("cmp-rust").deprioritize_borrow,
-- deprioritize `Deref::deref` and `DerefMut::deref_mut`
require("cmp-rust").deprioritize_deref,
-- deprioritize `Into::into`, `Clone::clone`, etc.
require("cmp-rust").deprioritize_common_traits,
compare.offset,
compare.exact,
compare.score,
compare.recently_used,
compare.locality,
compare.sort_text,
compare.length,
compare.order,
},
},
},
})
--[[ cmp.setup.cmdline("/", {

View File

@@ -9,7 +9,7 @@ return {
},
dependencies = {
"williamboman/mason.nvim",
"rcarriga/nvim-dap-ui",
{ "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" } },
"mfussenegger/nvim-dap",
{ "simrat39/rust-tools.nvim", ft = "rust" },
{ "mfussenegger/nvim-dap-python", ft = "python" },
@@ -197,44 +197,26 @@ return {
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),
},
})
-- dap.configurations.rust = {}
-- C/C++
-- FIX: not working
dap.adapters.lldb = {
dap.adapters.gdb = {
type = "executable",
command = codelldb_path,
name = "lldb",
command = "gdb",
args = { "-i", "dap" },
}
dap.configurations.cpp = {
{
name = "Launch",
type = "lldb",
type = "gdb",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = {},
-- 💀
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
--
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
--
-- Otherwise you might get the following error:
--
-- Error on launch: Failed to attach to the target process
--
-- But you should be aware of the implications:
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
-- runInTerminal = false,
stopAtBeginningOfMainSubprogram = false,
},
}
-- If you want to use this for Rust and C, add something like this:
dap.configurations.c = dap.configurations.cpp
end,
}

View File

@@ -1,6 +1,7 @@
return {
"tpope/vim-fugitive",
lazy = false,
enabled = false,
keys = {
{ "<leader>gg", vim.cmd.G, desc = "[G]it" },
{ "<leader>gd", vim.cmd.Gdiffsplit, desc = "[G]it [D]iff" },

View File

@@ -0,0 +1,8 @@
return {
"zeioth/garbage-day.nvim",
dependencies = { "neovim/nvim-lspconfig" },
event = "VeryLazy",
opts = {
-- your options here
},
}

17
lua/plugins/gitignore.lua Normal file
View File

@@ -0,0 +1,17 @@
return {
"wintermute-cell/gitignore.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
cmd = { "Gitignore" },
keys = {
{
"<leader>gi",
function()
require("gitignore").generate()
end,
desc = "[G]it [I]gnore",
},
},
config = function()
require("gitignore")
end,
}

View File

@@ -1,14 +1,15 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
"arkav/lualine-lsp-progress",
},
opts = {
options = {
component_separators = { left = "|", right = "|" },
{
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
"arkav/lualine-lsp-progress",
},
--[[ Available components
opts = {
options = {
component_separators = { left = "|", right = "|" },
},
--[[ Available components
`branch` (git branch)
`buffers` (shows currently available buffers)
`diagnostics` (diagnostics count from your preferred source)
@@ -26,14 +27,23 @@ return {
`selectioncount` (number of selected characters or lines)
`tabs` (shows currently available tabs)
`windows` (shows currently available windows) ]]
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = { "filename", "diff", "lsp_progress" },
lualine_x = { "diagnostics", "encoding", "filetype", "filesize" },
lualine_y = { "progress" },
lualine_z = { "location" },
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = { "filename", "harpoon2", "lsp_progress" },
lualine_x = { "diagnostics", "encoding", "filetype", "filesize" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
extentions = { "fzf", "fugitive", "lazy", "mason", "man", "oil", "nvim-dap-ui", "trouble" },
},
},
{
"letieu/harpoon-lualine",
dependencies = {
{
"ThePrimeagen/harpoon",
},
},
extentions = { "fzf", "fugitive", "lazy", "mason", "man", "oil", "nvim-dap-ui", "trouble" },
},
}

View File

@@ -5,6 +5,7 @@ return {
version = "v2.*",
dependencies = {
"rafamadriz/friendly-snippets", -- a bunch of snippets to use
"saadparwaiz1/cmp_luasnip",
},
config = function()
local ls = require("luasnip")
@@ -79,5 +80,4 @@ return {
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
"saadparwaiz1/cmp_luasnip",
}

View File

@@ -1,14 +1,15 @@
return {
"folke/neodev.nvim",
dependencies = { "rcarriga/nvim-dap-ui" },
opts = {
library = {
enabled = true, -- when not enabled, neodev will not change any settings to the LSP server
-- these settings will be used for your Neovim config directory
runtime = true, -- runtime path
types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others
plugins = true, -- installed opt or start plugins in packpath
-- plugins = true, -- installed opt or start plugins in packpath
-- you can also specify the list of plugins to make available as a workspace library
-- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" },
plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim", "nvim-dap-ui" },
},
setup_jsonls = true, -- configures jsonls to provide completion for project specific .luarc.json files
-- for your Neovim config directory, the config.library settings will be used as is

View File

@@ -1,6 +1,5 @@
return {
"NeogitOrg/neogit",
enabled = false,
dependencies = {
"nvim-lua/plenary.nvim", -- required
"sindrets/diffview.nvim", -- optional - Diff integration

View File

@@ -4,7 +4,9 @@ return {
dependencies = {
"williamboman/mason.nvim",
"nvim-lua/plenary.nvim",
"nvimtools/none-ls.nvim",
{ "nvimtools/none-ls.nvim", dependencies = {
"nvimtools/none-ls-extras.nvim",
} },
},
config = function()
local null_ls = require("null-ls")
@@ -14,6 +16,7 @@ return {
local diagnostics = null_ls.builtins.diagnostics
null_ls.setup({
sources = {
require("none-ls.diagnostics.cpplint"),
-- Here you can add tools not supported by mason.nvim
-- make sure the source name is supported by null-ls
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md

View File

@@ -0,0 +1,20 @@
return {
"KDesp73/project-starter.nvim",
enabled = false,
cmd = { "CreateProject" },
config = function()
local home_dir = os.getenv("HOME")
require("project-starter").setup({
default_paths = {
-- c = "path/to/c/projects/",
cpp = home_dir .. "/Templates/cpp",
-- java = "path/to/java/projects/", -- this includes java swing projects
-- nvim_plugins = "path/to/neovim/plugins",
python = home_dir .. "/Templates/python/",
-- ruby = "path/to/ruby/projects",
-- android = "path/to/android/projects",
},
cd = true, -- change project directory after creation (default is true)
})
end,
}