feat(nvim): Apperance and Cursor Movement

This commit is contained in:
js0ny 2025-01-26 14:00:07 +00:00
parent 1a5f992384
commit 0069470641
10 changed files with 87 additions and 7 deletions

View file

@ -0,0 +1,11 @@
local signs = {
Error = "",
Warning = "",
Hint = "",
Information = "",
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end

View file

@ -3,15 +3,30 @@
--- for available server and name
local M = {}
M.servers = {
"ast_grep",
"bashls", -- Bash
"clangd", -- C/C++
"cssls", -- CSS
"denols", -- Deno
-- "cmake", -- CMake
"eslint", -- JavaScript
"gopls", -- Go
"hls", -- Haskell
"html", -- HTML
"jsonls", -- JSON
"lua_ls", -- Lua
"markdown_oxide", -- Markdown
"omnisharp", -- C# & F#
"powershell_es", -- PowerShell
"pyright", -- Python
"rust_analyzer", -- Rust
"svelte", -- Svelte
"svlangserver", -- SystemVerilog
"tailwindcss", -- TailwindCSS
"taplo", -- TOML
"ts_ls", -- TypeScript
"vimls", -- vimscript
"yamlls", -- YAML
}
M.server_config = {

View file

@ -25,4 +25,17 @@ return {
{ import = "plugins.mod.alpha-nvim" },
{ import = "plugins.mod.winbar-nvim" },
{ import = "plugins.mod.bufferline" },
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup({
current_line_blame = true,
})
end,
},
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
},
}

View file

@ -47,9 +47,23 @@ return {
end,
},
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup()
end,
"kdheepak/lazygit.nvim",
lazy = true,
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>gg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
},
},
}

View file

@ -12,4 +12,18 @@ return {
"github/copilot.vim",
lazy = false,
},
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
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" },
},
},
}

View file

@ -4,6 +4,13 @@ return {
config = function()
require("bufferline").setup({
options = {
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local icon = level:match("error") and "" or ""
return " " .. icon .. count
end,
show_buffer_icons = true,
numbers = "ordinal", -- 显示 buffer 序号
close_command = "bdelete! %d", -- 关闭 buffer 的命令
right_mouse_command = "bdelete! %d", -- 右键关闭

View file

@ -7,7 +7,7 @@ return {
show_file_path = true,
show_symbols = true,
colors = {
path = "#9c1d91",
path = "",
file_name = "",
symbols = "",
},
@ -31,6 +31,7 @@ return {
"spectre_panel",
"toggleterm",
"qf",
"floaterm",
},
})
end,