From 6abd9e80c4c38b01149d0e8bb431e6389d97a80c Mon Sep 17 00:00:00 2001 From: newbie Date: Wed, 21 Aug 2024 15:44:28 +0800 Subject: [PATCH] update --- init.lua | 2 +- lua/lsp/basedpyright.lua | 11 +++++++++ lua/plugs/dev.lua | 48 +++++++++++++++++------------------- lua/plugs/nvim-lspconfig.lua | 2 +- 4 files changed, 36 insertions(+), 27 deletions(-) create mode 100644 lua/lsp/basedpyright.lua diff --git a/init.lua b/init.lua index c141d77..891b5df 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ if not G.loop.fs_stat(lazypath) then "git", "clone", "--filter=blob:none", - "http://git.qqnewbie.top/newbie/lazy.nvim.git", + "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath, }) diff --git a/lua/lsp/basedpyright.lua b/lua/lsp/basedpyright.lua new file mode 100644 index 0000000..d0898f9 --- /dev/null +++ b/lua/lsp/basedpyright.lua @@ -0,0 +1,11 @@ +return { + on_attach = function() + G.api.nvim_create_user_command('R', function() + G.cmd [[set splitbelow]] + G.cmd [[sp]] + G.cmd [[term python3 %]] + G.cmd [[resize 10]] + G.cmd [[startinsert]] + end, {}) + end +} diff --git a/lua/plugs/dev.lua b/lua/plugs/dev.lua index a2c3355..d82797e 100644 --- a/lua/plugs/dev.lua +++ b/lua/plugs/dev.lua @@ -1,30 +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 - }, + -- "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 + -- }, { -- 终端 'akinsho/toggleterm.nvim', diff --git a/lua/plugs/nvim-lspconfig.lua b/lua/plugs/nvim-lspconfig.lua index 6fd3d4f..d13a955 100644 --- a/lua/plugs/nvim-lspconfig.lua +++ b/lua/plugs/nvim-lspconfig.lua @@ -11,7 +11,7 @@ return { require 'lspconfig'.lua_ls.setup(require('lsp.lua')) require 'lspconfig'.clangd.setup(require('lsp.c')) require 'lspconfig'.bashls.setup(require('lsp.bash')) - require 'lspconfig'.pyright.setup(require('lsp.pyright')) + require 'lspconfig'.basedpyright.setup(require('lsp.basedpyright')) require 'lspconfig'.yamlls.setup(require('lsp.yaml')) require 'lspconfig'.gopls.setup(require('lsp.go')) require 'lspconfig'.jsonls.setup(require('lsp.json'))