(nvim) migrate to built-in plugin manager from neovim v0.12
This commit is contained in:
parent
914a235885
commit
8e79175760
29 changed files with 926 additions and 1217 deletions
|
|
@ -1,18 +1 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("juancwu.config").setup({})
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||
"catppuccin": { "branch": "main", "commit": "f19cab18ec4dc86d415512c7a572863b2adbcc18" },
|
||||
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "debe91547d7fb1eef34ce26a5106f277fbfdd109" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "258d2a5ef4a3e3d6d9ba9da72c9725c53e9afcbd" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
||||
"luvit-meta": { "branch": "main", "commit": "0ea4ff636c5bb559ffa78108561d0976f4de9682" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a1067cf84b4ff81b66d2bf4d01f4cbdb5de40bd0" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
|
||||
"mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "e9fa0714fc753e1e737940577904e553ee340903" },
|
||||
"mini.nvim": { "branch": "main", "commit": "256d35c9e24c9cf5f5da568e121e988c6ceb1e3f" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-lint": { "branch": "master", "commit": "0864f81c681e15d9bdc1156fe3a17bd07db5a3ed" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b3cce1419ca67871ae782b3e529652f8a016f0de" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "6141a40173c6efa98242dc951ed4b6f892c97027" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
|
||||
"oil.nvim": { "branch": "master", "commit": "07f80ad645895af849a597d1cac897059d89b686" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "de495fabe171d48aed5525f002d14414efcecbb2" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "9ab9dade85d8c7d411cc89b592028da3d1b7955a" },
|
||||
"rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" },
|
||||
"solarized-osaka.nvim": { "branch": "main", "commit": "f796014c14b1910e08d42cc2077fef34f08e0295" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "14fd5ff7f84027064724ec3157fe903199e77ded" },
|
||||
"undotree": { "branch": "master", "commit": "fe9a9d0645f0f5532360b5e5f5c550d7bb4f1869" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }
|
||||
}
|
||||
|
|
@ -32,7 +32,85 @@ function M.setup(opts)
|
|||
M.load("keymaps")
|
||||
M.load("clipboard")
|
||||
|
||||
require("lazy").setup("juancwu.plugins")
|
||||
-- Build step hooks (must be set up before vim.pack.add)
|
||||
vim.api.nvim_create_autocmd("PackChanged", {
|
||||
callback = function(ev)
|
||||
if ev.data.name == "nvim-treesitter" then
|
||||
vim.cmd(":TSUpdate")
|
||||
elseif ev.data.name == "telescope-fzf-native.nvim" then
|
||||
vim.system({ "make" }, { cwd = ev.data.path })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Add all plugins via built-in plugin manager
|
||||
vim.pack.add({
|
||||
-- Completion
|
||||
"https://github.com/saghen/blink.cmp",
|
||||
"https://github.com/rafamadriz/friendly-snippets",
|
||||
|
||||
-- LSP
|
||||
"https://github.com/neovim/nvim-lspconfig",
|
||||
"https://github.com/williamboman/mason.nvim",
|
||||
"https://github.com/williamboman/mason-lspconfig.nvim",
|
||||
"https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
"https://github.com/j-hui/fidget.nvim",
|
||||
|
||||
-- Treesitter
|
||||
"https://github.com/nvim-treesitter/nvim-treesitter",
|
||||
"https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
|
||||
|
||||
-- Telescope
|
||||
"https://github.com/nvim-telescope/telescope.nvim",
|
||||
"https://github.com/nvim-telescope/telescope-fzf-native.nvim",
|
||||
"https://github.com/nvim-telescope/telescope-file-browser.nvim",
|
||||
"https://github.com/nvim-telescope/telescope-ui-select.nvim",
|
||||
|
||||
-- Editor
|
||||
"https://github.com/numToStr/Comment.nvim",
|
||||
"https://github.com/JoosepAlviste/nvim-ts-context-commentstring",
|
||||
"https://github.com/windwp/nvim-autopairs",
|
||||
"https://github.com/windwp/nvim-ts-autotag",
|
||||
"https://github.com/stevearc/conform.nvim",
|
||||
"https://github.com/mfussenegger/nvim-lint",
|
||||
"https://github.com/echasnovski/mini.indentscope",
|
||||
"https://github.com/mbbill/undotree",
|
||||
"https://github.com/folke/todo-comments.nvim",
|
||||
"https://github.com/folke/which-key.nvim",
|
||||
"https://github.com/stevearc/oil.nvim",
|
||||
"https://github.com/MeanderingProgrammer/render-markdown.nvim",
|
||||
|
||||
-- Git
|
||||
"https://github.com/tpope/vim-fugitive",
|
||||
"https://github.com/lewis6991/gitsigns.nvim",
|
||||
|
||||
-- Terminal
|
||||
"https://github.com/akinsho/toggleterm.nvim",
|
||||
|
||||
-- UI / Statusline
|
||||
"https://github.com/nvim-lualine/lualine.nvim",
|
||||
|
||||
-- Colorschemes
|
||||
{ src = "https://github.com/catppuccin/nvim", name = "catppuccin" },
|
||||
{ src = "https://github.com/rose-pine/nvim", name = "rose-pine" },
|
||||
"https://github.com/navarasu/onedark.nvim",
|
||||
"https://github.com/craftzdog/solarized-osaka.nvim",
|
||||
"https://github.com/folke/tokyonight.nvim",
|
||||
"https://github.com/rebelot/kanagawa.nvim",
|
||||
|
||||
-- Lua dev
|
||||
"https://github.com/folke/lazydev.nvim",
|
||||
"https://github.com/Bilal2453/luvit-meta",
|
||||
|
||||
-- Shared dependencies
|
||||
"https://github.com/nvim-lua/plenary.nvim",
|
||||
"https://github.com/nvim-tree/nvim-web-devicons",
|
||||
"https://github.com/echasnovski/mini.icons",
|
||||
"https://github.com/echasnovski/mini.nvim",
|
||||
})
|
||||
|
||||
-- Configure all plugins
|
||||
require("juancwu.plugins")
|
||||
|
||||
-- try to load colorscheme
|
||||
xpcall(function()
|
||||
|
|
|
|||
|
|
@ -1,139 +1,18 @@
|
|||
-- return { -- Autocompletion
|
||||
-- "hrsh7th/nvim-cmp",
|
||||
-- event = "InsertEnter",
|
||||
-- dependencies = {
|
||||
-- -- Snippet Engine & its associated nvim-cmp source
|
||||
-- {
|
||||
-- "L3MON4D3/LuaSnip",
|
||||
-- build = (function()
|
||||
-- -- Build Step is needed for regex support in snippets.
|
||||
-- -- This step is not supported in many windows environments.
|
||||
-- -- Remove the below condition to re-enable on windows.
|
||||
-- if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||
-- return
|
||||
-- end
|
||||
-- return "make install_jsregexp"
|
||||
-- end)(),
|
||||
-- dependencies = {
|
||||
-- {
|
||||
-- "rafamadriz/friendly-snippets",
|
||||
-- config = function()
|
||||
-- require("luasnip.loaders.from_vscode").lazy_load()
|
||||
-- end,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- "saadparwaiz1/cmp_luasnip",
|
||||
-- "hrsh7th/cmp-nvim-lsp",
|
||||
-- "hrsh7th/cmp-path",
|
||||
-- },
|
||||
-- config = function()
|
||||
-- -- See `:help cmp`
|
||||
-- local cmp = require("cmp")
|
||||
-- local luasnip = require("luasnip")
|
||||
-- luasnip.config.setup({})
|
||||
--
|
||||
-- cmp.setup({
|
||||
-- snippet = {
|
||||
-- expand = function(args)
|
||||
-- luasnip.lsp_expand(args.body)
|
||||
-- end,
|
||||
-- },
|
||||
-- completion = { completeopt = "menu,menuone,noinsert" },
|
||||
--
|
||||
-- -- For an understanding of why these mappings were
|
||||
-- -- chosen, you will need to read `:help ins-completion`
|
||||
-- --
|
||||
-- -- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||
-- mapping = cmp.mapping.preset.insert({
|
||||
-- -- Select the [n]ext item
|
||||
-- ["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
-- -- Select the [p]revious item
|
||||
-- ["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
--
|
||||
-- -- Scroll the documentation window [b]ack / [f]orward
|
||||
-- ["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
-- ["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
--
|
||||
-- -- Accept ([y]es) the completion.
|
||||
-- -- This will auto-import if your LSP supports it.
|
||||
-- -- This will expand snippets if the LSP sent a snippet.
|
||||
-- ["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
--
|
||||
-- -- Manually trigger a completion from nvim-cmp.
|
||||
-- -- Generally you don't need this, because nvim-cmp will display
|
||||
-- -- completions whenever it has completion options available.
|
||||
-- ["<C-Space>"] = cmp.mapping.complete({}),
|
||||
--
|
||||
-- -- <c-l> will move you to the right of each of the expansion locations.
|
||||
-- -- <c-h> is similar, except moving you backwards.
|
||||
-- ["<C-l>"] = cmp.mapping(function()
|
||||
-- if luasnip.expand_or_locally_jumpable() then
|
||||
-- luasnip.expand_or_jump()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- ["<C-h>"] = cmp.mapping(function()
|
||||
-- if luasnip.locally_jumpable(-1) then
|
||||
-- luasnip.jump(-1)
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- }),
|
||||
-- sources = {
|
||||
-- {
|
||||
-- name = "lazydev",
|
||||
-- -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
||||
-- group_index = 0,
|
||||
-- },
|
||||
-- { name = "nvim_lsp" },
|
||||
-- { name = "luasnip" },
|
||||
-- { name = "path" },
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- }
|
||||
--
|
||||
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
version = "1.*",
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = "enter" },
|
||||
signature = {
|
||||
enabled = true,
|
||||
},
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = true } },
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
require("blink.cmp").setup({
|
||||
keymap = { preset = "enter" },
|
||||
signature = {
|
||||
enabled = true,
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
}
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
completion = { documentation = { auto_show = true } },
|
||||
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
|
||||
fuzzy = { implementation = "lua" },
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,11 +1 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
dependencies = { "hrsh7th/nvim-cmp" },
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({})
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp = require("cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
require("nvim-autopairs").setup({})
|
||||
|
|
|
|||
|
|
@ -1,31 +1,4 @@
|
|||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
||||
ft = {
|
||||
"html",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"svelte",
|
||||
"vue",
|
||||
"tsx",
|
||||
"jsx",
|
||||
"xml",
|
||||
"php",
|
||||
"markdown",
|
||||
"astro",
|
||||
"glimmer",
|
||||
"handlebars",
|
||||
"hbs",
|
||||
"templ",
|
||||
"blade",
|
||||
},
|
||||
config = function()
|
||||
local autotag = require("nvim-ts-autotag")
|
||||
autotag.setup({
|
||||
enable = true,
|
||||
enable_close_on_slash = false,
|
||||
})
|
||||
end,
|
||||
}
|
||||
require("nvim-ts-autotag").setup({
|
||||
enable = true,
|
||||
enable_close_on_slash = false,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,48 +1,12 @@
|
|||
return {
|
||||
-- rose-pine
|
||||
{
|
||||
"rose-pine/nvim",
|
||||
name = "rose-pine",
|
||||
priority = 1000,
|
||||
},
|
||||
require("solarized-osaka").setup({
|
||||
transparent = false,
|
||||
})
|
||||
|
||||
-- onedark
|
||||
{
|
||||
"navarasu/onedark.nvim",
|
||||
priority = 1000,
|
||||
},
|
||||
require("tokyonight").setup({ style = "moon" })
|
||||
|
||||
-- solarized-osaka
|
||||
{
|
||||
"craftzdog/solarized-osaka.nvim",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
transparent = false,
|
||||
},
|
||||
},
|
||||
require("catppuccin").setup({
|
||||
flavour = "mocha",
|
||||
integrations = { blink_cmp = true },
|
||||
})
|
||||
|
||||
-- tokyonight
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = true,
|
||||
opts = { style = "moon" },
|
||||
},
|
||||
|
||||
-- catppuccin
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
lazy = true,
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
flavour = "mocha",
|
||||
integrations = { blink_cmp = true },
|
||||
},
|
||||
},
|
||||
|
||||
-- great kanagawa
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
require("kanagawa").setup({})
|
||||
|
|
|
|||
|
|
@ -1,38 +1,26 @@
|
|||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
opts = {
|
||||
enable_autocmd = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local comment = require("Comment")
|
||||
comment.setup({
|
||||
pre_hook = function(ctx)
|
||||
-- only for tsx/jsx filetypes
|
||||
if vim.bo.filetype == "typescriptreact" or vim.bo.filetype == "javascriptreact" then
|
||||
local U = require("Comment.utils")
|
||||
require("ts_context_commentstring").setup({
|
||||
enable_autocmd = false,
|
||||
})
|
||||
|
||||
-- determine wheter to use linwise or blockwise commentstring
|
||||
local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline"
|
||||
local comment = require("Comment")
|
||||
comment.setup({
|
||||
pre_hook = function(ctx)
|
||||
if vim.bo.filetype == "typescriptreact" or vim.bo.filetype == "javascriptreact" then
|
||||
local U = require("Comment.utils")
|
||||
|
||||
-- determine the location where to calcualte commentstring from
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.blockwise then
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline"
|
||||
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring({
|
||||
key = type,
|
||||
location = location,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.blockwise then
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring({
|
||||
key = type,
|
||||
location = location,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -19,59 +19,46 @@ local formatters_by_ft = {
|
|||
blade = { "blade-formatter" },
|
||||
}
|
||||
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre", "BufEnter" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ff",
|
||||
function()
|
||||
require("conform").format({ async = true, lsp_format = "fallback" })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[F]ormat buffer",
|
||||
require("conform").setup({
|
||||
notify_on_error = false,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
formatters = {
|
||||
pint = {
|
||||
command = "vendor/bin/pint",
|
||||
args = { "$FILENAME" },
|
||||
stdin = false,
|
||||
},
|
||||
["blade-formatter"] = {
|
||||
command = "blade-formatter",
|
||||
args = {
|
||||
"--write",
|
||||
"--stdin",
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
notify_on_error = false,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
formatters = {
|
||||
pint = {
|
||||
command = "vendor/bin/pint",
|
||||
args = { "$FILENAME" },
|
||||
stdin = false,
|
||||
},
|
||||
["blade-formatter"] = {
|
||||
command = "blade-formatter",
|
||||
args = {
|
||||
"--write",
|
||||
"--stdin",
|
||||
},
|
||||
},
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return {
|
||||
timeout_ms = 2500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("FormatDisable", function()
|
||||
vim.g.disable_autoformat = true
|
||||
end, {
|
||||
desc = "Disable autoformat on save",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = "Enable autoformat on save",
|
||||
})
|
||||
format_on_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return {
|
||||
timeout_ms = 2500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set("", "<leader>ff", function()
|
||||
require("conform").format({ async = true, lsp_format = "fallback" })
|
||||
end, { desc = "[F]ormat buffer" })
|
||||
|
||||
vim.api.nvim_create_user_command("FormatDisable", function()
|
||||
vim.g.disable_autoformat = true
|
||||
end, {
|
||||
desc = "Disable autoformat on save",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = "Enable autoformat on save",
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,23 +1,3 @@
|
|||
return {
|
||||
"tpope/vim-fugitive",
|
||||
cmd = {
|
||||
"Git",
|
||||
"G",
|
||||
"Gdiffsplit",
|
||||
"Gread",
|
||||
"Gwrite",
|
||||
"Ggrep",
|
||||
"GMove",
|
||||
"GDelete",
|
||||
"GBrowse",
|
||||
"GRemove",
|
||||
"GRename",
|
||||
"Glgrep",
|
||||
"Gedit",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>gs", "<cmd>Git<CR>", desc = "Git status" },
|
||||
{ "<leader>gbl", "<cmd>Git blame<CR>", desc = "Open [G]it [Bl]ame" },
|
||||
{ "<leader>gd", "<cmd>Gdiffsplit<CR>", desc = "Open [G]it [D]iff" },
|
||||
},
|
||||
}
|
||||
vim.keymap.set("n", "<leader>gs", "<cmd>Git<CR>", { desc = "Git status" })
|
||||
vim.keymap.set("n", "<leader>gbl", "<cmd>Git blame<CR>", { desc = "Open [G]it [Bl]ame" })
|
||||
vim.keymap.set("n", "<leader>gd", "<cmd>Gdiffsplit<CR>", { desc = "Open [G]it [D]iff" })
|
||||
|
|
|
|||
|
|
@ -1,19 +1,16 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol",
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "-" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
require("gitsigns").setup({
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol",
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
}
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "-" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
})
|
||||
|
|
|
|||
21
nvim/lua/juancwu/plugins/init.lua
Normal file
21
nvim/lua/juancwu/plugins/init.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
require("juancwu.plugins.autocomplete")
|
||||
require("juancwu.plugins.autopairs")
|
||||
require("juancwu.plugins.autotag")
|
||||
require("juancwu.plugins.colorscheme")
|
||||
require("juancwu.plugins.comment")
|
||||
require("juancwu.plugins.conform")
|
||||
require("juancwu.plugins.fugitive")
|
||||
require("juancwu.plugins.gitsigns")
|
||||
require("juancwu.plugins.lazydev")
|
||||
require("juancwu.plugins.lsp")
|
||||
require("juancwu.plugins.lualine")
|
||||
require("juancwu.plugins.mini-indentscope")
|
||||
require("juancwu.plugins.nvim-lint")
|
||||
require("juancwu.plugins.oil")
|
||||
require("juancwu.plugins.render-markdown")
|
||||
require("juancwu.plugins.telescope")
|
||||
require("juancwu.plugins.todo-comments")
|
||||
require("juancwu.plugins.toggleterm")
|
||||
require("juancwu.plugins.treesitter")
|
||||
require("juancwu.plugins.undotree")
|
||||
require("juancwu.plugins.which-key")
|
||||
|
|
@ -1,9 +1,5 @@
|
|||
return {
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = {
|
||||
library = {
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
},
|
||||
require("lazydev").setup({
|
||||
library = {
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,214 +1,173 @@
|
|||
return {
|
||||
-- lspconfig
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
require("fidget").setup({})
|
||||
require("mason").setup({})
|
||||
|
||||
{ "williamboman/mason.nvim", opts = {} },
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
-- status updates for LSP
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
map("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
|
||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
map("gI", vim.lsp.buf.implementation, "[G]oto [I]mplementation")
|
||||
map("<leader>D", vim.lsp.buf.type_definition, "Type [D]efinition")
|
||||
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
|
||||
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
||||
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" })
|
||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
map("[d", vim.diagnostic.goto_prev, "Go to previous diagnostic")
|
||||
map("]d", vim.diagnostic.goto_next, "Go to next diagnostic")
|
||||
|
||||
{ "saghen/blink.cmp" },
|
||||
},
|
||||
config = function()
|
||||
-- stole this from kickstart, great config
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
-- This is the helper function to set keymaps locally for this buffer
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||
end
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
-- Use built-in LSP for definitions (replaces deprecated Telescope function)
|
||||
map("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
-- Use Telescope for references (auto-closes on selection)
|
||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
|
||||
-- Use built-in LSP for implementation (replaces deprecated Telescope function)
|
||||
map("gI", vim.lsp.buf.implementation, "[G]oto [I]mplementation")
|
||||
|
||||
-- Use built-in LSP for type definitions (replaces deprecated Telescope function)
|
||||
map("<leader>D", vim.lsp.buf.type_definition, "Type [D]efinition")
|
||||
|
||||
-- Telescope for document symbols (this is a good use for Telescope)
|
||||
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
|
||||
|
||||
-- Telescope for workspace symbols (also a good use for Telescope)
|
||||
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
||||
|
||||
-- Built-in LSP for renaming
|
||||
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
|
||||
-- Built-in LSP for code actions
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" })
|
||||
|
||||
-- Built-in LSP for declaration
|
||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
|
||||
-- Built-in LSP for diagnostics
|
||||
map("[d", vim.diagnostic.goto_prev, "Go to previous diagnostic")
|
||||
map("]d", vim.diagnostic.goto_next, "Go to next diagnostic")
|
||||
|
||||
-- The following two autocommands are used to highlight references of the
|
||||
-- word under your cursor when your cursor rests there for a little while.
|
||||
-- See `:help CursorHold` for information about when this is executed
|
||||
--
|
||||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("blink.cmp").get_lsp_capabilities(capabilities)
|
||||
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
templ = "templ",
|
||||
},
|
||||
pattern = {
|
||||
[".*%.blade%.php"] = "blade",
|
||||
},
|
||||
})
|
||||
|
||||
local servers = {
|
||||
ts_ls = {},
|
||||
gopls = {},
|
||||
zls = {},
|
||||
rust_analyzer = {},
|
||||
templ = {
|
||||
filetypes = { "templ" },
|
||||
},
|
||||
intelephense = {},
|
||||
html = {
|
||||
filetypes = { "html", "twig", "hbs", "blade" },
|
||||
},
|
||||
emmet_ls = {
|
||||
filetypes = {
|
||||
"html",
|
||||
"typescriptreact",
|
||||
"javascriptreact",
|
||||
"css",
|
||||
"sass",
|
||||
"scss",
|
||||
"less",
|
||||
"blade",
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cssls = {},
|
||||
css_variables = {},
|
||||
tailwindcss = {
|
||||
filetypes = {
|
||||
"templ",
|
||||
"html",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"blade",
|
||||
},
|
||||
init_options = {
|
||||
userLanguages = {
|
||||
templ = "html",
|
||||
blade = "html",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, { "stylua", "yamlfmt", "biome", "goimports", "pint", "blade-formatter" })
|
||||
-- require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
||||
|
||||
local profiles = {
|
||||
base = { "yamlfmt" },
|
||||
lua = { "lua_ls", "stylua" },
|
||||
web = {
|
||||
"ts_ls",
|
||||
"tailwindcss",
|
||||
"biome",
|
||||
"intelephense",
|
||||
"templ",
|
||||
"cssls",
|
||||
"css_variables",
|
||||
"html",
|
||||
"emmet_ls",
|
||||
"pint",
|
||||
"blade-formatter",
|
||||
},
|
||||
go = { "gopls", "goimports" },
|
||||
rust = { "rust_analyzer" },
|
||||
zig = { "zls" },
|
||||
all = ensure_installed,
|
||||
}
|
||||
|
||||
vim.api.nvim_create_user_command("InstallProfile", function(opts)
|
||||
local profile_name = opts.args
|
||||
local tools = profiles[profile_name]
|
||||
|
||||
if not tools then
|
||||
print(
|
||||
"Profile '"
|
||||
.. profile_name
|
||||
.. "' not found. Available: "
|
||||
.. table.concat(vim.tbl_keys(profiles), ", ")
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
require("mason-tool-installer").setup({ ensure_installed = tools })
|
||||
vim.cmd("MasonToolsInstall")
|
||||
end, {
|
||||
desc = "Install tools for a specific profile (e.g., web, lua, go)",
|
||||
nargs = 1,
|
||||
complete = function()
|
||||
return vim.tbl_keys(profiles)
|
||||
end,
|
||||
})
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf })
|
||||
end,
|
||||
},
|
||||
})
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("blink.cmp").get_lsp_capabilities(capabilities)
|
||||
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
templ = "templ",
|
||||
},
|
||||
pattern = {
|
||||
[".*%.blade%.php"] = "blade",
|
||||
},
|
||||
})
|
||||
|
||||
local servers = {
|
||||
ts_ls = {},
|
||||
gopls = {},
|
||||
zls = {},
|
||||
rust_analyzer = {},
|
||||
templ = {
|
||||
filetypes = { "templ" },
|
||||
},
|
||||
intelephense = {},
|
||||
html = {
|
||||
filetypes = { "html", "twig", "hbs", "blade" },
|
||||
},
|
||||
emmet_ls = {
|
||||
filetypes = {
|
||||
"html",
|
||||
"typescriptreact",
|
||||
"javascriptreact",
|
||||
"css",
|
||||
"sass",
|
||||
"scss",
|
||||
"less",
|
||||
"blade",
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cssls = {},
|
||||
css_variables = {},
|
||||
tailwindcss = {
|
||||
filetypes = {
|
||||
"templ",
|
||||
"html",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"blade",
|
||||
},
|
||||
init_options = {
|
||||
userLanguages = {
|
||||
templ = "html",
|
||||
blade = "html",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, { "stylua", "yamlfmt", "biome", "goimports", "pint", "blade-formatter" })
|
||||
|
||||
local profiles = {
|
||||
base = { "yamlfmt" },
|
||||
lua = { "lua_ls", "stylua" },
|
||||
web = {
|
||||
"ts_ls",
|
||||
"tailwindcss",
|
||||
"biome",
|
||||
"intelephense",
|
||||
"templ",
|
||||
"cssls",
|
||||
"css_variables",
|
||||
"html",
|
||||
"emmet_ls",
|
||||
"pint",
|
||||
"blade-formatter",
|
||||
},
|
||||
go = { "gopls", "goimports" },
|
||||
rust = { "rust_analyzer" },
|
||||
zig = { "zls" },
|
||||
all = ensure_installed,
|
||||
}
|
||||
|
||||
vim.api.nvim_create_user_command("InstallProfile", function(opts)
|
||||
local profile_name = opts.args
|
||||
local tools = profiles[profile_name]
|
||||
|
||||
if not tools then
|
||||
print(
|
||||
"Profile '"
|
||||
.. profile_name
|
||||
.. "' not found. Available: "
|
||||
.. table.concat(vim.tbl_keys(profiles), ", ")
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
require("mason-tool-installer").setup({ ensure_installed = tools })
|
||||
vim.cmd("MasonToolsInstall")
|
||||
end, {
|
||||
desc = "Install tools for a specific profile (e.g., web, lua, go)",
|
||||
nargs = 1,
|
||||
complete = function()
|
||||
return vim.tbl_keys(profiles)
|
||||
end,
|
||||
})
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,62 +1,46 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
--[[ section_separators = {
|
||||
left = '',
|
||||
right = ''
|
||||
},
|
||||
component_separators = {
|
||||
left = '',
|
||||
right = ''
|
||||
}, ]]
|
||||
section_separators = "",
|
||||
component_separators = "|",
|
||||
disabled_filetypes = {},
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
section_separators = "",
|
||||
component_separators = "|",
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true,
|
||||
path = 1,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true, -- display file status
|
||||
path = 1, -- no file path
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = { error = " ", warn = " ", info = " ", hint = "" },
|
||||
},
|
||||
"enconding",
|
||||
"filetype",
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = { error = " ", warn = " ", info = " ", hint = "" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true,
|
||||
path = 1,
|
||||
},
|
||||
},
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
"enconding",
|
||||
"filetype",
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true,
|
||||
path = 1,
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { "fugitive" },
|
||||
})
|
||||
end,
|
||||
}
|
||||
},
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { "fugitive" },
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
return {
|
||||
"Bilal2453/luvit-meta",
|
||||
lazy = true,
|
||||
}
|
||||
23
nvim/lua/juancwu/plugins/mini-indentscope.lua
Normal file
23
nvim/lua/juancwu/plugins/mini-indentscope.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
require("mini.indentscope").setup({
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
return {
|
||||
"echasnovski/mini.indentscope",
|
||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
-- symbol = "▏",
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
enabled = false,
|
||||
branch = "v2.x",
|
||||
cmd = { "Neotree" },
|
||||
keys = {
|
||||
{ "<leader>fs", "<cmd>NeoTreeFloatToggle<CR>", desc = "Toggle [F]ile [S]ystem Floating Menu" },
|
||||
{ "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" },
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
use_default_mappings = true,
|
||||
mappings = {
|
||||
["<space>"] = {
|
||||
"toggle_node",
|
||||
nowait = true, -- disable `nowait` if you have existing combos starting with this char that you want to use
|
||||
},
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["<cr>"] = "open",
|
||||
["<esc>"] = "cancel", -- close preview or floating neo-tree window
|
||||
["P"] = { "toggle_preview", config = { use_float = true } },
|
||||
["l"] = "focus_preview",
|
||||
["O"] = "open_split",
|
||||
["o"] = "open_vsplit",
|
||||
["S"] = "none",
|
||||
["s"] = "none",
|
||||
-- ["S"] = "split_with_window_picker",
|
||||
-- ["s"] = "vsplit_with_window_picker",
|
||||
["t"] = "open_tabnew",
|
||||
-- ["<cr>"] = "open_drop",
|
||||
-- ["t"] = "open_tab_drop",
|
||||
["w"] = "open_with_window_picker",
|
||||
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
|
||||
["C"] = "close_node",
|
||||
-- ['C'] = 'close_all_subnodes',
|
||||
["z"] = "close_all_nodes",
|
||||
--["Z"] = "expand_all_nodes",
|
||||
["a"] = {
|
||||
"add",
|
||||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
|
||||
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
||||
config = {
|
||||
show_path = "none", -- "none", "relative", "absolute"
|
||||
},
|
||||
},
|
||||
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
|
||||
["d"] = "delete",
|
||||
["r"] = "rename",
|
||||
["y"] = "copy_to_clipboard",
|
||||
["x"] = "cut_to_clipboard",
|
||||
["p"] = "paste_from_clipboard",
|
||||
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
|
||||
-- ["c"] = {
|
||||
-- "copy",
|
||||
-- config = {
|
||||
-- show_path = "none" -- "none", "relative", "absolute"
|
||||
-- }
|
||||
--}
|
||||
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
|
||||
["q"] = "close_window",
|
||||
["R"] = "refresh",
|
||||
["?"] = "show_help",
|
||||
["<"] = "prev_source",
|
||||
[">"] = "next_source",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -8,7 +8,6 @@ local linters_by_ft = {
|
|||
css = { "biomejs" },
|
||||
}
|
||||
|
||||
-- Function to find the first config file by walking up the directory tree
|
||||
local function find_first_config()
|
||||
local current_dir = vim.fn.expand("%:p:h")
|
||||
local home_dir = vim.fn.expand("$HOME")
|
||||
|
|
@ -32,7 +31,6 @@ local function find_first_config()
|
|||
return nil
|
||||
end
|
||||
|
||||
-- Function to determine the linter based on config files and file type
|
||||
local function get_linter()
|
||||
local filetype = vim.bo.filetype
|
||||
local available_linters = linters_by_ft[filetype] or {}
|
||||
|
|
@ -58,27 +56,16 @@ local function lint()
|
|||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
keys = {
|
||||
{
|
||||
"<leader>lf",
|
||||
function()
|
||||
lint()
|
||||
end,
|
||||
mode = "n",
|
||||
desc = "[L]int [F]ile",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_create_user_command("Lint", function()
|
||||
lint()
|
||||
end, { desc = "Lint file" })
|
||||
vim.keymap.set("n", "<leader>lf", function()
|
||||
lint()
|
||||
end, { desc = "[L]int [F]ile" })
|
||||
|
||||
vim.api.nvim_create_user_command("LintInfo", function()
|
||||
print("Current linter: " .. (vim.g.current_linter or "none"))
|
||||
end, {
|
||||
desc = "Show current linter being used",
|
||||
})
|
||||
end,
|
||||
}
|
||||
vim.api.nvim_create_user_command("Lint", function()
|
||||
lint()
|
||||
end, { desc = "Lint file" })
|
||||
|
||||
vim.api.nvim_create_user_command("LintInfo", function()
|
||||
print("Current linter: " .. (vim.g.current_linter or "none"))
|
||||
end, {
|
||||
desc = "Show current linter being used",
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,28 +1,11 @@
|
|||
return {
|
||||
"stevearc/oil.nvim",
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
-- Optional dependencies
|
||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
config = function()
|
||||
local oil = require("oil")
|
||||
require("mini.icons").setup({})
|
||||
|
||||
oil.setup({
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>oo",
|
||||
function()
|
||||
require("oil").open()
|
||||
end,
|
||||
mode = "n",
|
||||
desc = "[O]pen [O]il",
|
||||
},
|
||||
require("oil").setup({
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>oo", function()
|
||||
require("oil").open()
|
||||
end, { desc = "[O]pen [O]il" })
|
||||
|
|
|
|||
|
|
@ -1,9 +1 @@
|
|||
return {
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {},
|
||||
}
|
||||
require("render-markdown").setup({})
|
||||
|
|
|
|||
|
|
@ -7,181 +7,157 @@ local function get_fd_command()
|
|||
return nil
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
version = "0.1.8",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
enabled = true,
|
||||
cond = function()
|
||||
return vim.fn.executable("make") == 1
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
local function telescope_buffer_dir()
|
||||
return vim.fn.expand("%:p:h")
|
||||
end
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
n = {
|
||||
["q"] = actions.close,
|
||||
},
|
||||
enabled = true,
|
||||
},
|
||||
{ "nvim-telescope/telescope-ui-select.nvim" },
|
||||
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local builtin = require("telescope.builtin")
|
||||
local fb_actions = require("telescope").extensions.file_browser.actions
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local function telescope_buffer_dir()
|
||||
return vim.fn.expand("%:p:h")
|
||||
end
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
pcall(telescope.load_extension, "ui-select")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
-- Load file_browser and configure it after loading
|
||||
if pcall(telescope.load_extension, "file_browser") then
|
||||
local fb_actions = telescope.extensions.file_browser.actions
|
||||
telescope.setup({
|
||||
extensions = {
|
||||
file_browser = {
|
||||
theme = "dropdown",
|
||||
hijack_netrw = false,
|
||||
hidden = true,
|
||||
mappings = {
|
||||
n = {
|
||||
["q"] = actions.close,
|
||||
["i"] = {
|
||||
["<C-w>"] = function()
|
||||
vim.cmd("normal vbd")
|
||||
end,
|
||||
["<C-j>"] = function(bufnr)
|
||||
actions.move_selection_next(bufnr)
|
||||
end,
|
||||
["<C-k>"] = function(bufnr)
|
||||
actions.move_selection_previous(bufnr)
|
||||
end,
|
||||
["<C-s>"] = function(bufnr)
|
||||
actions.select_vertical(bufnr)
|
||||
end,
|
||||
},
|
||||
["n"] = {
|
||||
["a"] = fb_actions.create,
|
||||
["h"] = fb_actions.goto_parent_dir,
|
||||
["/"] = function()
|
||||
vim.cmd("startinsert")
|
||||
end,
|
||||
["d"] = fb_actions.remove,
|
||||
["e"] = fb_actions.change_cwd,
|
||||
["<C-s>"] = function(bufnr)
|
||||
actions.select_vertical(bufnr)
|
||||
end,
|
||||
["<C-a>"] = function(bufnr)
|
||||
actions.toggle_all(bufnr)
|
||||
end,
|
||||
["<C-d>"] = function(bufnr)
|
||||
actions.move_selection_next(bufnr)
|
||||
end,
|
||||
["<C-u>"] = function(bufnr)
|
||||
actions.move_selection_previous(bufnr)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
file_browser = {
|
||||
theme = "dropdown",
|
||||
hijack_netrw = false,
|
||||
hidden = true,
|
||||
mappings = {
|
||||
["i"] = {
|
||||
["<C-w>"] = function()
|
||||
vim.cmd("normal vbd")
|
||||
end,
|
||||
["<C-j>"] = function(bufnr)
|
||||
actions.move_selection_next(bufnr)
|
||||
end,
|
||||
["<C-k>"] = function(bufnr)
|
||||
actions.move_selection_previous(bufnr)
|
||||
end,
|
||||
["<C-s>"] = function(bufnr)
|
||||
actions.select_vertical(bufnr)
|
||||
end,
|
||||
},
|
||||
["n"] = {
|
||||
["a"] = fb_actions.create,
|
||||
["h"] = fb_actions.goto_parent_dir,
|
||||
["/"] = function()
|
||||
vim.cmd("startinsert")
|
||||
end,
|
||||
["d"] = fb_actions.remove,
|
||||
["e"] = fb_actions.change_cwd,
|
||||
["<C-s>"] = function(bufnr)
|
||||
actions.select_vertical(bufnr)
|
||||
end,
|
||||
["<C-a>"] = function(bufnr)
|
||||
actions.toggle_all(bufnr)
|
||||
end,
|
||||
["<C-d>"] = function(bufnr)
|
||||
actions.move_selection_next(bufnr)
|
||||
end,
|
||||
["<C-u>"] = function(bufnr)
|
||||
actions.move_selection_previous(bufnr)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
pcall(telescope.load_extension, "file_browser")
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
pcall(telescope.load_extension, "ui-select")
|
||||
-- Builtin pickers
|
||||
vim.keymap.set("n", "<leader>sf", function()
|
||||
local fd_cmd = get_fd_command()
|
||||
local config = {
|
||||
hidden = true,
|
||||
file_ignore_patterns = {
|
||||
"node%_modules/.*",
|
||||
"%.git/.*",
|
||||
"%.rustup/.*",
|
||||
"target/.*",
|
||||
".devbox/.*",
|
||||
".nix/.*",
|
||||
"vendor/.*",
|
||||
"storage/.*",
|
||||
},
|
||||
}
|
||||
|
||||
-- Builtin pickers
|
||||
vim.keymap.set("n", "<leader>sf", function()
|
||||
local fd_cmd = get_fd_command()
|
||||
local config = {
|
||||
hidden = true,
|
||||
file_ignore_patterns = {
|
||||
"node%_modules/.*",
|
||||
"%.git/.*",
|
||||
"%.rustup/.*",
|
||||
"target/.*",
|
||||
".devbox/.*",
|
||||
".nix/.*",
|
||||
"vendor/.*",
|
||||
"storage/.*",
|
||||
},
|
||||
}
|
||||
if fd_cmd then
|
||||
config.find_command = {
|
||||
fd_cmd,
|
||||
"--type",
|
||||
"f",
|
||||
"--color",
|
||||
"never",
|
||||
"--hidden",
|
||||
"--no-ignore",
|
||||
}
|
||||
end
|
||||
|
||||
if fd_cmd then
|
||||
config.find_command = {
|
||||
fd_cmd,
|
||||
"--type",
|
||||
"f",
|
||||
"--color",
|
||||
"never",
|
||||
"--hidden",
|
||||
"--no-ignore",
|
||||
}
|
||||
end
|
||||
builtin.find_files(config)
|
||||
end, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp Tags" })
|
||||
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch [B]uffers" })
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
|
||||
builtin.find_files(config)
|
||||
end, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp Tags" })
|
||||
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch [B]uffers" })
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
-- vim.keymap.set("n", "gr", builtin.lsp_references, { desc = "[G]o to [R]eferences", noremap = true })
|
||||
-- vim.keymap.set("n", "gd", builtin.lsp_definitions, { desc = "[G]o to [D]efinitions" })
|
||||
-- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "[G]o to [D]eclaration" })
|
||||
-- vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e[N]ame" })
|
||||
-- Git pickers
|
||||
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
|
||||
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "List [G]it [S]tatus" })
|
||||
vim.keymap.set("n", "<leader>gh", builtin.git_stash, { desc = "List [G]it [S]tash" })
|
||||
vim.keymap.set("n", "<leader>gbb", builtin.git_branches, { desc = "List [G]it [B]ranches" })
|
||||
vim.keymap.set("n", "<leader>gc", builtin.git_bcommits, { desc = "List Buffer [G]it [C]ommits" })
|
||||
|
||||
-- Git pickers
|
||||
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
|
||||
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "List [G]it [S]tatus" })
|
||||
vim.keymap.set("n", "<leader>gh", builtin.git_stash, { desc = "List [G]it [S]tash" })
|
||||
vim.keymap.set("n", "<leader>gbb", builtin.git_branches, { desc = "List [G]it [B]ranches" })
|
||||
vim.keymap.set("n", "<leader>gc", builtin.git_bcommits, { desc = "List Buffer [G]it [C]ommits" })
|
||||
-- File Browser Ext
|
||||
vim.keymap.set("n", "<leader>fs", function()
|
||||
telescope.extensions.file_browser.file_browser({
|
||||
path = "%:p:h",
|
||||
cwd = telescope_buffer_dir(),
|
||||
respect_gitignore = false,
|
||||
hidden = true,
|
||||
grouped = true,
|
||||
previewer = false,
|
||||
initial_mode = "normal",
|
||||
layout_config = { height = 40 },
|
||||
})
|
||||
end, { desc = "Open [F]ile [S]ystem Menu" })
|
||||
|
||||
-- File Browser Ext
|
||||
vim.keymap.set("n", "<leader>fs", function()
|
||||
telescope.extensions.file_browser.file_browser({
|
||||
path = "%:p:h",
|
||||
cwd = telescope_buffer_dir(),
|
||||
respect_gitignore = false,
|
||||
hidden = true,
|
||||
grouped = true,
|
||||
previewer = false,
|
||||
initial_mode = "normal",
|
||||
layout_config = { height = 40 },
|
||||
})
|
||||
end, { desc = "Open [F]ile [S]ystem Menu" })
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily serach in current buffer" })
|
||||
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily serach in current buffer" })
|
||||
-- live grep in open files only
|
||||
vim.keymap.set("n", "<leader>s/", function()
|
||||
builtin.live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]search [/] in Open Files" })
|
||||
|
||||
-- live grep in open files only
|
||||
vim.keymap.set("n", "<leader>s/", function()
|
||||
builtin.live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]search [/] in Open Files" })
|
||||
|
||||
-- shortcut for searching neovim config files
|
||||
vim.keymap.set("n", "<leader>sn", function()
|
||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end, { desc = "[S]earch [N]eovim files" })
|
||||
end,
|
||||
}
|
||||
-- shortcut for searching neovim config files
|
||||
vim.keymap.set("n", "<leader>sn", function()
|
||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end, { desc = "[S]earch [N]eovim files" })
|
||||
|
|
|
|||
|
|
@ -1,5 +1 @@
|
|||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {},
|
||||
}
|
||||
require("todo-comments").setup({})
|
||||
|
|
|
|||
|
|
@ -1,51 +1,42 @@
|
|||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
keys = {
|
||||
{
|
||||
"<leader>lg",
|
||||
function()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "double",
|
||||
},
|
||||
on_open = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
on_close = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
})
|
||||
lazygit:toggle()
|
||||
end,
|
||||
desc = "Open lazygit in a floating window",
|
||||
require("toggleterm").setup({
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
terminal_mappings = true,
|
||||
persist_size = true,
|
||||
persist_mode = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
terminal_mappings = true,
|
||||
persist_size = true,
|
||||
persist_mode = true,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>lg", function()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
border = "double",
|
||||
},
|
||||
},
|
||||
}
|
||||
on_open = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
on_close = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
})
|
||||
lazygit:toggle()
|
||||
end, { desc = "Open lazygit in a floating window" })
|
||||
|
|
|
|||
|
|
@ -1,100 +1,80 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = {
|
||||
"BufReadPost",
|
||||
"BufNewFile",
|
||||
require("nvim-treesitter.config").setup({
|
||||
ensure_installed = {
|
||||
"vimdoc",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"c",
|
||||
"lua",
|
||||
"rust",
|
||||
"go",
|
||||
"gosum",
|
||||
"gomod",
|
||||
"php",
|
||||
"blade",
|
||||
},
|
||||
branch = "master",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
treesitter.setup({
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"vimdoc",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"c",
|
||||
"lua",
|
||||
"rust",
|
||||
"go",
|
||||
"gosum",
|
||||
"gomod",
|
||||
"php",
|
||||
"blade",
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<leader>c",
|
||||
node_incremental = "<C-p>",
|
||||
scope_incremental = "<C-s>",
|
||||
node_decremental = "<M-p>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
auto_install = true,
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true,
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<leader>c",
|
||||
node_incremental = "<C-p>",
|
||||
scope_incremental = "<C-s>",
|
||||
node_decremental = "<M-p>",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>]"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>["] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
autotag = {
|
||||
enable = false,
|
||||
enable_close_on_slash = false,
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>]"] = "@parameter.inner",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
swap_previous = {
|
||||
["<leader>["] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
autotag = {
|
||||
enable = false,
|
||||
enable_close_on_slash = false,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,22 +1,16 @@
|
|||
return {
|
||||
"mbbill/undotree",
|
||||
keys = {
|
||||
{ "<leader>u", "<cmd>UndotreeToggle<CR>", desc = "Toggle Undotree" },
|
||||
},
|
||||
config = function()
|
||||
local has_persistent_undo = vim.api.nvim_call_function("has", { "persistent_undo" })
|
||||
local has_persistent_undo = vim.api.nvim_call_function("has", { "persistent_undo" })
|
||||
|
||||
if has_persistent_undo then
|
||||
local target_path = vim.api.nvim_call_function("expand", { "~/.undodir" })
|
||||
if has_persistent_undo then
|
||||
local target_path = vim.api.nvim_call_function("expand", { "~/.undodir" })
|
||||
|
||||
local is_directory = vim.api.nvim_call_function("isdirectory", { target_path })
|
||||
local is_directory = vim.api.nvim_call_function("isdirectory", { target_path })
|
||||
|
||||
if not is_directory then
|
||||
vim.api.nvim_call_function("mkdir", { target_path, "p", 0700 })
|
||||
end
|
||||
if not is_directory then
|
||||
vim.api.nvim_call_function("mkdir", { target_path, "p", 0700 })
|
||||
end
|
||||
|
||||
vim.opt.undodir = target_path
|
||||
vim.opt.undofile = true
|
||||
end
|
||||
end,
|
||||
}
|
||||
vim.opt.undodir = target_path
|
||||
vim.opt.undofile = true
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<CR>", { desc = "Toggle Undotree" })
|
||||
|
|
|
|||
|
|
@ -1,49 +1,39 @@
|
|||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
vim.opt.timeout = true
|
||||
vim.opt.timeoutlen = 300
|
||||
vim.opt.timeout = true
|
||||
vim.opt.timeoutlen = 300
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.setup({
|
||||
delay = 0,
|
||||
icons = {
|
||||
mappings = vim.g.have_nerd_font,
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = "<Up> ",
|
||||
Down = "<Down> ",
|
||||
Left = "<Left> ",
|
||||
Right = "<Right> ",
|
||||
C = "<C-…> ",
|
||||
M = "<M-…> ",
|
||||
D = "<D-…> ",
|
||||
S = "<S-…> ",
|
||||
CR = "<CR> ",
|
||||
Esc = "<Esc> ",
|
||||
ScrollWheelDown = "<ScrollWheelDown> ",
|
||||
ScrollWheelUp = "<ScrollWheelUp> ",
|
||||
NL = "<NL> ",
|
||||
BS = "<BS> ",
|
||||
Space = "<Space> ",
|
||||
Tab = "<Tab> ",
|
||||
F1 = "<F1>",
|
||||
F2 = "<F2>",
|
||||
F3 = "<F3>",
|
||||
F4 = "<F4>",
|
||||
F5 = "<F5>",
|
||||
F6 = "<F6>",
|
||||
F7 = "<F7>",
|
||||
F8 = "<F8>",
|
||||
F9 = "<F9>",
|
||||
F10 = "<F10>",
|
||||
F11 = "<F11>",
|
||||
F12 = "<F12>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
require("which-key").setup({
|
||||
delay = 0,
|
||||
icons = {
|
||||
mappings = vim.g.have_nerd_font,
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = "<Up> ",
|
||||
Down = "<Down> ",
|
||||
Left = "<Left> ",
|
||||
Right = "<Right> ",
|
||||
C = "<C-…> ",
|
||||
M = "<M-…> ",
|
||||
D = "<D-…> ",
|
||||
S = "<S-…> ",
|
||||
CR = "<CR> ",
|
||||
Esc = "<Esc> ",
|
||||
ScrollWheelDown = "<ScrollWheelDown> ",
|
||||
ScrollWheelUp = "<ScrollWheelUp> ",
|
||||
NL = "<NL> ",
|
||||
BS = "<BS> ",
|
||||
Space = "<Space> ",
|
||||
Tab = "<Tab> ",
|
||||
F1 = "<F1>",
|
||||
F2 = "<F2>",
|
||||
F3 = "<F3>",
|
||||
F4 = "<F4>",
|
||||
F5 = "<F5>",
|
||||
F6 = "<F6>",
|
||||
F7 = "<F7>",
|
||||
F8 = "<F8>",
|
||||
F9 = "<F9>",
|
||||
F10 = "<F10>",
|
||||
F11 = "<F11>",
|
||||
F12 = "<F12>",
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
|||
168
nvim/nvim-pack-lock.json
Normal file
168
nvim/nvim-pack-lock.json
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
{
|
||||
"plugins": {
|
||||
"Comment.nvim": {
|
||||
"rev": "e30b7f2008e52442154b66f7c519bfd2f1e32acb",
|
||||
"src": "https://github.com/numToStr/Comment.nvim"
|
||||
},
|
||||
"blink.cmp": {
|
||||
"rev": "456d38d1cd3743926f329204c2340f3e7840aad6",
|
||||
"src": "https://github.com/saghen/blink.cmp"
|
||||
},
|
||||
"catppuccin": {
|
||||
"rev": "426dbebe06b5c69fd846ceb17b42e12f890aedf1",
|
||||
"src": "https://github.com/catppuccin/nvim"
|
||||
},
|
||||
"conform.nvim": {
|
||||
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
},
|
||||
"fidget.nvim": {
|
||||
"rev": "889e2e96edef4e144965571d46f7a77bcc4d0ddf",
|
||||
"src": "https://github.com/j-hui/fidget.nvim"
|
||||
},
|
||||
"friendly-snippets": {
|
||||
"rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9",
|
||||
"src": "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
"gitsigns.nvim": {
|
||||
"rev": "8d82c240f190fc33723d48c308ccc1ed8baad69d",
|
||||
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
"kanagawa.nvim": {
|
||||
"rev": "aef7f5cec0a40dbe7f3304214850c472e2264b10",
|
||||
"src": "https://github.com/rebelot/kanagawa.nvim"
|
||||
},
|
||||
"lazydev.nvim": {
|
||||
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
|
||||
"src": "https://github.com/folke/lazydev.nvim"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"rev": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c",
|
||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
"luvit-meta": {
|
||||
"rev": "cc9b2d412d2fbd30b94a70cfc214c2a3be27a0a2",
|
||||
"src": "https://github.com/Bilal2453/luvit-meta"
|
||||
},
|
||||
"mason-lspconfig.nvim": {
|
||||
"rev": "0a3b42c3e503df87aef6d6513e13148381495c3a",
|
||||
"src": "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
"mason-tool-installer.nvim": {
|
||||
"rev": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc",
|
||||
"src": "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim"
|
||||
},
|
||||
"mason.nvim": {
|
||||
"rev": "b03fb0f20bc1d43daf558cda981a2be22e73ac42",
|
||||
"src": "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
"mini.icons": {
|
||||
"rev": "7fdae2443a0e2910015ca39ad74b50524ee682d3",
|
||||
"src": "https://github.com/echasnovski/mini.icons"
|
||||
},
|
||||
"mini.indentscope": {
|
||||
"rev": "e0601f75aa5137a5a13bb92a988c9a300f5bd3de",
|
||||
"src": "https://github.com/echasnovski/mini.indentscope"
|
||||
},
|
||||
"mini.nvim": {
|
||||
"rev": "c67822c53e8e282fe863343e88aa0a8ca3534059",
|
||||
"src": "https://github.com/echasnovski/mini.nvim"
|
||||
},
|
||||
"nvim-autopairs": {
|
||||
"rev": "59bce2eef357189c3305e25bc6dd2d138c1683f5",
|
||||
"src": "https://github.com/windwp/nvim-autopairs"
|
||||
},
|
||||
"nvim-lint": {
|
||||
"rev": "eab58b48eb11d7745c11c505e0f3057165902461",
|
||||
"src": "https://github.com/mfussenegger/nvim-lint"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "3c156abc4f7912f66d8687512d75b939b14fbc42",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
"nvim-treesitter-textobjects": {
|
||||
"rev": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"
|
||||
},
|
||||
"nvim-ts-autotag": {
|
||||
"rev": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595",
|
||||
"src": "https://github.com/windwp/nvim-ts-autotag"
|
||||
},
|
||||
"nvim-ts-context-commentstring": {
|
||||
"rev": "6141a40173c6efa98242dc951ed4b6f892c97027",
|
||||
"src": "https://github.com/JoosepAlviste/nvim-ts-context-commentstring"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"oil.nvim": {
|
||||
"rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e",
|
||||
"src": "https://github.com/stevearc/oil.nvim"
|
||||
},
|
||||
"onedark.nvim": {
|
||||
"rev": "213c23ae45a04797572242568d5d51937181792d",
|
||||
"src": "https://github.com/navarasu/onedark.nvim"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"render-markdown.nvim": {
|
||||
"rev": "54d4b5431e9634ee3d8d30784e017239b5b89d41",
|
||||
"src": "https://github.com/MeanderingProgrammer/render-markdown.nvim"
|
||||
},
|
||||
"rose-pine": {
|
||||
"rev": "9504524e5ed0e326534698f637f9d038ba4cd0ee",
|
||||
"src": "https://github.com/rose-pine/nvim"
|
||||
},
|
||||
"solarized-osaka.nvim": {
|
||||
"rev": "f0c2f0ba0bd56108d53c9bfae4bb28ff6c67bbdb",
|
||||
"src": "https://github.com/craftzdog/solarized-osaka.nvim"
|
||||
},
|
||||
"telescope-file-browser.nvim": {
|
||||
"rev": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e",
|
||||
"src": "https://github.com/nvim-telescope/telescope-file-browser.nvim"
|
||||
},
|
||||
"telescope-fzf-native.nvim": {
|
||||
"rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c",
|
||||
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
"telescope-ui-select.nvim": {
|
||||
"rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2",
|
||||
"src": "https://github.com/nvim-telescope/telescope-ui-select.nvim"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "f7c673b8e46e8f233ff581d3624a517d33a7e264",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
"todo-comments.nvim": {
|
||||
"rev": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668",
|
||||
"src": "https://github.com/folke/todo-comments.nvim"
|
||||
},
|
||||
"toggleterm.nvim": {
|
||||
"rev": "9a88eae817ef395952e08650b3283726786fb5fb",
|
||||
"src": "https://github.com/akinsho/toggleterm.nvim"
|
||||
},
|
||||
"tokyonight.nvim": {
|
||||
"rev": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6",
|
||||
"src": "https://github.com/folke/tokyonight.nvim"
|
||||
},
|
||||
"undotree": {
|
||||
"rev": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d",
|
||||
"src": "https://github.com/mbbill/undotree"
|
||||
},
|
||||
"vim-fugitive": {
|
||||
"rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0",
|
||||
"src": "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
"which-key.nvim": {
|
||||
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
|
||||
"src": "https://github.com/folke/which-key.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue