feat: update nvim
This commit is contained in:
parent
6a285955c8
commit
d4f2d27b3f
32 changed files with 2682 additions and 0 deletions
81
nvim/lua/plugins/common.lua
Normal file
81
nvim/lua/plugins/common.lua
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
return {
|
||||
-- Dev icons
|
||||
{
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
'nvim-mini/mini.nvim',
|
||||
version = '*'
|
||||
},
|
||||
-- Screenkey
|
||||
{
|
||||
"NStefan002/screenkey.nvim",
|
||||
lazy = false,
|
||||
version = "*", -- or branch = "main", to use the latest commit
|
||||
},
|
||||
-- Marks
|
||||
{
|
||||
"chentoast/marks.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
-- Git
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = function()
|
||||
require("configs.gitsigns")
|
||||
end,
|
||||
},
|
||||
{
|
||||
'akinsho/git-conflict.nvim',
|
||||
version = "*",
|
||||
config = true
|
||||
},
|
||||
-- Nvim tree
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||
opts = function()
|
||||
return require "configs.nvimtree"
|
||||
end,
|
||||
},
|
||||
-- Pairs
|
||||
{
|
||||
"nvim-mini/mini.pairs",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
opts = {
|
||||
modes = { insert = true, command = true, terminal = false },
|
||||
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||
skip_ts = { "string" },
|
||||
skip_unbalanced = true,
|
||||
markdown = true,
|
||||
},
|
||||
},
|
||||
-- Formating
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = 'BufWritePre',
|
||||
config = function()
|
||||
require "configs.conform"
|
||||
end,
|
||||
},
|
||||
-- Yank highlight
|
||||
{
|
||||
"machakann/vim-highlightedyank",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
-- Sessions
|
||||
{
|
||||
"olimorris/persisted.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = {
|
||||
autostart = true,
|
||||
autosave = true,
|
||||
save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"),
|
||||
use_git_branch = true,
|
||||
autoload = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
195
nvim/lua/plugins/development.lua
Normal file
195
nvim/lua/plugins/development.lua
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
return {
|
||||
-- Nvim lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("configs.lsp.lspconfig")
|
||||
end
|
||||
},
|
||||
-- Mason
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts = {}
|
||||
},
|
||||
-- Mason lspconfig
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
"mason-org/mason.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
}
|
||||
},
|
||||
-- Nvim complete
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = "rafamadriz/friendly-snippets",
|
||||
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
||||
config = function(_, opts)
|
||||
require("luasnip").config.set_config(opts)
|
||||
require "configs.luasnip"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
opts = {
|
||||
fast_wrap = {},
|
||||
disable_filetype = { "TelescopePrompt", "vim" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-autopairs").setup(opts)
|
||||
-- setup cmp for autopairs
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
},
|
||||
{
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"https://codeberg.org/FelipeLema/cmp-async-path.git"
|
||||
}
|
||||
},
|
||||
opts = function()
|
||||
return require "configs.cmp"
|
||||
end,
|
||||
},
|
||||
-- Treesitter (syntax)
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
opts = function()
|
||||
return require("configs.treesitter")
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter").setup(opts)
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"c",
|
||||
"cpp",
|
||||
"go",
|
||||
"lua",
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"json",
|
||||
"jsonc",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"html",
|
||||
"xml",
|
||||
"yaml",
|
||||
"toml",
|
||||
"sql",
|
||||
"php",
|
||||
"make",
|
||||
"cmake",
|
||||
"diff",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
},
|
||||
callback = function(args)
|
||||
pcall(vim.treesitter.start, args.buf)
|
||||
vim.bo[args.buf].syntax = "on"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- Logs
|
||||
{
|
||||
'fei6409/log-highlight.nvim',
|
||||
event = 'BufReadPre', -- Lazy load the plugin
|
||||
config = function()
|
||||
require('log-highlight').setup({
|
||||
keyword = {
|
||||
error = 'ERROR',
|
||||
warning = { 'ALWAYS', 'WARN' },
|
||||
info = { 'INFO' },
|
||||
debug = { 'DEBUG' },
|
||||
pass = {},
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
-- Folders
|
||||
{
|
||||
'kevinhwang91/nvim-ufo',
|
||||
dependencies = 'kevinhwang91/promise-async',
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("configs.ufo")
|
||||
end
|
||||
},
|
||||
-- Tests
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"alfaix/neotest-gtest",
|
||||
"olimorris/neotest-phpunit",
|
||||
},
|
||||
config = function()
|
||||
require("neotest").setup({
|
||||
adapters = {
|
||||
require("neotest-phpunit"),
|
||||
require("neotest-gtest").setup({}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- These are for C/C++ Debbuger
|
||||
{
|
||||
"nvim-neotest/nvim-nio",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("configs.nvim-dap").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
event = "VeryLazy",
|
||||
dependencies = "mfussenegger/nvim-dap",
|
||||
},
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"mfussenegger/nvim-dap",
|
||||
},
|
||||
opts = {
|
||||
handlers = {}
|
||||
},
|
||||
},
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
dependencies = "mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
require("nvim-dap-virtual-text").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'aspeddro/gitui.nvim',
|
||||
config = function()
|
||||
require("gitui").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/joke.lua
Normal file
8
nvim/lua/plugins/joke.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
'kwakzalver/duckytype.nvim',
|
||||
config = function()
|
||||
require('duckytype').setup {}
|
||||
end
|
||||
},
|
||||
}
|
||||
17
nvim/lua/plugins/lines.lua
Normal file
17
nvim/lua/plugins/lines.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require("configs.lualine")
|
||||
end,
|
||||
},
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
version = "*",
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
config = function()
|
||||
require("configs.bufferline")
|
||||
end,
|
||||
},
|
||||
}
|
||||
30
nvim/lua/plugins/noice.lua
Normal file
30
nvim/lua/plugins/noice.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts ={
|
||||
-- add any options here
|
||||
},
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
config = {
|
||||
lsp = {
|
||||
signature = {
|
||||
enabled = false,
|
||||
},
|
||||
hover = {
|
||||
enabled = false,
|
||||
},
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
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
|
||||
},
|
||||
}
|
||||
}
|
||||
102
nvim/lua/plugins/snacks.lua
Normal file
102
nvim/lua/plugins/snacks.lua
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
|
||||
|
||||
bigfile = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
width = 60,
|
||||
row = nil, -- dashboard position. nil for center
|
||||
col = nil, -- dashboard position. nil for center
|
||||
pane_gap = 4, -- empty columns between vertical panes
|
||||
autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence
|
||||
-- These settings are used by some built-in sections
|
||||
preset = {
|
||||
-- Defaults to a picker that supports `fzf-lua`, `telescope.nvim` and `mini.pick`
|
||||
---@type fun(cmd:string, opts:table)|nil
|
||||
pick = nil,
|
||||
-- Used by the `keys` section to show keymaps.
|
||||
-- Set your custom keymaps here.
|
||||
-- When using a function, the `items` argument are the default keymaps.
|
||||
-- stylua: ignore
|
||||
---@type snacks.dashboard.Item[]
|
||||
keys = {
|
||||
{ icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
|
||||
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
||||
{ icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
|
||||
{ icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
|
||||
{ icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
|
||||
{ icon = " ", key = "s", desc = "Restore Session", section = "session" },
|
||||
{ icon = " ", key = "L", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
|
||||
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
||||
},
|
||||
-- Used by the `header` section
|
||||
header = [[
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⡴⠶⠶⠒⠒⠒⠶⠶⣦⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⣠⡶⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⢷⣦⡀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⣠⠞⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣦⡀⠀⠀⠀
|
||||
⠀⠀⣼⠋⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣶⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣆⠀⠀
|
||||
⠀⣼⠃⠀⠀⠀⠀⠀⢀⣤⣾⡿⠟⠉⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠈⢻⣆⠀
|
||||
⢸⡇⠀⠀⠀⠀⠀⣠⣿⡿⠋⠁⠒⠠⡀⠀⢀⠔⠚⠻⣿⣦⠀⠀⠀⠀⠀⠈⢿⡆
|
||||
⣼⠀⠀⠀⠀⠀⢠⣿⣿⠁⠀⠀⠀⠀⠘⡶⠁⠀⠀⠀⠸⣿⣷⡀⠀⠀⠀⠀⢸⣧
|
||||
⢿⠀⠀⠀⠀⠀⢸⢻⣿⠀⠀⠀⠙⠀⢠⢇⠀⠘⠁⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⣿
|
||||
⢸⡇⠀⠀⠀⠀⢸⠘⣿⣆⠀⠀⢀⠔⠁⠈⢦⡀⠀⠀⣸⣿⡟⡇⠀⠀⠀⠀⢠⡏
|
||||
⠈⢿⡄⠀⠀⠀⠀⢆⠈⠻⣿⣏⡀⠀⠀⠀⠀⠉⣳⣾⡿⠟⡰⠁⠀⠀⠀⠀⣼⠃
|
||||
⠀⠘⢿⣄⠀⠀⠀⠀⠣⡀⠈⠛⠿⢦⣄⣤⠶⠿⠛⠉⣀⠜⠁⠀⠀⠀⠀⣼⠏⠀
|
||||
⠀⠀⠈⠻⣦⣀⠀⠀⠀⠈⠑⠢⠤⢤⣯⣧⠤⠤⠔⠋⠁⠀⠀⠀⠀⣠⡾⠃⠀⠀
|
||||
⠀⠀⠀⢀⡼⠛⠷⣄⡀⠀⠀⠀⠀⡼⠀⢸⠀⠀⠀⠀⠀⠀⢀⣤⣾⡋⠀⠀⠀⠀
|
||||
⠀⠀⢠⠞⠀⠀⠀⠈⠉⠓⠶⣤⣄⣀⣀⣈⣀⣀⣤⠤⠶⠚⠉⠁⠀⠹⣆⠀⠀⠀
|
||||
⠀⢠⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⡆⠀⠀
|
||||
⠀⣞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⠀⠀
|
||||
⣼⠉⠉⠉⠑⡆⠀⠀⠀⠀⠀⠀⠀⠀⢹⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠤⠤⢼⡀⠀
|
||||
⠙⠦⠤⣴⣚⣁⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠸⣀⠀⠀⢀⡟⠀
|
||||
⠀⠀⠀⠀⣿⠀⣈⣉⣉⣀⡀⠀⠀⠒⠛⠒⠒⠒⠒⠒⠒⠒⠒⠒⡏⠉⠉⠁⠀⠀
|
||||
⠀⠀⠠⠾⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠶⢷⣤⠀⠀]],
|
||||
},
|
||||
-- item field formatters
|
||||
formats = {
|
||||
icon = function(item)
|
||||
if item.file and item.icon == "file" or item.icon == "directory" then
|
||||
return Snacks.dashboard.icon(item.file, item.icon)
|
||||
end
|
||||
return { item.icon, width = 2, hl = "icon" }
|
||||
end,
|
||||
footer = { "%s", align = "center" },
|
||||
header = { "%s", align = "center" },
|
||||
file = function(item, ctx)
|
||||
local fname = vim.fn.fnamemodify(item.file, ":~")
|
||||
fname = ctx.width and #fname > ctx.width and vim.fn.pathshorten(fname) or fname
|
||||
if #fname > ctx.width then
|
||||
local dir = vim.fn.fnamemodify(fname, ":h")
|
||||
local file = vim.fn.fnamemodify(fname, ":t")
|
||||
if dir and file then
|
||||
file = file:sub(-(ctx.width - #dir - 2))
|
||||
fname = dir .. "/…" .. file
|
||||
end
|
||||
end
|
||||
local dir, file = fname:match("^(.*)/(.+)$")
|
||||
return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } } or { { fname, hl = "file" } }
|
||||
end,
|
||||
},
|
||||
sections = {
|
||||
{ section = "header" },
|
||||
{ section = "keys", gap = 1, padding = 1 },
|
||||
},
|
||||
debug = false,
|
||||
},
|
||||
explorer = { enabled = false },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/telescope.lua
Normal file
8
nvim/lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
cmd = "Telescope",
|
||||
configs = function()
|
||||
return require "configs.telescope"
|
||||
end,
|
||||
}
|
||||
67
nvim/lua/plugins/whichkey.lua
Normal file
67
nvim/lua/plugins/whichkey.lua
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts_extend = { "spec" },
|
||||
opts = {
|
||||
preset = "helix",
|
||||
defaults = {},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "x" },
|
||||
{ "<leader><tab>", group = "tabs" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>d", group = "debug" },
|
||||
{ "<leader>dp", group = "profiler" },
|
||||
{ "<leader>f", group = "file/find" },
|
||||
{ "<leader>g", group = "git" },
|
||||
{ "<leader>gh", group = "hunks" },
|
||||
{ "<leader>q", group = "quit/session" },
|
||||
{ "<leader>s", group = "search" },
|
||||
{ "<leader>u", group = "ui" },
|
||||
{ "<leader>x", group = "diagnostics/quickfix" },
|
||||
{ "[", group = "prev" },
|
||||
{ "]", group = "next" },
|
||||
{ "g", group = "goto" },
|
||||
{ "gs", group = "surround" },
|
||||
{ "z", group = "fold" },
|
||||
{
|
||||
"<leader>b",
|
||||
group = "buffer",
|
||||
expand = function()
|
||||
return require("which-key.extras").expand.buf()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"<leader>w",
|
||||
group = "windows",
|
||||
proxy = "<c-w>",
|
||||
expand = function()
|
||||
return require("which-key.extras").expand.win()
|
||||
end,
|
||||
},
|
||||
-- better descriptions
|
||||
{ "gx", desc = "Open with system app" },
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Keymaps (which-key)",
|
||||
},
|
||||
{
|
||||
"<c-w><space>",
|
||||
function()
|
||||
require("which-key").show({ keys = "<c-w>", loop = true })
|
||||
end,
|
||||
desc = "Window Hydra Mode (which-key)",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
wk.setup(opts)
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue