All plugins written to lazy instead of packer

This commit is contained in:
2024-09-11 13:38:12 +02:00
parent 51dfa68847
commit bedfd083b7
9 changed files with 209 additions and 104 deletions

View File

@@ -1,15 +1,18 @@
{
"LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"dichromatic": { "branch": "master", "commit": "9765a72ce24ddae48afe12c316583a22c82ad812" },
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
"lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" },
"lsp-zero.nvim": { "branch": "v4.x", "commit": "9823b3e27deaf9f0152f3bc22f05b54f21e234e8" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
"nvim-treesitter": { "branch": "master", "commit": "c436d45eeeeb78e5482cb28b59de1d7a77c93d86" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"nvim-lspconfig": { "branch": "master", "commit": "d88ae6623fef09251e3aa20001bb761686eae730" },
"nvim-treesitter": { "branch": "master", "commit": "d22166e3d8d375b761c32b303176f3e955560b0c" },
"plenary": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"vim-dichromatic": { "branch": "master", "commit": "9765a72ce24ddae48afe12c316583a22c82ad812" },
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }
}

View File

@@ -8,4 +8,11 @@ end
vim.keymap.set("n", "<leader>c", function() ColorMyPencils() end)
return {
"romainl/vim-dichromatic",
name = "dichromatic",
lazy = false,
config = function()
ColorMyPencils()
end
}

View File

@@ -1,3 +1,7 @@
return {
"theprimeagen/harpoon",
config = function()
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
@@ -7,3 +11,5 @@ vim.keymap.set("n", "<leader>1", function() ui.nav_file(1) end)
vim.keymap.set("n", "<leader>2", function() ui.nav_file(2) end)
vim.keymap.set("n", "<leader>3", function() ui.nav_file(3) end)
vim.keymap.set("n", "<leader>4", function() ui.nav_file(4) end)
end
}

View File

@@ -7,26 +7,3 @@ return {
}
}
return {
{
"nvim-telescope/telescope.nvim",
tag = "0.1.6",
requires = {
{ "nvim-lua/plenary.nvim" } }
},
{ "romainl/vim-dichromatic", config = function() vim.cmd('colorscheme dichromatic') end },
{
"nvim-treesitter/nvim-treesitter",
build = function()
require("nvim-treesitter.install").update({ with_sync = true })()
end
},
"nvim-treesitter/playground",
"theprimeagen/harpoon",
"mbbill/undotree",
"tpope/vim-fugitive",
{ 'VonHeikemen/lsp-zero.nvim', branch = 'v4.x' },
{ 'neovim/nvim-lspconfig' },
{ 'hrsh7th/cmp-nvim-lsp' },
{ 'hrsh7th/nvim-cmp' },
}

View File

@@ -1,18 +1,86 @@
local lsp = require('lsp-zero').preset({})
return {
{
"VonHeikemen/lsp-zero.nvim",
branch = "v4.x",
lazy = true,
config = false,
},
{
"williamboman/mason.nvim",
lazy = false,
config = true,
},
lsp.ensure_installed({
'lua_ls', -- Lua
'rust_analyzer', -- rust
'texlab', -- LaTeX
'clangd', -- C/C++
'jedi_language_server', -- Python
'html', -- HTML
'ocamllsp', -- OCaml
-- Autocompletion
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
{ "L3MON4D3/LuaSnip" },
},
config = function()
local cmp = require('cmp')
cmp.setup({
sources = {
{ name = "nvim_lsp" },
},
mapping = cmp.mapping.preset.insert({
['<C-Space>'] = cmp.mapping.complete(),
}),
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
})
end
},
-- LSP
{
"neovim/nvim-lspconfig",
cmd = { 'LspInfo', 'LspInstall', 'LspStart' },
event = { 'BufReadPre', 'BufNewFile' },
dependencies = {
{ "hrsh7th/cmp-nvim-lsp" },
{ "williamboman/mason.nvim" },
{ "williamboman/mason-lspconfig.nvim" },
},
config = function()
local lsp_zero = require('lsp-zero')
-- lsp_attach is where you enable features that only work
-- if there is a language server active in the file
local lsp_attach = function(client, bufnr)
local opts = { buffer = bufnr }
vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
vim.keymap.set('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
vim.keymap.set({ 'n', 'x' }, '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts)
vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
end
lsp_zero.extend_lspconfig({
sign_text = true,
lsp_attach = lsp_attach,
capabilities = require('cmp_nvim_lsp').default_capabilities()
})
-- Fix undefined global 'vim'
lsp.configure('lua_ls', {
cmd = { 'lua-language-server' },
require('mason-lspconfig').setup({
ensure_installed = {},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({})
end,
lua_ls = function()
require('lspconfig').lua_ls.setup({
settings = {
Lua = {
runtime = {
@@ -31,16 +99,9 @@ lsp.configure('lua_ls', {
},
},
})
lsp.on_attach(function(_, bufnr)
lsp.default_keymaps({ buffer = bufnr })
end)
lsp.set_sign_icons({
error = '',
warn = '',
hint = '',
info = '»'
end,
}
})
lsp.setup()
end
}
}

View File

@@ -1,6 +1,29 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = {
"nvim-lua/plenary.nvim"
},
config = function()
require('telescope').setup({})
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
vim.keymap.set('n', '<leader>pws', function()
local word = vim.fn.expand("<cword>")
builtin.grep_string({ search = word })
end)
vim.keymap.set('n', '<leader>pWs', function()
local word = vim.fn.expand("<cWORD>")
builtin.grep_string({ search = word })
end)
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end)
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
end
}

View File

@@ -1,22 +1,38 @@
require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "cpp", "cmake", "latex", "python", "groovy",
"ocaml" },
return {
"nvim-treesitter/nvim-treesitter",
build = function()
require("nvim-treesitter.instal").update({ with_sync = true})()
end,
config = function()
require("nvim-treesitter.configs").setup({
-- List of parsers
ensure_installed = {
"vimdoc", "vim", "lua", "c", "rust", "cpp", "cmake", "latex", "python", "groovy", "bash",
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
indent = {
enable = true
},
highlight = {
enable = true,
additional_vim_regex_highlighting = { "markdown" },
},
})
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
treesitter_parser_config.templ = {
install_info = {
url = "https://github.com/vrischmann/tree-sitter-templ.git",
files = { "src/parser.c", "src/scanner.c" },
branch = "master",
},
}
vim .treesitter.language.register("templ", "templ")
end
}

View File

@@ -1 +1,8 @@
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
return {
"mbbill/undotree",
config = function()
vim.keymap.set("n", "<leader>u", vim.cmd.UndoTreeToggle)
end
}

View File

@@ -1 +1,6 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
end
}