config rewrite
This commit is contained in:
parent
032e19a05f
commit
d3a498eb82
@ -1,8 +1,8 @@
|
||||
-- Highlight on yank
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
@ -24,16 +24,17 @@ lazy.setup({
|
||||
},
|
||||
defaults = {
|
||||
lazy = false,
|
||||
version = false,
|
||||
version = "*",
|
||||
},
|
||||
install = { colorscheme = { "moonfly", "wildcharm" } },
|
||||
checker = { enabled = true, notify = false },
|
||||
change_detection = { notify = false },
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
"matchit",
|
||||
"matchparen",
|
||||
"netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
|
@ -1,6 +1,6 @@
|
||||
-- Leader
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
vim.opt.timeoutlen = 300
|
||||
|
||||
-- Numbers
|
||||
@ -8,11 +8,11 @@ vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- Mouse
|
||||
vim.opt.mouse = 'a'
|
||||
vim.opt.mouse = "a"
|
||||
|
||||
-- Use system clipboard
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
end)
|
||||
|
||||
-- Indent
|
||||
@ -27,7 +27,7 @@ vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
-- UI
|
||||
vim.opt.signcolumn = 'yes'
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.scrolloff = 5
|
||||
vim.opt.wrap = false
|
||||
|
||||
@ -37,10 +37,11 @@ vim.opt.splitbelow = true
|
||||
|
||||
-- Whitespaces
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
-- vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||
vim.opt.listchars = { tab = "▎ ", trail = "·", nbsp = "␣" }
|
||||
|
||||
-- Preview substitutions
|
||||
vim.opt.inccommand = 'split'
|
||||
vim.opt.inccommand = "split"
|
||||
|
||||
-- Colors
|
||||
vim.opt.termguicolors = true
|
||||
|
@ -1,5 +0,0 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {},
|
||||
}
|
@ -1,27 +1,9 @@
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
dependencies = "rafamadriz/friendly-snippets",
|
||||
version = "*",
|
||||
event = "InsertEnter",
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
},
|
||||
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" },
|
||||
},
|
||||
keymap = { preset = "enter" },
|
||||
completion = { documentation = { auto_show = true } },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
event = "VeryLazy",
|
||||
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",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local fzf_lua = require("fzf-lua")
|
||||
|
||||
-- Setup
|
||||
fzf_lua.setup({})
|
||||
fzf_lua.setup(opts)
|
||||
|
||||
-- Register as the UI for vim.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 {
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = { "williamboman/mason.nvim", "neovim/nvim-lspconfig" },
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
ensure_installed = { "lua_ls" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
lazy = true,
|
||||
cmd = "Mason",
|
||||
keys = { { "<Leader>cm", "<cmd>Mason<cr>" } },
|
||||
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",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
lazy = true,
|
||||
cmd = { "LspInfo", "LspInstall", "LspUninstall" },
|
||||
opts = {
|
||||
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
|
||||
|
||||
config = function()
|
||||
-- Keybinds
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
|
||||
vim.keymap.set("n", "<leader>cr", vim.lsp.buf.rename)
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action)
|
||||
|
||||
-- Signs
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
-- Diagnostics
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = {
|
||||
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,
|
||||
},
|
||||
}
|
||||
|
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 {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
event = "VeryLazy",
|
||||
-- lazy = false,
|
||||
config = function()
|
||||
require("nvim-tree").setup({})
|
||||
|
||||
local api = require("nvim-tree.api")
|
||||
|
||||
vim.keymap.set("n", "<leader>e", api.tree.toggle)
|
||||
end,
|
||||
lazy = false,
|
||||
keys = {
|
||||
{
|
||||
"<leader>e",
|
||||
function()
|
||||
require("nvim-tree.api").tree.toggle()
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
view = { side = "right" },
|
||||
},
|
||||
}
|
||||
|
@ -2,47 +2,19 @@ return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
configs.setup({
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"diff",
|
||||
"html",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"jsonc",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"printf",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"xml",
|
||||
"yaml",
|
||||
main = "nvim-treesitter.configs",
|
||||
opts = {
|
||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" },
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
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