config rewrite
This commit is contained in:
parent
032e19a05f
commit
d3a498eb82
@ -1,8 +1,8 @@
|
|||||||
-- Highlight on yank
|
-- Highlight on yank
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
desc = 'Highlight when yanking (copying) text',
|
desc = 'Highlight when yanking (copying) text',
|
||||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank()
|
vim.highlight.on_yank()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -24,16 +24,17 @@ lazy.setup({
|
|||||||
},
|
},
|
||||||
defaults = {
|
defaults = {
|
||||||
lazy = false,
|
lazy = false,
|
||||||
version = false,
|
version = "*",
|
||||||
},
|
},
|
||||||
install = { colorscheme = { "moonfly", "wildcharm" } },
|
install = { colorscheme = { "moonfly", "wildcharm" } },
|
||||||
checker = { enabled = true, notify = false },
|
checker = { enabled = true, notify = false },
|
||||||
|
change_detection = { notify = false },
|
||||||
performance = {
|
performance = {
|
||||||
rtp = {
|
rtp = {
|
||||||
disabled_plugins = {
|
disabled_plugins = {
|
||||||
"gzip",
|
"gzip",
|
||||||
-- "matchit",
|
"matchit",
|
||||||
-- "matchparen",
|
"matchparen",
|
||||||
"netrwPlugin",
|
"netrwPlugin",
|
||||||
"tarPlugin",
|
"tarPlugin",
|
||||||
"tohtml",
|
"tohtml",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Leader
|
-- Leader
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = " "
|
||||||
vim.opt.timeoutlen = 300
|
vim.opt.timeoutlen = 300
|
||||||
|
|
||||||
-- Numbers
|
-- Numbers
|
||||||
@ -8,11 +8,11 @@ vim.opt.number = true
|
|||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
-- Mouse
|
-- Mouse
|
||||||
vim.opt.mouse = 'a'
|
vim.opt.mouse = "a"
|
||||||
|
|
||||||
-- Use system clipboard
|
-- Use system clipboard
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.opt.clipboard = 'unnamedplus'
|
vim.opt.clipboard = "unnamedplus"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Indent
|
-- Indent
|
||||||
@ -27,7 +27,7 @@ vim.opt.ignorecase = true
|
|||||||
vim.opt.smartcase = true
|
vim.opt.smartcase = true
|
||||||
|
|
||||||
-- UI
|
-- UI
|
||||||
vim.opt.signcolumn = 'yes'
|
vim.opt.signcolumn = "yes"
|
||||||
vim.opt.scrolloff = 5
|
vim.opt.scrolloff = 5
|
||||||
vim.opt.wrap = false
|
vim.opt.wrap = false
|
||||||
|
|
||||||
@ -37,10 +37,11 @@ vim.opt.splitbelow = true
|
|||||||
|
|
||||||
-- Whitespaces
|
-- Whitespaces
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
-- vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||||
|
vim.opt.listchars = { tab = "▎ ", trail = "·", nbsp = "␣" }
|
||||||
|
|
||||||
-- Preview substitutions
|
-- Preview substitutions
|
||||||
vim.opt.inccommand = 'split'
|
vim.opt.inccommand = "split"
|
||||||
|
|
||||||
-- Colors
|
-- Colors
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
return {
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
event = "InsertEnter",
|
|
||||||
opts = {},
|
|
||||||
}
|
|
@ -1,27 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
dependencies = "rafamadriz/friendly-snippets",
|
dependencies = "rafamadriz/friendly-snippets",
|
||||||
version = "*",
|
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
---@module 'blink.cmp'
|
|
||||||
---@type blink.cmp.Config
|
|
||||||
opts = {
|
opts = {
|
||||||
keymap = {
|
keymap = { preset = "enter" },
|
||||||
preset = "enter",
|
completion = { documentation = { auto_show = true } },
|
||||||
},
|
|
||||||
appearance = {
|
|
||||||
use_nvim_cmp_as_default = false,
|
|
||||||
nerd_font_variant = "mono",
|
|
||||||
},
|
|
||||||
completion = {
|
|
||||||
documentation = {
|
|
||||||
auto_show = true,
|
|
||||||
auto_show_delay_ms = 500,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
default = { "lsp", "path", "snippets", "buffer" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
opts_extend = { "sources.default" },
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
version = "*",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
|
13
lua/plugins/flash.lua
Normal file
13
lua/plugins/flash.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
"folke/flash.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||||
|
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||||
|
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||||
|
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||||
|
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||||
|
},
|
||||||
|
}
|
@ -2,11 +2,12 @@ return {
|
|||||||
"ibhagwan/fzf-lua",
|
"ibhagwan/fzf-lua",
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
opts = {},
|
||||||
|
config = function(_, opts)
|
||||||
local fzf_lua = require("fzf-lua")
|
local fzf_lua = require("fzf-lua")
|
||||||
|
|
||||||
-- Setup
|
-- Setup
|
||||||
fzf_lua.setup({})
|
fzf_lua.setup(opts)
|
||||||
|
|
||||||
-- Register as the UI for vim.ui.select
|
-- Register as the UI for vim.ui.select
|
||||||
fzf_lua.register_ui_select()
|
fzf_lua.register_ui_select()
|
||||||
|
5
lua/plugins/gitsigns.lua
Normal file
5
lua/plugins/gitsigns.lua
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
opts = {},
|
||||||
|
}
|
@ -1,6 +1,15 @@
|
|||||||
return {
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
dependencies = { "williamboman/mason.nvim", "neovim/nvim-lspconfig" },
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
opts = {
|
||||||
|
ensure_installed = { "lua_ls" },
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
|
lazy = true,
|
||||||
cmd = "Mason",
|
cmd = "Mason",
|
||||||
keys = { { "<Leader>cm", "<cmd>Mason<cr>" } },
|
keys = { { "<Leader>cm", "<cmd>Mason<cr>" } },
|
||||||
opts = {
|
opts = {
|
||||||
@ -13,45 +22,46 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
dependencies = { "williamboman/mason.nvim" },
|
|
||||||
opts = {
|
|
||||||
ensure_installed = { "lua_ls", "gopls" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
lazy = true,
|
||||||
cmd = { "LspInfo", "LspInstall", "LspUninstall" },
|
cmd = { "LspInfo", "LspInstall", "LspUninstall" },
|
||||||
opts = {
|
config = function()
|
||||||
servers = {
|
|
||||||
lua_ls = {},
|
|
||||||
ccls = {},
|
|
||||||
gopls = {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
-- Servers
|
|
||||||
for server, config in pairs(opts.servers) do
|
|
||||||
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
|
|
||||||
lspconfig[server].setup(config)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Keybinds
|
-- Keybinds
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
|
||||||
vim.keymap.set("n", "<leader>cr", vim.lsp.buf.rename)
|
vim.keymap.set("n", "<leader>cr", vim.lsp.buf.rename)
|
||||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action)
|
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action)
|
||||||
|
|
||||||
-- Signs
|
-- Diagnostics
|
||||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
vim.diagnostic.config({
|
||||||
for type, icon in pairs(signs) do
|
underline = true,
|
||||||
local hl = "DiagnosticSign" .. type
|
update_in_insert = false,
|
||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
virtual_text = {
|
||||||
end
|
spacing = 4,
|
||||||
|
source = "if_many",
|
||||||
|
prefix = "●",
|
||||||
|
},
|
||||||
|
severity_sort = true,
|
||||||
|
signs = {
|
||||||
|
text = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = "",
|
||||||
|
[vim.diagnostic.severity.WARN] = "",
|
||||||
|
[vim.diagnostic.severity.HINT] = "",
|
||||||
|
[vim.diagnostic.severity.INFO] = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Add `vim` to globals
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
12
lua/plugins/mini.lua
Normal file
12
lua/plugins/mini.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"echasnovski/mini.ai",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"echasnovski/mini.pairs",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
}
|
@ -1,14 +1,16 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
version = "*",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
event = "VeryLazy",
|
lazy = false,
|
||||||
-- lazy = false,
|
keys = {
|
||||||
config = function()
|
{
|
||||||
require("nvim-tree").setup({})
|
"<leader>e",
|
||||||
|
function()
|
||||||
local api = require("nvim-tree.api")
|
require("nvim-tree.api").tree.toggle()
|
||||||
|
end,
|
||||||
vim.keymap.set("n", "<leader>e", api.tree.toggle)
|
},
|
||||||
end,
|
},
|
||||||
|
opts = {
|
||||||
|
view = { side = "right" },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -2,47 +2,19 @@ return {
|
|||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
main = "nvim-treesitter.configs",
|
||||||
local configs = require("nvim-treesitter.configs")
|
opts = {
|
||||||
configs.setup({
|
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" },
|
||||||
sync_install = false,
|
highlight = { enable = true },
|
||||||
highlight = { enable = true },
|
indent = { enable = true },
|
||||||
indent = { enable = true },
|
incremental_selection = {
|
||||||
ensure_installed = {
|
enable = true,
|
||||||
"bash",
|
keymaps = {
|
||||||
"c",
|
init_selection = "<C-space>",
|
||||||
"diff",
|
node_incremental = "<C-space>",
|
||||||
"html",
|
scope_incremental = false,
|
||||||
"javascript",
|
node_decremental = "<bs>",
|
||||||
"jsdoc",
|
|
||||||
"json",
|
|
||||||
"jsonc",
|
|
||||||
"lua",
|
|
||||||
"luadoc",
|
|
||||||
"luap",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
"printf",
|
|
||||||
"python",
|
|
||||||
"query",
|
|
||||||
"regex",
|
|
||||||
"toml",
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"xml",
|
|
||||||
"yaml",
|
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
},
|
||||||
enable = true,
|
},
|
||||||
keymaps = {
|
|
||||||
init_selection = "<C-space>",
|
|
||||||
node_incremental = "<C-space>",
|
|
||||||
scope_incremental = false,
|
|
||||||
node_decremental = "<bs>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user