diff --git a/a.go b/a.go new file mode 100644 index 0000000..c9ecbf5 --- /dev/null +++ b/a.go @@ -0,0 +1,2 @@ +package main + diff --git a/lua/plugs.lua b/lua/plugs.lua index 34c9780..586ff2b 100644 --- a/lua/plugs.lua +++ b/lua/plugs.lua @@ -4,30 +4,29 @@ return { 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", - dependencies = { - "nvim-telescope/telescope.nvim", - "nvim-lua/plenary.nvim", -- telescope 所需 - "MunifTanjim/nui.nvim", + -- { + -- "kawre/leetcode.nvim", + -- build = ":TSUpdate html", + -- dependencies = { + -- "nvim-telescope/telescope.nvim", + -- "nvim-lua/plenary.nvim", -- telescope 所需 + -- "MunifTanjim/nui.nvim", - -- 可选 - "nvim-treesitter/nvim-treesitter", - "rcarriga/nvim-notify", - "nvim-tree/nvim-web-devicons", - }, - opts = { - -- 配置放在这里 - cn = { - enabled = true, - }, - }, - }, + -- -- 可选 + -- "nvim-treesitter/nvim-treesitter", + -- "rcarriga/nvim-notify", + -- "nvim-tree/nvim-web-devicons", + -- }, + -- opts = { + -- -- 配置放在这里 + -- cn = { + -- enabled = true, + -- }, + -- }, + -- }, } diff --git a/lua/plugs/dev.lua b/lua/plugs/dev.lua index a97115b..d399d4c 100644 --- a/lua/plugs/dev.lua +++ b/lua/plugs/dev.lua @@ -24,5 +24,25 @@ return { event = { "CmdlineEnter" }, ft = { "go", 'gomod' }, build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries + }, + { + -- 终端 + 'akinsho/toggleterm.nvim', + version = "*", + config = function() + require("toggleterm").setup { + -- size can be a number or function which is passed the current terminal + size = 10, + open_mapping = [[]], + hide_numbers = true, -- hide the number column in toggleterm buffers + shade_filetypes = {}, + shade_terminals = true, + shading_factor = 1, -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light + start_in_insert = true, + insert_mappings = true, -- whether or not the open mapping applies in insert mode + persist_size = true, + direction = 'horizontal', + } + end } } diff --git a/lua/plugs/nvim-lspconfig.lua b/lua/plugs/nvim-lspconfig.lua index 8c742a2..315fe12 100644 --- a/lua/plugs/nvim-lspconfig.lua +++ b/lua/plugs/nvim-lspconfig.lua @@ -237,10 +237,19 @@ return { 'nvim-treesitter/nvim-treesitter', config = function() local treesitter_opt = { - ensure_installed = {}, + ensure_installed = { + "c", + "cpp", + "python", + "java", + "lua", + "bash", + "vimdoc", + }, indent = { enable = true }, ignore_install = { - "go", "txt" + "txt", + "go" }, sync_install = false, auto_install = true, @@ -267,6 +276,7 @@ return { } require 'nvim-treesitter.configs'.setup(treesitter_opt) + require 'nvim-treesitter.install'.prefer_git = true end }, }, diff --git a/lua/plugs/toggleterm.lua b/lua/plugs/toggleterm.lua deleted file mode 100644 index e50069d..0000000 --- a/lua/plugs/toggleterm.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - -- amongst your other plugins - { - 'akinsho/toggleterm.nvim', - version = "*", - config = function() - require("toggleterm").setup { - -- size can be a number or function which is passed the current terminal - size = 10, - open_mapping = [[]], - hide_numbers = true, -- hide the number column in toggleterm buffers - shade_filetypes = {}, - shade_terminals = true, - shading_factor = 1, -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light - start_in_insert = true, - insert_mappings = true, -- whether or not the open mapping applies in insert mode - persist_size = true, - direction = 'horizontal', - } - end - }, - -} diff --git a/snippets/go.json b/snippets/go.json index 471e898..9b35bff 100644 --- a/snippets/go.json +++ b/snippets/go.json @@ -3,11 +3,11 @@ "prefix": "class", "body": "type $1 struct{$2}\n$0" }, - "err": { - "prefix": "err", + "errnil": { + "prefix": "errnil", "body": [ "if err != nil {", - " panic(err)$1", + " $1", "}" ] }