From c39a6f7f093e1b1f8139f1dfab603c1206e57d1d Mon Sep 17 00:00:00 2001 From: newbie Date: Sat, 20 Jan 2024 00:48:15 +0800 Subject: [PATCH] update --- lua/plugs.lua | 19 +++++++------- lua/plugs/dev.lua | 28 ++++++++++++++++++++ lua/plugs/edit-plugs.lua | 51 +++++++++++++++++++++++++++++++++++- lua/plugs/hop.lua | 51 ------------------------------------ lua/plugs/nvim-lspconfig.lua | 3 +++ lua/vscode.lua | 3 --- 6 files changed, 90 insertions(+), 65 deletions(-) create mode 100644 lua/plugs/dev.lua delete mode 100644 lua/plugs/hop.lua diff --git a/lua/plugs.lua b/lua/plugs.lua index ee43984..34c9780 100644 --- a/lua/plugs.lua +++ b/lua/plugs.lua @@ -1,7 +1,14 @@ return { - 'vijaymarupudi/nvim-fzf', -- fzf - 'lilydjwg/colorizer', -- 颜色识别 + require('plugs.nvim-lspconfig'), + require('plugs.nvimtree'), -- nvimtree + require('plugs.theme'), -- theme + require("plugs.edit-plugs"), + require("plugs.toggleterm"), + require("plugs.dev"), + + + -- leetcode刷题 { "kawre/leetcode.nvim", build = ":TSUpdate html", @@ -23,12 +30,4 @@ return { }, }, - require('plugs.nvim-lspconfig'), - require('plugs.nvimtree'), -- nvimtree - require('plugs.theme'), -- theme - - require("plugs.edit-plugs"), - - require("plugs.toggleterm") - } diff --git a/lua/plugs/dev.lua b/lua/plugs/dev.lua new file mode 100644 index 0000000..a97115b --- /dev/null +++ b/lua/plugs/dev.lua @@ -0,0 +1,28 @@ +return { + 'lilydjwg/colorizer', -- 颜色识别 + { + -- 类似postman的curl工具 + "rest-nvim/rest.nvim", + dependencies = { { "nvim-lua/plenary.nvim" } }, + config = function() + require("rest-nvim").setup({ + --- Get the same options from Packer setup + }) + end + }, + { + -- go开发 + "ray-x/go.nvim", + dependencies = { -- optional packages + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("go").setup() + end, + event = { "CmdlineEnter" }, + ft = { "go", 'gomod' }, + build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries + } +} diff --git a/lua/plugs/edit-plugs.lua b/lua/plugs/edit-plugs.lua index 55aa04c..5af274c 100644 --- a/lua/plugs/edit-plugs.lua +++ b/lua/plugs/edit-plugs.lua @@ -1,4 +1,5 @@ return { + 'vijaymarupudi/nvim-fzf', -- fzf { -- surround 和 wildfire 配合有神奇的效果 'tpope/vim-surround', @@ -53,6 +54,54 @@ return { -- }, { -- hop - require("plugs.hop") + "phaazon/hop.nvim", + branch = "v2", + keys = { + "f", "F", "t", "T", + "" + }, + lazy = true, + config = function() + require("hop").setup { keys = 'asdfghjkl;' } + local hop = require('hop') + local directions = require('hop.hint').HintDirection + G.map({ + { "n", "", ":HopChar2MW", { noremap = true } }, + { "n", "f", + function() + hop.hint_char1({ + direction = directions.AFTER_CURSOR, + current_line_only = true + }) + end, { noremap = true } + }, + { "n", "F", + function() + hop.hint_char1({ + direction = directions.BEFORE_CURSOR, + current_line_only = true + }) + end, { noremap = true } + }, + { "n", "t", + function() + hop.hint_char1({ + direction = directions.AFTER_CURSOR, + current_line_only = true, + hint_offset = -1 + }) + end, { noremap = true } + }, + { "n", "T", + function() + hop.hint_char1({ + direction = directions.BEFORE_CURSOR, + current_line_only = true, + hint_offset = -1 + }) + end, { noremap = true } + }, + }) + end } } diff --git a/lua/plugs/hop.lua b/lua/plugs/hop.lua deleted file mode 100644 index d67541b..0000000 --- a/lua/plugs/hop.lua +++ /dev/null @@ -1,51 +0,0 @@ -return { - "phaazon/hop.nvim", - branch = "v2", - keys = { - "f", "F", "t", "T", - "" - }, - lazy = true, - config = function() - require("hop").setup { keys = 'asdfghjkl;' } - local hop = require('hop') - local directions = require('hop.hint').HintDirection - G.map({ - { "n", "", ":HopChar2MW", { noremap = true } }, - { "n", "f", - function() - hop.hint_char1({ - direction = directions.AFTER_CURSOR, - current_line_only = true - }) - end, { noremap = true } - }, - { "n", "F", - function() - hop.hint_char1({ - direction = directions.BEFORE_CURSOR, - current_line_only = true - }) - end, { noremap = true } - }, - { "n", "t", - function() - hop.hint_char1({ - direction = directions.AFTER_CURSOR, - current_line_only = true, - hint_offset = -1 - }) - end, { noremap = true } - }, - { "n", "T", - function() - hop.hint_char1({ - direction = directions.BEFORE_CURSOR, - current_line_only = true, - hint_offset = -1 - }) - end, { noremap = true } - }, - }) - end -} diff --git a/lua/plugs/nvim-lspconfig.lua b/lua/plugs/nvim-lspconfig.lua index efd3bf8..8c742a2 100644 --- a/lua/plugs/nvim-lspconfig.lua +++ b/lua/plugs/nvim-lspconfig.lua @@ -239,6 +239,9 @@ return { local treesitter_opt = { ensure_installed = {}, indent = { enable = true }, + ignore_install = { + "go", "txt" + }, sync_install = false, auto_install = true, highlight = { diff --git a/lua/vscode.lua b/lua/vscode.lua index 5c91e6a..0abf89d 100644 --- a/lua/vscode.lua +++ b/lua/vscode.lua @@ -1,7 +1,4 @@ require 'lazy'.setup({ - - require("plugs.hop"), require('plugs.edit-plugs'), - -- 'vijaymarupudi/nvim-fzf', -- fzf })