Jelajahi Sumber

fittt

增加lazygit
scorpio 1 tahun lalu
induk
melakukan
e7ec0a4a06
6 mengubah file dengan 48 tambahan dan 14 penghapusan
  1. 1 0
      init.lua
  2. 4 4
      lua/basic.lua
  3. 6 0
      lua/keybindings.lua
  4. 3 0
      lua/plugin-config/nvim-treesitter.lua
  5. 14 5
      lua/plugins.lua
  6. 20 5
      plugin/packer_compiled.lua

+ 1 - 0
init.lua

@@ -16,5 +16,6 @@ require("plugin-config.project")
 require("plugin-config.nvim-treesitter")
 require("plugin-config.prettier")
 require("plugin-config.null-ls")
+require("plugin-config.gitsigns")
 -- 内置LSP (新增)
 require("lsp.config.coc")

+ 4 - 4
lua/basic.lua

@@ -2,11 +2,11 @@
 vim.g.encoding = "UTF-8"
 vim.o.fileencoding = "UTF-8"
 -- jkhl 移动光标周围保留8行
-vim.o.scrolloff = 8
-vim.o.sidescrolloff = 8
+-- vim.o.scrolloff = 8
+-- vim.o.sidescrolloff = 8
 -- 使用相对行号
 vim.wo.number = true
-vim.wo.relativenumber = true
+-- vim.wo.relativenumber = true
 -- 高亮所在行
 vim.wo.cursorline = true
 -- 显示左侧图标事例
@@ -32,7 +32,7 @@ vim.o.smartindent = true
 vim.o.ingorecash = true
 vim.o.smartcase = true
 -- 搜索不要高亮
-vim.o.hlsearch = false
+vim.o.hlsearch = true
 -- 边输入边搜索
 vim.o.insearch = true
 -- 命令行高未2 提供足够的显示空间

+ 6 - 0
lua/keybindings.lua

@@ -31,8 +31,14 @@ map("n", "<A-Up>", "<C-w>k", opt)
 map("n", "<A-Left>", "<C-w>h", opt)
 -- 返回dashboard 主页
 map("n", "<leader>h", ":Dashboard<CR>", opt)
+-- gitsigns 
+map("n", "git", ":Gitsigns toggle_current_line_blame<CR>", opt)
+-- lazygit
+map("n", "<leader>lg", ":LazyGit<CR>", opt)
 -- terminal 相关
 map("n", "<leader>t", ":FloatermToggle<CR>", opt)
+-- 高亮 intent
+map("n", "<leader>i", ":IndentGuidesToggle<CR>", opt)
 -- 代码缩进
 map("v", "<", "<gv", opt)
 map("v", ">", ">gv", opt)

+ 3 - 0
lua/plugin-config/nvim-treesitter.lua

@@ -16,6 +16,9 @@ treesitter.setup({
     -- 启用代码缩进模块 (=)
     indent = {
         enable = true
+    },
+    tree_docs = {
+       enable = true
     }
 })
 

+ 14 - 5
lua/plugins.lua

@@ -63,6 +63,7 @@ packer.startup({
             'nvim-treesitter/nvim-treesitter',
             run = ':TSUpdate'
         }
+        use('nvim-treesitter/nvim-tree-docs')
         --------------------- LSP --------------------
         use {
             'neoclide/coc.nvim',
@@ -73,11 +74,19 @@ packer.startup({
         -- Lspconfig
         use({ "neovim/nvim-lspconfig" })
         use({"L3MON4D3/LuaSnip",run = "make install_jsregexp"})
-        -- jsdoc
-      use {
-        'kkoomen/vim-doge',
-        run = ':call doge#install()'
-      }
+        -- git
+        use {'lewis6991/gitsigns.nvim'}
+        -- lazygit
+       use({
+         "kdheepak/lazygit.nvim",
+      -- optional for floating window border decoration
+         requires = {
+          "nvim-lua/plenary.nvim",
+         },
+        })
+        -- indent
+        use("nathanaelkane/vim-indent-guides")
+        -- 
     --use("hrsh7th/nvim-cmp")
         -- snippet 引擎
         -- 补全源

+ 20 - 5
plugin/packer_compiled.lua

@@ -100,6 +100,16 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/friendly-snippets",
     url = "https://github.com/rafamadriz/friendly-snippets"
   },
+  ["gitsigns.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
+    url = "https://github.com/lewis6991/gitsigns.nvim"
+  },
+  ["lazygit.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/lazygit.nvim",
+    url = "https://github.com/kdheepak/lazygit.nvim"
+  },
   ["lualine.nvim"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/lualine.nvim",
@@ -121,6 +131,11 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
     url = "https://github.com/neovim/nvim-lspconfig"
   },
+  ["nvim-tree-docs"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-tree-docs",
+    url = "https://github.com/nvim-treesitter/nvim-tree-docs"
+  },
   ["nvim-tree.lua"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
@@ -171,15 +186,15 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/tokyonight.nvim",
     url = "https://github.com/folke/tokyonight.nvim"
   },
-  ["vim-doge"] = {
-    loaded = true,
-    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-doge",
-    url = "https://github.com/kkoomen/vim-doge"
-  },
   ["vim-floaterm"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-floaterm",
     url = "https://github.com/voldikss/vim-floaterm"
+  },
+  ["vim-indent-guides"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-indent-guides",
+    url = "https://github.com/nathanaelkane/vim-indent-guides"
   }
 }