From 3a06e074cf87623fc103e4b3125af2a47fec9518 Mon Sep 17 00:00:00 2001 From: "Yu Squire[ Yu, Tsung-Ying ]" Date: Fri, 9 May 2025 22:54:59 +0800 Subject: [PATCH] feat: bufferline --- nvim/.luarc.json | 3 ++ nvim/init.lua | 13 +++++-- nvim/lazy-lock.json | 6 +++- nvim/lua/config/lazy.lua | 12 ------- nvim/lua/config/vimrc.lua | 4 +++ nvim/lua/plugins/bufferline.lua | 11 ++++++ nvim/lua/plugins/lsp.lua | 2 ++ nvim/lua/plugins/lualine.lua | 10 +++--- nvim/lua/plugins/marks.lua | 5 +++ nvim/lua/plugins/neotree.lua | 58 ++++++++++++++++-------------- nvim/lua/plugins/none-ls.lua | 1 - nvim/lua/plugins/notify.lua | 12 +++++++ nvim/lua/plugins/toggleterm.lua | 1 + nvim/lua/plugins/window-picker.lua | 12 +++++++ 14 files changed, 103 insertions(+), 47 deletions(-) create mode 100644 nvim/lua/plugins/bufferline.lua create mode 100644 nvim/lua/plugins/marks.lua create mode 100644 nvim/lua/plugins/notify.lua create mode 100644 nvim/lua/plugins/window-picker.lua diff --git a/nvim/.luarc.json b/nvim/.luarc.json index bb4239e..6a6cb8f 100644 --- a/nvim/.luarc.json +++ b/nvim/.luarc.json @@ -2,5 +2,8 @@ "diagnostics.globals": [ "vim", "require" + ], + "diagnostics.disable": [ + "different-requires" ] } \ No newline at end of file diff --git a/nvim/init.lua b/nvim/init.lua index d9b2e7d..e252548 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,5 +1,14 @@ require("config.vimrc") require("config.lazy") ----@diagnostic disable-next-line: different-requires -require("lazy").setup("plugins") +require("lazy").setup({ + spec = { + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) + diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index af5ef84..f7698bd 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,10 +1,12 @@ { "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, "blink.cmp": { "branch": "main", "commit": "4f38ce99a472932d5776337f08f7a8180f1f571a" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "catppuccin": { "branch": "main", "commit": "1bf070129c0b6f77cc23f6a2212dcdc868308c52" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, + "marks.nvim": { "branch": "master", "commit": "bb25ae3f65f504379e3d08c8a02560b76eaf91e8" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, @@ -14,11 +16,13 @@ "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, "nvim-dap-python": { "branch": "master", "commit": "34282820bb713b9a5fdb120ae8dd85c2b3f49b51" }, "nvim-lspconfig": { "branch": "master", "commit": "4bc481b6f0c0cf3671fc894debd0e00347089a4e" }, + "nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" }, "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, "nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, - "venv-selector.nvim": { "branch": "regexp", "commit": "c677caa1030808a9f90092e522de7cc20c1390dd" } + "venv-selector.nvim": { "branch": "regexp", "commit": "c677caa1030808a9f90092e522de7cc20c1390dd" }, + "window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" } } diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 37b09ae..ac2e764 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -21,15 +21,3 @@ vim.opt.rtp:prepend(lazypath) vim.g.mapleader = " " vim.g.maplocalleader = "\\" --- Setup lazy.nvim -require("lazy").setup({ - spec = { - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, - -- automatically check for plugin updates - checker = { enabled = true }, -}) - diff --git a/nvim/lua/config/vimrc.lua b/nvim/lua/config/vimrc.lua index 9595ba2..42065be 100644 --- a/nvim/lua/config/vimrc.lua +++ b/nvim/lua/config/vimrc.lua @@ -7,6 +7,10 @@ vim.keymap.set("n", "K", "5k") vim.keymap.set("n", "//", ":noh") vim.keymap.set("n", "w", ":w") vim.keymap.set("n", "q", ":q") +vim.keymap.set("n", "", "j") +vim.keymap.set("n", "", "k") +vim.keymap.set("n", "", "h") +vim.keymap.set("n", "", "l") vim.keymap.set("v", "J", "5j") vim.keymap.set("v", "K", "5k") diff --git a/nvim/lua/plugins/bufferline.lua b/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..6c7eb68 --- /dev/null +++ b/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,11 @@ +local function setup() + vim.opt.termguicolors = true + require("bufferline").setup({}) +end + +return { + "akinsho/bufferline.nvim", + version = "*", + dependencies = "nvim-tree/nvim-web-devicons", + config = setup, +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index fb03fce..688d51f 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -10,6 +10,7 @@ local function mason_setup() "lua_ls", "pyright", "rust_analyzer", + "tailwindcss", "ts_ls", }, }) @@ -24,6 +25,7 @@ local function nvim_lsp_setup() vim.lsp.enable("lua_ls") vim.lsp.enable("pyright") vim.lsp.enable("rust_analyzer") + vim.lsp.enable("tailwindcss") vim.lsp.enable("ts_ls") vim.keymap.set("n", "", vim.lsp.buf.hover, {}) diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua index 9770922..a187c41 100644 --- a/nvim/lua/plugins/lualine.lua +++ b/nvim/lua/plugins/lualine.lua @@ -151,11 +151,11 @@ local function setup() -- Insert mid section. You can make any number of sections in neovim :) -- for lualine it's any number greater then 2 - ins_left { - function() - return '%=' - end, - } + -- ins_left { + -- function() + -- return '%=' + -- end, + -- } ins_left { -- Lsp server name . diff --git a/nvim/lua/plugins/marks.lua b/nvim/lua/plugins/marks.lua new file mode 100644 index 0000000..c5c76f2 --- /dev/null +++ b/nvim/lua/plugins/marks.lua @@ -0,0 +1,5 @@ +return { + "chentoast/marks.nvim", + event = "VeryLazy", + opts = {}, +} diff --git a/nvim/lua/plugins/neotree.lua b/nvim/lua/plugins/neotree.lua index 046c295..3c930c1 100644 --- a/nvim/lua/plugins/neotree.lua +++ b/nvim/lua/plugins/neotree.lua @@ -1,32 +1,38 @@ local function setup() - require("neo-tree").setup({ - close_if_last_window = true, - -- popup_border_style = "winborder", - filesystem = { - filtered_items = { - hide_dotfiles = false, - }, - hide_by_name = { - ".git", - "node_modules", - }, - }, - }) + require("neo-tree").setup({ + close_if_last_window = true, + source_selector = { + winbar = false, + statusline = false, + }, + window = { + position = "left", + width = 50, + }, + filesystem = { + filtered_items = { + hide_dotfiles = false, + hide_by_name = { + ".git", + "node_modules", + }, + }, + }, + }) - vim.keymap.set("n", "j", ":Neotree filesystem reveal left") - vim.keymap.set("n", "b", ":Neotree buffers toggle bottom") - vim.keymap.set("n", "J", ":Neotree filesystem close left") + vim.keymap.set("n", "j", ":Neotree filesystem reveal left") + -- vim.keymap.set("n", "k", ":Neotree buffers reveal left") + -- vim.keymap.set("n", "l", ":Neotree git_status reveal left") end return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - }, - lazy = false, - config = setup, + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + lazy = false, + config = setup, } - diff --git a/nvim/lua/plugins/none-ls.lua b/nvim/lua/plugins/none-ls.lua index 35067c4..b8cb8a5 100644 --- a/nvim/lua/plugins/none-ls.lua +++ b/nvim/lua/plugins/none-ls.lua @@ -6,7 +6,6 @@ local function setup() null_ls.builtins.formatting.prettier, null_ls.builtins.formatting.black, null_ls.builtins.formatting.isort, - null_ls.builtins.diagnostics.eslint, null_ls.builtins.completion.spell, }, }) diff --git a/nvim/lua/plugins/notify.lua b/nvim/lua/plugins/notify.lua new file mode 100644 index 0000000..ca53900 --- /dev/null +++ b/nvim/lua/plugins/notify.lua @@ -0,0 +1,12 @@ +local function setup() + local notify = require("notify") + notify.setup({ + background_colour = "#282828", + }) + vim.notify = notify +end + +return { + "rcarriga/nvim-notify", + config = setup, +} diff --git a/nvim/lua/plugins/toggleterm.lua b/nvim/lua/plugins/toggleterm.lua index 97789c5..943ce16 100644 --- a/nvim/lua/plugins/toggleterm.lua +++ b/nvim/lua/plugins/toggleterm.lua @@ -3,6 +3,7 @@ local function setup() vim.keymap.set("n", "t", ":ToggleTerm") vim.keymap.set("t", "", "") + vim.keymap.set("t", "jk", "") end return { diff --git a/nvim/lua/plugins/window-picker.lua b/nvim/lua/plugins/window-picker.lua new file mode 100644 index 0000000..88c22dc --- /dev/null +++ b/nvim/lua/plugins/window-picker.lua @@ -0,0 +1,12 @@ +local function setup() + require("window-picker").setup({ + }) +end + +return { + "s1n7ax/nvim-window-picker", + name = "window-picker", + event = "VeryLazy", + version = "2.*", + config = setup, +}