diff --git a/init.lua b/init.lua index d6e170b..7584044 100644 --- a/init.lua +++ b/init.lua @@ -28,7 +28,7 @@ require("plugins.terminal") -- 错误列表 require("plugins.trouble") -- 代码大纲 -require('plugins.aerial') +require("plugins.aerial") -- LSP管理 require("plugins.mason") require("lsp.init") diff --git a/lua/basics/keybinding.lua b/lua/basics/keybinding.lua index f3bf08c..d9043e3 100644 --- a/lua/basics/keybinding.lua +++ b/lua/basics/keybinding.lua @@ -15,6 +15,7 @@ map("n", "t", ":NvimTreeToggle", noreopt) -- 文件页切换 map("n", "ll", ":BufferLineCyclePrev", noreopt) map("n", "rr", ":BufferLineCycleNext", noreopt) +map("n", "pc", ":BufferLinePickClose", noreopt) -- 模糊搜索 map("n", "ff", "Telescope find_files", noreopt) map("n", "fg", "Telescope live_grep", noreopt) diff --git a/lua/basics/theme.lua b/lua/basics/theme.lua index 9bebc41..615ec2e 100644 --- a/lua/basics/theme.lua +++ b/lua/basics/theme.lua @@ -1 +1,2 @@ -vim.cmd[[colorscheme tokyonight]] +vim.o.background = "dark" -- or "light" for light mode +vim.cmd([[colorscheme gruvbox]]) diff --git a/lua/plugins/aerial.lua b/lua/plugins/aerial.lua index b8e0c36..f3c86f0 100644 --- a/lua/plugins/aerial.lua +++ b/lua/plugins/aerial.lua @@ -1,11 +1,11 @@ -require('aerial').setup({ - -- optionally use on_attach to set keymaps when aerial has attached to a buffer - on_attach = function(bufnr) - -- Jump forwards/backwards with '{' and '}' - vim.keymap.set('n', '{', 'AerialPrev', {buffer = bufnr}) - vim.keymap.set('n', '}', 'AerialNext', {buffer = bufnr}) - end +require("aerial").setup({ + -- optionally use on_attach to set keymaps when aerial has attached to a buffer + on_attach = function(bufnr) + -- Jump forwards/backwards with '{' and '}' + vim.keymap.set("n", "{", "AerialPrev", { buffer = bufnr }) + vim.keymap.set("n", "}", "AerialNext", { buffer = bufnr }) + end, }) -- You probably also want to set a keymap to toggle aerial -vim.keymap.set('n', 'a', 'AerialToggle!') +vim.keymap.set("n", "a", "AerialToggle!") diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 3aa1361..274e130 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -1,14 +1,16 @@ -require("bufferline").setup{ - options = { - -- 使用 nvim 内置lsp - diagnostics = "nvim_lsp", - always_show_bufferline = false, - -- 左侧让出 nvim-tree 的位置 - offsets = {{ - filetype = "NvimTree", - text = "File Explorer", - highlight = "Directory", - text_align = "left" - }} - } -} +require("bufferline").setup({ + options = { + -- 使用 nvim 内置lsp + diagnostics = "nvim_lsp", + always_show_bufferline = false, + -- 左侧让出 nvim-tree 的位置 + offsets = { + { + filetype = "NvimTree", + text = "File Explorer", + highlight = "Directory", + text_align = "left", + }, + }, + }, +}) diff --git a/lua/plugins/indent-blackline.lua b/lua/plugins/indent-blackline.lua index d477b5d..5dfbb9c 100644 --- a/lua/plugins/indent-blackline.lua +++ b/lua/plugins/indent-blackline.lua @@ -1,10 +1,10 @@ vim.opt.list = true -vim.opt.listchars:append "space:⋅" -vim.opt.listchars:append "eol:↴" +vim.opt.listchars:append("space:⋅") +vim.opt.listchars:append("eol:↴") -require("indent_blankline").setup { - show_current_context = true, - show_current_context_start = true, - show_end_of_line = true, - space_char_blankline = " ", -} +require("indent_blankline").setup({ + show_current_context = true, + show_current_context_start = true, + show_end_of_line = true, + space_char_blankline = " ", +}) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 025e92b..6ba0c1b 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,3 +1,6 @@ -require('lualine').setup({ - options = { theme = 'tokyonight' } +require("lualine").setup({ + options = { + theme = "gruvbox", + component_separators = { left = "|", right = "|" }, + }, }) diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index b2bb9ee..0bd4ca8 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -9,6 +9,6 @@ require("mason").setup({ }) require("mason-lspconfig").setup({ - ensure_installed = { "rust_analyzer", "gopls", "golangci_lint_ls" }, + ensure_installed = { "lua_ls", "rust_analyzer", "gopls", "golangci_lint_ls" }, automatic_installation = true, }) diff --git a/lua/plugins/setup.lua b/lua/plugins/setup.lua index e8a3b94..27fab15 100644 --- a/lua/plugins/setup.lua +++ b/lua/plugins/setup.lua @@ -1,7 +1,7 @@ return require("packer").startup(function(use) use({ "wbthomason/packer.nvim" }) -- 主题 - use({ "folke/tokyonight.nvim" }) + use({ "ellisonleao/gruvbox.nvim" }) -- 文件树 use({ "nvim-tree/nvim-tree.lua", @@ -108,5 +108,7 @@ return require("packer").startup(function(use) "folke/trouble.nvim", requires = "nvim-tree/nvim-web-devicons", }) + -- 上下高亮跳动 + use({ "danilamihailov/beacon.nvim" }) vim.opt.completeopt = { "menu", "menuone", "noselect" } end)