Refactor neovim config file structure
All plugins are now in their own files with their lazy specifications and configurations. Also moved lazy initialization to init.lua because it is very compact nowmain
parent
902c397e8b
commit
0ced314c90
@ -1,4 +1,18 @@
|
|||||||
|
-- Install lazy if it's not yet installed
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("settings")
|
require("settings")
|
||||||
require("neovide")
|
require("neovide")
|
||||||
require("highlight_yank")
|
require("highlight_yank")
|
||||||
require("plugins.lazy")
|
require("lazy").setup("plugins")
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
-- AsciiDoc plugins are grouped together here
|
||||||
|
return {
|
||||||
|
-- Vim ♥️ Asciidoctor
|
||||||
|
{
|
||||||
|
"habamax/vim-asciidoctor",
|
||||||
|
ft = { "asciidoctor", "asciidoc" },
|
||||||
|
},
|
||||||
|
-- AsciiDoc preview
|
||||||
|
{
|
||||||
|
"tigion/nvim-asciidoc-preview",
|
||||||
|
ft = { "asciidoctor", "asciidoc" },
|
||||||
|
},
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
-- Automatic brackets
|
||||||
|
return { "windwp/nvim-autopairs" }
|
@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
version = "*",
|
||||||
|
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||||
|
config = true,
|
||||||
|
--opts = { options = { themeable = true } },
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
-- Caddyfile syntax support
|
||||||
|
return { "isobit/vim-caddyfile", ft = "caddyfile" }
|
@ -1,101 +1,107 @@
|
|||||||
return function()
|
-- Autoompletion
|
||||||
local cmp = require("cmp")
|
return {
|
||||||
local luasnip = require("luasnip")
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-buffer", -- Buffer source
|
||||||
|
{ "petertriho/cmp-git", dependencies = { "nvim-lua/plenary.nvim" } }, -- Git source
|
||||||
|
"hrsh7th/cmp-nvim-lsp", -- LSP source
|
||||||
|
"hrsh7th/cmp-nvim-lua", -- Neovim Lua API documentation source
|
||||||
|
"hrsh7th/cmp-path", -- Path source
|
||||||
|
"hrsh7th/cmp-cmdline", -- cmdline source
|
||||||
|
"saadparwaiz1/cmp_luasnip", -- Snippets source
|
||||||
|
"f3fora/cmp-spell", -- Spell check source
|
||||||
|
"zbirenbaum/copilot-cmp", -- Copilot source
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
if not cmp then
|
if not cmp then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Setup git completion source
|
-- Setup git completion source
|
||||||
require("cmp_git").setup()
|
require("cmp_git").setup()
|
||||||
--
|
--
|
||||||
-- Setup copilot source
|
-- Setup copilot source
|
||||||
require("copilot_cmp").setup({ fix_pairs = true })
|
require("copilot_cmp").setup({ fix_pairs = true })
|
||||||
|
|
||||||
-- Set completeopt to have a better completion experience
|
-- Set completeopt to have a better completion experience
|
||||||
vim.o.completeopt = "menuone,noselect"
|
vim.o.completeopt = "menuone,noselect"
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.close(),
|
["<C-e>"] = cmp.mapping.close(),
|
||||||
["<CR>"] = cmp.mapping.confirm({
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = true,
|
select = true,
|
||||||
}),
|
}),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip.jumpable(-1) then
|
elseif luasnip.jumpable(-1) then
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "copilot" },
|
{ name = "copilot" },
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "nvim_lua" },
|
{ name = "nvim_lua" },
|
||||||
{ name = "git" },
|
{ name = "git" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "spell" },
|
{ name = "spell" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
},
|
},
|
||||||
-- window = {
|
})
|
||||||
-- completion = {
|
|
||||||
-- winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
|
|
||||||
-- },
|
|
||||||
|
|
||||||
-- documentation = {
|
|
||||||
-- winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Enable autopairs when enter is processed
|
-- Enable autopairs when enter is processed
|
||||||
-- on completion
|
-- on completion
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
|
||||||
-- `/` cmdline setup.
|
-- `/` cmdline setup.
|
||||||
cmp.setup.cmdline("/", {
|
cmp.setup.cmdline("/", {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
},
|
|
||||||
})
|
|
||||||
-- `:` cmdline setup.
|
|
||||||
cmp.setup.cmdline(":", {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "path" },
|
|
||||||
}, {
|
|
||||||
{
|
|
||||||
name = "cmdline",
|
|
||||||
option = {
|
|
||||||
ignore_cmds = { "Man", "!" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}),
|
})
|
||||||
})
|
-- `:` cmdline setup.
|
||||||
end
|
cmp.setup.cmdline(":", {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "path" },
|
||||||
|
}, {
|
||||||
|
{
|
||||||
|
name = "cmdline",
|
||||||
|
option = {
|
||||||
|
ignore_cmds = { "Man", "!" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
-- treesitter plugin for commentstring
|
||||||
|
return {
|
||||||
|
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||||
|
dependencies = { "tpope/vim-commentary" },
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
-- GitHub Copilot
|
||||||
|
return {
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
config = true,
|
||||||
|
opts = {
|
||||||
|
suggestion = { enabled = false },
|
||||||
|
panel = { enabled = false },
|
||||||
|
},
|
||||||
|
}
|
@ -1,31 +1,34 @@
|
|||||||
return function()
|
return {
|
||||||
local dap = require("dap")
|
"mfussenegger/nvim-dap",
|
||||||
|
config = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
|
||||||
dap.adapters.bashdb = {
|
dap.adapters.bashdb = {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/bash-debug-adapter",
|
command = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/bash-debug-adapter",
|
||||||
name = "bashdb",
|
name = "bashdb",
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.configurations.sh = {
|
dap.configurations.sh = {
|
||||||
{
|
{
|
||||||
type = "bashdb",
|
type = "bashdb",
|
||||||
request = "launch",
|
request = "launch",
|
||||||
name = "Launch file",
|
name = "Launch file",
|
||||||
showDebugOutput = true,
|
showDebugOutput = true,
|
||||||
pathBashdb = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb",
|
pathBashdb = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb",
|
||||||
pathBashdbLib = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir",
|
pathBashdbLib = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir",
|
||||||
trace = true,
|
trace = true,
|
||||||
file = "${file}",
|
file = "${file}",
|
||||||
program = "${file}",
|
program = "${file}",
|
||||||
cwd = "${workspaceFolder}",
|
cwd = "${workspaceFolder}",
|
||||||
pathCat = "cat",
|
pathCat = "cat",
|
||||||
pathBash = "/bin/bash",
|
pathBash = "/bin/bash",
|
||||||
pathMkfifo = "mkfifo",
|
pathMkfifo = "mkfifo",
|
||||||
pathPkill = "pkill",
|
pathPkill = "pkill",
|
||||||
args = {},
|
args = {},
|
||||||
env = {},
|
env = {},
|
||||||
terminalKind = "integrated",
|
terminalKind = "integrated",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end,
|
||||||
|
}
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
-- vim api documentation for lua lsp
|
||||||
|
return { "ii14/emmylua-nvim", ft = { "lua" } }
|
@ -0,0 +1,16 @@
|
|||||||
|
-- Neovim inside Firefox
|
||||||
|
return {
|
||||||
|
"glacambre/firenvim",
|
||||||
|
build = function()
|
||||||
|
vim.fn["firenvim#install"](0)
|
||||||
|
end,
|
||||||
|
config = function()
|
||||||
|
vim.g.firenvim_config = {
|
||||||
|
localSettings = {
|
||||||
|
[".*"] = {
|
||||||
|
takeOver = "never",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
-- Git commands
|
||||||
|
return { "tpope/vim-fugitive" }
|
@ -0,0 +1,15 @@
|
|||||||
|
-- Git status in signcolumn
|
||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
config = function()
|
||||||
|
local gitsigns = require("gitsigns")
|
||||||
|
gitsigns.setup()
|
||||||
|
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.register({
|
||||||
|
["["] = { h = { gitsigns.prev_hunk, "Previous hunk" } },
|
||||||
|
["]"] = { h = { gitsigns.next_hunk, "Next hunk" } },
|
||||||
|
}, { prefix = "<leader>" })
|
||||||
|
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
-- Edit GPG encrypted files transparently
|
||||||
|
return { "jamessan/vim-gnupg", ft = { "gpg" } }
|
@ -1,19 +1,23 @@
|
|||||||
return function()
|
-- Indent characters
|
||||||
require("ibl").setup({
|
return {
|
||||||
exclude = {
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
filetypes = {
|
config = function()
|
||||||
"",
|
require("ibl").setup({
|
||||||
"checkhealth",
|
exclude = {
|
||||||
"dashboard",
|
filetypes = {
|
||||||
"git",
|
"",
|
||||||
"gitcommit",
|
"checkhealth",
|
||||||
"TelescopePrompt",
|
"dashboard",
|
||||||
"TelescopeResults",
|
"git",
|
||||||
"help",
|
"gitcommit",
|
||||||
"lazy",
|
"TelescopePrompt",
|
||||||
"lspinfo",
|
"TelescopeResults",
|
||||||
"man",
|
"help",
|
||||||
|
"lazy",
|
||||||
|
"lspinfo",
|
||||||
|
"man",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
})
|
||||||
})
|
end,
|
||||||
end
|
}
|
||||||
|
@ -1,246 +0,0 @@
|
|||||||
-- Install lazy if it's not yet installed
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
|
||||||
vim.fn.system({
|
|
||||||
"git",
|
|
||||||
"clone",
|
|
||||||
"--filter=blob:none",
|
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
|
||||||
"--branch=stable", -- latest stable release
|
|
||||||
lazypath,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
-- Configure lazy
|
|
||||||
local plugins = {
|
|
||||||
-- Colorscheme
|
|
||||||
{
|
|
||||||
"rebelot/kanagawa.nvim",
|
|
||||||
config = require("plugins.colorscheme"),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Replace much of neovim's default UI
|
|
||||||
-- with a modern replacement
|
|
||||||
{
|
|
||||||
"folke/noice.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" },
|
|
||||||
opts = require("plugins.noice"),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Statusline
|
|
||||||
{
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
dependencies = { "kyazdani42/nvim-web-devicons" },
|
|
||||||
config = require("plugins.lualine"),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- bufferline
|
|
||||||
{
|
|
||||||
"akinsho/bufferline.nvim",
|
|
||||||
version = "v3.*",
|
|
||||||
dependencies = { "kyazdani42/nvim-web-devicons" },
|
|
||||||
config = true,
|
|
||||||
opts = { options = { themeable = true } },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Git status in signcolumn
|
|
||||||
{ "lewis6991/gitsigns.nvim", config = true },
|
|
||||||
|
|
||||||
-- Git commands
|
|
||||||
"tpope/vim-fugitive",
|
|
||||||
|
|
||||||
-- Indent characters
|
|
||||||
{ "lukas-reineke/indent-blankline.nvim", config = require("plugins.indent-blankline") },
|
|
||||||
|
|
||||||
-- Tree explorer
|
|
||||||
{
|
|
||||||
"kyazdani42/nvim-tree.lua",
|
|
||||||
dependencies = { "kyazdani42/nvim-web-devicons" },
|
|
||||||
config = require("plugins.nvim-tree"),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Telescope
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
config = require("plugins.telescope"),
|
|
||||||
dependencies = {
|
|
||||||
-- Internal dependency for telescope
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
|
|
||||||
-- Use fzf for fuzzy finder
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
|
||||||
build = "make",
|
|
||||||
},
|
|
||||||
-- Replace vim built in select with telescope
|
|
||||||
"nvim-telescope/telescope-ui-select.nvim",
|
|
||||||
|
|
||||||
-- cd plugin for telescope
|
|
||||||
"zane-/cder.nvim",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Do stuff as sudo
|
|
||||||
"lambdalisue/suda.vim",
|
|
||||||
|
|
||||||
-- Display possible keybinds
|
|
||||||
{ "folke/which-key.nvim", config = require("plugins.which-key") },
|
|
||||||
|
|
||||||
-- Package manager for LSP servers, DAP adapters etc.
|
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
config = require("plugins.lsp").setup,
|
|
||||||
dependencies = {
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Additional LSP features for Java
|
|
||||||
"mfussenegger/nvim-jdtls",
|
|
||||||
|
|
||||||
-- Show code LSP context in winbar
|
|
||||||
{ "SmiteshP/nvim-navic", config = true, opts = { mouse = true } },
|
|
||||||
|
|
||||||
-- DAP plugin
|
|
||||||
{ "mfussenegger/nvim-dap", config = require("plugins.dap") },
|
|
||||||
|
|
||||||
-- Snippets plugin
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
dependencies = { "rafamadriz/friendly-snippets" }, -- Snippets collection
|
|
||||||
config = require("plugins.luasnip"),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- vim api documentation for lua lsp
|
|
||||||
{ "ii14/emmylua-nvim", ft = { "lua" } },
|
|
||||||
|
|
||||||
-- Completion
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-buffer", -- Buffer source
|
|
||||||
{ "petertriho/cmp-git", dependencies = { "nvim-lua/plenary.nvim" } }, -- Git source
|
|
||||||
"hrsh7th/cmp-nvim-lsp", -- LSP source
|
|
||||||
"hrsh7th/cmp-nvim-lua", -- Neovim Lua API documentation source
|
|
||||||
"hrsh7th/cmp-path", -- Path source
|
|
||||||
"hrsh7th/cmp-cmdline", -- cmdline source
|
|
||||||
"saadparwaiz1/cmp_luasnip", -- Snippets source
|
|
||||||
"f3fora/cmp-spell", -- Spell check source
|
|
||||||
"zbirenbaum/copilot-cmp", -- Copilot source
|
|
||||||
},
|
|
||||||
config = require("plugins.cmp"),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Automatic brackets
|
|
||||||
{
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
config = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- treesitter
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
build = function()
|
|
||||||
require("nvim-treesitter.install").update({ with_sync = true })
|
|
||||||
end,
|
|
||||||
config = require("plugins.treesitter"),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- treesitter plugin for commentstring
|
|
||||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
|
||||||
|
|
||||||
-- mappings for commenting in code
|
|
||||||
"tpope/vim-commentary",
|
|
||||||
|
|
||||||
-- we all know this one
|
|
||||||
"tpope/vim-surround",
|
|
||||||
|
|
||||||
-- Formatter plugin
|
|
||||||
"sbdchd/neoformat",
|
|
||||||
|
|
||||||
-- Make editing passwords safer
|
|
||||||
{
|
|
||||||
"https://git.zx2c4.com/password-store",
|
|
||||||
config = function(plugin)
|
|
||||||
vim.opt.rtp:append(plugin.dir .. "contrib/vim/redact_pass.vim")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Neovim inside Firefox
|
|
||||||
{
|
|
||||||
"glacambre/firenvim",
|
|
||||||
build = function()
|
|
||||||
vim.fn["firenvim#install"](0)
|
|
||||||
end,
|
|
||||||
config = function()
|
|
||||||
vim.g.firenvim_config = {
|
|
||||||
localSettings = {
|
|
||||||
[".*"] = {
|
|
||||||
takeOver = "never",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Vim ♥️ Asciidoctor
|
|
||||||
{ "habamax/vim-asciidoctor", ft = { "asciidoctor", "asciidoc" } },
|
|
||||||
|
|
||||||
-- Asciidoc preview
|
|
||||||
{ "tigion/nvim-asciidoc-preview", ft = { "asciidoctor", "asciidoc" } },
|
|
||||||
|
|
||||||
-- Markdown preview
|
|
||||||
{
|
|
||||||
"iamcco/markdown-preview.nvim",
|
|
||||||
build = "cd app && yarn install",
|
|
||||||
config = function()
|
|
||||||
vim.g.mkdp_filetypes = { "markdown" }
|
|
||||||
end,
|
|
||||||
ft = { "markdown" },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Edit GPG encrypted files transparently
|
|
||||||
{ "jamessan/vim-gnupg", ft = { "gpg" } },
|
|
||||||
|
|
||||||
-- High performance color highlighter
|
|
||||||
{
|
|
||||||
"norcalli/nvim-colorizer.lua",
|
|
||||||
config = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Caddyfile syntax support
|
|
||||||
{ "isobit/vim-caddyfile", ft = "caddyfile" },
|
|
||||||
|
|
||||||
-- Startup dashboard
|
|
||||||
{
|
|
||||||
"glepnir/dashboard-nvim",
|
|
||||||
event = "VimEnter",
|
|
||||||
config = require("plugins.dashboard"),
|
|
||||||
dependencies = { { "kyazdani42/nvim-web-devicons" } },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Better folds
|
|
||||||
{
|
|
||||||
enabled = false,
|
|
||||||
"kevinhwang91/nvim-ufo",
|
|
||||||
dependencies = { "kevinhwang91/promise-async" },
|
|
||||||
config = require("plugins.ufo"),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- GitHub Copilot
|
|
||||||
{
|
|
||||||
"zbirenbaum/copilot.lua",
|
|
||||||
config = function()
|
|
||||||
require("copilot").setup({
|
|
||||||
suggestion = { enabled = false },
|
|
||||||
panel = { enabled = false },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require("lazy").setup(plugins, { lockfile = "~/git/dotfiles/home/.config/nvim/lazy-lock.json" })
|
|
@ -1,7 +1,10 @@
|
|||||||
return function()
|
-- Statusline
|
||||||
require("lualine").setup({
|
return {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||||
|
opts = {
|
||||||
sections = {
|
sections = {
|
||||||
lualine_c = { "navic" },
|
lualine_c = { "navic" },
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
end
|
}
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
return function()
|
-- Snippets plugin
|
||||||
-- load friendly-snippets to luasnip
|
return {
|
||||||
require("luasnip/loaders/from_vscode").lazy_load()
|
"L3MON4D3/LuaSnip",
|
||||||
end
|
dependencies = { "rafamadriz/friendly-snippets" }, -- Snippets collection
|
||||||
|
config = function()
|
||||||
|
-- load friendly-snippets to luasnip
|
||||||
|
require("luasnip/loaders/from_vscode").lazy_load()
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
-- Markdown preview
|
||||||
|
return {
|
||||||
|
"iamcco/markdown-preview.nvim",
|
||||||
|
build = "cd app && yarn install",
|
||||||
|
config = function()
|
||||||
|
vim.g.mkdp_filetypes = { "markdown" }
|
||||||
|
end,
|
||||||
|
ft = { "markdown" },
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
-- Package manager for LSP servers, DAP adapters etc.
|
||||||
|
return {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||||
|
"mfussenegger/nvim-jdtls",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("mason").setup()
|
||||||
|
|
||||||
|
local mason_lsp = require("mason-lspconfig")
|
||||||
|
local lsp_utils = require('lsp_utils')
|
||||||
|
local capabilities = lsp_utils.get_capabilities()
|
||||||
|
mason_lsp.setup()
|
||||||
|
|
||||||
|
mason_lsp.setup_handlers({
|
||||||
|
-- Default handler
|
||||||
|
function(server_name)
|
||||||
|
require("lspconfig")[server_name].setup({
|
||||||
|
on_attach = lsp_utils.on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Override lua_ls settings
|
||||||
|
["lua_ls"] = function()
|
||||||
|
require("lspconfig").lua_ls.setup({
|
||||||
|
on_attach = lsp_utils.on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||||
|
version = "LuaJIT",
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
-- Get the language server to recognize the `vim` global
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
|
telemetry = { enable = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Don't set up jdtls, it is set up by nvim-jdtls
|
||||||
|
["jdtls"] = function() end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
-- Show code LSP context in winbar
|
||||||
|
return { "SmiteshP/nvim-navic" }
|
@ -0,0 +1,10 @@
|
|||||||
|
-- Formatter plugin
|
||||||
|
return {
|
||||||
|
"sbdchd/neoformat",
|
||||||
|
config = function()
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.register({
|
||||||
|
f = { "<cmd>Neoformat<CR>", "Format with Neoformat" },
|
||||||
|
}, { prefix = "<leader>" })
|
||||||
|
end,
|
||||||
|
}
|
@ -1,18 +1,25 @@
|
|||||||
|
-- Replace much of neovim's default UI
|
||||||
|
-- with a modern replacement
|
||||||
return {
|
return {
|
||||||
lsp = {
|
"folke/noice.nvim",
|
||||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
event = "VeryLazy",
|
||||||
override = {
|
dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" },
|
||||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
opts = {
|
||||||
["vim.lsp.util.stylize_markdown"] = true,
|
lsp = {
|
||||||
["cmp.entry.get_documentation"] = true,
|
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||||
|
override = {
|
||||||
|
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||||
|
["vim.lsp.util.stylize_markdown"] = true,
|
||||||
|
["cmp.entry.get_documentation"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- you can enable a preset for easier configuration
|
||||||
|
presets = {
|
||||||
|
bottom_search = true, -- use a classic bottom cmdline for search
|
||||||
|
command_palette = true, -- position the cmdline and popupmenu together
|
||||||
|
long_message_to_split = true, -- long messages will be sent to a split
|
||||||
|
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||||
|
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||||
},
|
},
|
||||||
},
|
|
||||||
-- you can enable a preset for easier configuration
|
|
||||||
presets = {
|
|
||||||
bottom_search = true, -- use a classic bottom cmdline for search
|
|
||||||
command_palette = true, -- position the cmdline and popupmenu together
|
|
||||||
long_message_to_split = true, -- long messages will be sent to a split
|
|
||||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
|
||||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
-- High performance color highlighter
|
||||||
|
return {
|
||||||
|
"norcalli/nvim-colorizer.lua",
|
||||||
|
}
|
@ -1,13 +1,20 @@
|
|||||||
return function()
|
-- Tree explorer
|
||||||
require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS
|
return {
|
||||||
diagnostics = {
|
"kyazdani42/nvim-tree.lua",
|
||||||
enable = true,
|
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||||
show_on_dirs = true,
|
opts = {
|
||||||
},
|
diagnostics = {
|
||||||
renderer = {
|
enable = true,
|
||||||
highlight_git = true,
|
show_on_dirs = true,
|
||||||
},
|
},
|
||||||
})
|
renderer = {
|
||||||
-- Open/close with alt-o
|
highlight_git = true,
|
||||||
vim.keymap.set("n", "<M-o>", vim.cmd.NvimTreeToggle)
|
},
|
||||||
end
|
},
|
||||||
|
config = function(spec)
|
||||||
|
require("nvim-tree").setup(spec.opts)
|
||||||
|
|
||||||
|
-- Open/close with alt-o
|
||||||
|
vim.keymap.set("n", "<M-o>", vim.cmd.NvimTreeToggle)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
-- Make editing passwords safer
|
||||||
|
return {
|
||||||
|
"https://git.zx2c4.com/password-store",
|
||||||
|
config = function(plugin)
|
||||||
|
vim.opt.rtp:append(plugin.dir .. "contrib/vim/redact_pass.vim")
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
-- Do stuff as sudo
|
||||||
|
return { "lambdalisue/suda.vim" }
|
@ -1,46 +1,52 @@
|
|||||||
return function()
|
return {
|
||||||
require("nvim-treesitter.configs").setup({
|
"nvim-treesitter/nvim-treesitter",
|
||||||
ensure_installed = {
|
build = function()
|
||||||
"bash",
|
require("nvim-treesitter.install").update({ with_sync = true })
|
||||||
"css",
|
end,
|
||||||
"dockerfile",
|
config = function()
|
||||||
"git_config",
|
require("nvim-treesitter.configs").setup({
|
||||||
"git_rebase",
|
ensure_installed = {
|
||||||
"gitattributes",
|
"bash",
|
||||||
"gitcommit",
|
"css",
|
||||||
"gitignore",
|
"dockerfile",
|
||||||
"html",
|
"git_config",
|
||||||
"http",
|
"git_rebase",
|
||||||
"java",
|
"gitattributes",
|
||||||
"javascript",
|
"gitcommit",
|
||||||
"json",
|
"gitignore",
|
||||||
"json5",
|
"html",
|
||||||
"latex",
|
"http",
|
||||||
"lua",
|
"java",
|
||||||
"make",
|
"javascript",
|
||||||
"markdown",
|
"json",
|
||||||
"markdown_inline",
|
"json5",
|
||||||
"php",
|
"latex",
|
||||||
"python",
|
"lua",
|
||||||
"rasi",
|
"make",
|
||||||
"regex",
|
"markdown",
|
||||||
"rst",
|
"markdown_inline",
|
||||||
"scss",
|
"php",
|
||||||
"toml",
|
"python",
|
||||||
"tsx",
|
"rasi",
|
||||||
"typescript",
|
"regex",
|
||||||
"vim",
|
"rst",
|
||||||
"yaml",
|
"scss",
|
||||||
},
|
"toml",
|
||||||
highlight = { enable = true },
|
"tsx",
|
||||||
indent = { enable = true },
|
"typescript",
|
||||||
incremental_selection = { enable = true },
|
"vim",
|
||||||
context_commentstring = { enable = true },
|
"yaml",
|
||||||
sync_install = true,
|
},
|
||||||
ignore_install = {},
|
highlight = { enable = true },
|
||||||
auto_install = true,
|
indent = { enable = true },
|
||||||
})
|
incremental_selection = { enable = true },
|
||||||
|
context_commentstring = { enable = true },
|
||||||
|
sync_install = true,
|
||||||
|
ignore_install = {},
|
||||||
|
auto_install = true,
|
||||||
|
})
|
||||||
|
|
||||||
-- vim.wo.foldmethod = 'expr'
|
-- vim.wo.foldmethod = 'expr'
|
||||||
-- im.wo.foldexpr = 'nvim_treesitter#foldexpr()'
|
-- im.wo.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
end
|
end,
|
||||||
|
}
|
||||||
|
@ -1,20 +1,28 @@
|
|||||||
return function()
|
-- Better folds
|
||||||
local keymap = vim.keymap
|
-- Disabled for now because it causes weird artifacts
|
||||||
local o = vim.o
|
return {
|
||||||
local ufo = require("ufo")
|
enabled = false,
|
||||||
ufo.setup({
|
"kevinhwang91/nvim-ufo",
|
||||||
|
dependencies = { "kevinhwang91/promise-async" },
|
||||||
|
opts = {
|
||||||
close_fold_kinds = {
|
close_fold_kinds = {
|
||||||
"imports",
|
"imports",
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
config = function(spec)
|
||||||
|
local ufo = require("ufo")
|
||||||
|
ufo.setup(spec.opts)
|
||||||
|
|
||||||
-- Using ufo, need to remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
-- Using ufo, need to remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
||||||
keymap.set("n", "zR", ufo.openAllFolds)
|
local keymap = vim.keymap
|
||||||
keymap.set("n", "zM", ufo.closeAllFolds)
|
keymap.set("n", "zR", ufo.openAllFolds)
|
||||||
|
keymap.set("n", "zM", ufo.closeAllFolds)
|
||||||
|
|
||||||
-- Fold settings
|
-- Fold settings
|
||||||
o.foldcolumn = "1"
|
local o = vim.o
|
||||||
o.foldlevel = 99
|
o.foldcolumn = "1"
|
||||||
o.foldlevelstart = 99
|
o.foldlevel = 99
|
||||||
o.foldenable = true
|
o.foldlevelstart = 99
|
||||||
end
|
o.foldenable = true
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
-- we all know this one
|
||||||
|
return { "tpope/vim-surround" }
|
@ -1,29 +1,29 @@
|
|||||||
return function()
|
-- Display possible keybinds
|
||||||
local wk = require("which-key")
|
-- Plugin specific keybinds are set up in plugin configuration file
|
||||||
local gitsigns = require("gitsigns")
|
return {
|
||||||
wk.setup({})
|
"folke/which-key.nvim",
|
||||||
|
config = function()
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.setup({})
|
||||||
|
|
||||||
wk.register({
|
wk.register({
|
||||||
f = { "<cmd>Neoformat<CR>", "Format with Neoformat" },
|
h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" },
|
||||||
h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" },
|
}, { prefix = "<leader>" })
|
||||||
}, { prefix = "<leader>" })
|
|
||||||
|
|
||||||
wk.register({
|
wk.register({
|
||||||
["<C-n>"] = { "<cmd>bnext<CR>", "Next buffer" },
|
["<C-n>"] = { "<cmd>bnext<CR>", "Next buffer" },
|
||||||
["<C-b>"] = { "<cmd>bprevious<CR>", "Previous buffer" },
|
["<C-b>"] = { "<cmd>bprevious<CR>", "Previous buffer" },
|
||||||
["["] = { h = { gitsigns.prev_hunk, "Previous hunk" } },
|
})
|
||||||
["]"] = { h = { gitsigns.next_hunk, "Next hunk" } },
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Open cder
|
-- Open cder
|
||||||
wk.register({ cd = {
|
wk.register({ cd = {
|
||||||
function()
|
function()
|
||||||
vim.cmd("Telescope cder")
|
vim.cmd("Telescope cder")
|
||||||
end,
|
end,
|
||||||
"Change directories",
|
"Change directories",
|
||||||
} })
|
} })
|
||||||
|
|
||||||
-- Exit terminal insert mode with esc
|
-- Exit terminal insert mode with esc
|
||||||
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
|
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
|
||||||
|
end,
|
||||||
end
|
}
|
||||||
|
Loading…
Reference in New Issue