From bf0b80b924242ebb1e3e225a35bd9f90ede04918 Mon Sep 17 00:00:00 2001 From: gwbeip Date: Fri, 11 Apr 2025 18:01:03 +0800 Subject: [PATCH] add lualine and nvim-window to plugins --- init.lua | 8 ++++ lua/plugins/lualine.lua | 83 +++++++++++++++++++++++++++++++++++++ lua/plugins/nvim-window.lua | 9 ++++ 3 files changed, 100 insertions(+) create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/nvim-window.lua diff --git a/init.lua b/init.lua index f1d7cbb..059932c 100644 --- a/init.lua +++ b/init.lua @@ -45,5 +45,13 @@ vim.opt.writebackup = false vim.g.mapleader = " " -- set leader key to space vim.g.maplocalleader = " " -- set local leader key to space +if vim.loop.os_uname().sysname == "Windows_NT" then -- set default shell to powershell on Windows + vim.opt.shell = "powershell.exe" + vim.opt.shellcmdflag = "-Command" + vim.opt.shellquote = "" + vim.opt.shellxquote = "" + vim.opt.shellredir = "2>&1 | Out-File -Encoding ASCII %s; exit $LastExitCode" + vim.opt.shellpipe = "2>&1 | Out-File -Encoding ASCII %s; exit $LastExitCode" +end require("config.lazy") diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..366f840 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,83 @@ +return { + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + opts = { + options = { + theme = "auto", + }, + -- sections = { + -- lualine_c = { + -- -- 显示当前窗口编号(格式:[窗口号] 文件名) + -- function() + -- return "[" .. tostring(vim.api.nvim_win_get_number(0)) .. "] " .. vim.fn.expand("%:t") + -- end, + -- }, + -- }, + } + } +} + +-- local colors = { +-- blue = '#80a0ff', +-- cyan = '#79dac8', +-- black = '#080808', +-- white = '#c6c6c6', +-- red = '#ff5189', +-- violet = '#d183e8', +-- grey = '#303030', +-- } + +-- local bubbles_theme = { +-- normal = { +-- a = { fg = colors.black, bg = colors.violet }, +-- b = { fg = colors.white, bg = colors.grey }, +-- c = { fg = colors.white }, +-- }, + +-- insert = { a = { fg = colors.black, bg = colors.blue } }, +-- visual = { a = { fg = colors.black, bg = colors.cyan } }, +-- replace = { a = { fg = colors.black, bg = colors.red } }, + +-- inactive = { +-- a = { fg = colors.white, bg = colors.black }, +-- b = { fg = colors.white, bg = colors.black }, +-- c = { fg = colors.white }, +-- }, +-- } + +-- return { +-- { +-- 'nvim-lualine/lualine.nvim', +-- dependencies = { 'nvim-tree/nvim-web-devicons' }, +-- opts = { +-- options = { +-- theme = bubbles_theme, +-- component_separators = '', +-- section_separators = { left = '', right = '' }, +-- }, +-- }, +-- sections = { +-- lualine_a = { { 'mode', separator = { left = '' }, right_padding = 2 } }, +-- lualine_b = { 'filename', 'branch' }, +-- lualine_c = { +-- '%=', --[[ add your center components here in place of this comment ]] +-- }, +-- lualine_x = {}, +-- lualine_y = { 'filetype', 'progress' }, +-- lualine_z = { +-- { 'location', separator = { right = '' }, left_padding = 2 }, +-- }, +-- }, +-- inactive_sections = { +-- lualine_a = { 'filename' }, +-- lualine_b = {}, +-- lualine_c = {}, +-- lualine_x = {}, +-- lualine_y = {}, +-- lualine_z = { 'location' }, +-- }, +-- tabline = {}, +-- extensions = {}, +-- } +-- } diff --git a/lua/plugins/nvim-window.lua b/lua/plugins/nvim-window.lua new file mode 100644 index 0000000..0032cd9 --- /dev/null +++ b/lua/plugins/nvim-window.lua @@ -0,0 +1,9 @@ +return { + { + "yorickpeterse/nvim-window", + keys = { + { "w", "lua require('nvim-window').pick()", desc = "nvim-window: Jump to window" }, + }, + config = true, + } +}