From e6e5791ba2b00ef5b9c66766c03c4eeacd1c9a19 Mon Sep 17 00:00:00 2001 From: Young Xu Date: Thu, 2 Feb 2023 00:59:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9B=AE=E5=BD=95=E6=A0=91?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 1 + lua/basic.lua | 4 +-- lua/keybindings.lua | 10 +++++++ lua/plugins-config.lua | 4 +++ lua/plugins.lua | 60 ++++++++++++++++++++++++++++++++++-------- 5 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 lua/keybindings.lua diff --git a/init.lua b/init.lua index 1333c22..477d7be 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,4 @@ require('basic') require('plugins') require('plugins-config') +require('keybindings') diff --git a/lua/basic.lua b/lua/basic.lua index 8873b49..6645eea 100644 --- a/lua/basic.lua +++ b/lua/basic.lua @@ -11,8 +11,8 @@ vim.wo.signcolumn = "yes" -- 右侧参考线,超过表示代码太长了,考虑换行 vim.wo.colorcolumn = "120" -- 缩进2个空格等于一个Tab -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 vim.opt.expandtab = true vim.opt.autoindent = true -- 新行对齐当前行 diff --git a/lua/keybindings.lua b/lua/keybindings.lua new file mode 100644 index 0000000..01662f4 --- /dev/null +++ b/lua/keybindings.lua @@ -0,0 +1,10 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +local map = vim.api.nvim_set_keymap +local opt = {noremap = true, silent = true} + +-- 开启目录树 +map('n', 'o', ':NvimTreeOpen', opt) +-- 关闭目录树 +map('n', 'c', ':NvimTreeClose', opt) diff --git a/lua/plugins-config.lua b/lua/plugins-config.lua index d047e70..da68b13 100644 --- a/lua/plugins-config.lua +++ b/lua/plugins-config.lua @@ -3,6 +3,10 @@ require('symbols-outline').setup() require('feline').setup() require('bufferline').setup() require('go').setup() +require('impatient') +require("toggleterm").setup() +require('gitsigns').setup() +require('telescope').setup() vim.o.background = "dark" -- or "light" for light mode vim.cmd([[colorscheme gruvbox]]) diff --git a/lua/plugins.lua b/lua/plugins.lua index a4ef619..110f9aa 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,7 +1,7 @@ return require('packer').startup(function() -- Packer can manage itself use 'wbthomason/packer.nvim' - -- nvim-tree + -- 文件树 use { 'nvim-tree/nvim-tree.lua', requires = { @@ -9,7 +9,7 @@ return require('packer').startup(function() }, tag = 'nightly' -- optional, updated every week. (see issue #1193) } - -- greeter + -- 欢迎页 use { 'goolord/alpha-nvim', requires = { 'nvim-tree/nvim-web-devicons' }, @@ -17,28 +17,66 @@ return require('packer').startup(function() require'alpha'.setup(require'alpha.themes.startify'.config) end } - -- theme + -- 主题 use { "ellisonleao/gruvbox.nvim" } - -- symbols outline + -- 代码缩略图 use 'simrat39/symbols-outline.nvim' - -- status tabbar + -- 状态栏 use 'feline-nvim/feline.nvim' - -- bufferline + -- bufferline 标题栏 use {'akinsho/bufferline.nvim', tag = "v3.*", requires = 'nvim-tree/nvim-web-devicons'} -- golang ide use 'ray-x/go.nvim' use 'ray-x/guihua.lua' -- recommended if need floating window support use 'neovim/nvim-lspconfig' use 'nvim-treesitter/nvim-treesitter' - -- project manager + -- 当前工作目录 use { - "ahmedkhalf/project.nvim", - config = function() + "ahmedkhalf/project.nvim", + config = function() require("project_nvim").setup { -- your configuration comes here -- or leave it empty to use the default settings -- refer to the configuration section below } - end -} + end + } + -- 空白缩进 + use "lukas-reineke/indent-blankline.nvim" + -- 改善启动时间 + use 'lewis6991/impatient.nvim' + -- 终端管理 + use {"akinsho/toggleterm.nvim", tag = '*', config = function() + require("toggleterm").setup() + end} + -- TODO管理 + use { + "folke/todo-comments.nvim", + requires = "nvim-lua/plenary.nvim", + config = function() + require("todo-comments").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } + end + } + -- git 管理 + use { + 'lewis6991/gitsigns.nvim', + } + -- 注释管理 + use { + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup() + end + } + -- coc 代码提示 + use {'neoclide/coc.nvim', branch = 'release'} + -- 搜索 + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.1', + requires = { {'nvim-lua/plenary.nvim'} } + } end)