Compare commits

...

10 Commits

Author SHA1 Message Date
22dde69f49 first push 2024-08-24 01:14:49 +08:00
4498108b19 first push 2024-08-24 00:42:40 +08:00
89668c0024 first push 2024-08-24 00:39:19 +08:00
6abd9e80c4 update 2024-08-21 15:44:28 +08:00
newbie
840422bde1 update 2024-02-22 21:21:39 +08:00
newbie
e4c8ff2f16 update 2024-02-22 21:19:55 +08:00
newbie
6ad2dee781 update 2024-02-07 13:34:06 +08:00
newbie
bee651d083 update 2024-02-04 14:29:31 +08:00
newbie
6db4bc6b2a updae 2024-02-04 14:24:22 +08:00
newbie
bb38aab048 update 2024-02-01 14:22:05 +08:00
10 changed files with 118 additions and 56 deletions

View File

@ -7,7 +7,7 @@ if not G.loop.fs_stat(lazypath) then
"git", "git",
"clone", "clone",
"--filter=blob:none", "--filter=blob:none",
"http://git.qqnewbie.top/newbie/lazy.nvim.git", "https://github.com/folke/lazy.nvim.git",
"--branch=stable", "--branch=stable",
lazypath, lazypath,
}) })
@ -26,6 +26,7 @@ G.opt.rtp:prepend(lazypath)
require("keymap") require("keymap")
if G.g.vscode then if G.g.vscode then
require('vscode') require('vscode')
else else

View File

@ -1,6 +1,6 @@
local G = {} local G = {}
G.use_ssh = true G.use_ssh = false
G.g = vim.g G.g = vim.g
G.b = vim.b G.b = vim.b

View File

@ -30,6 +30,8 @@ G.map({
{ 'n', '<c-c>', ':q<CR>', opt }, { 'n', '<c-c>', ':q<CR>', opt },
{ 'n', '<c-S>', ':w !sudo tee %<CR>', opt }, { 'n', '<c-S>', ':w !sudo tee %<CR>', opt },
{ 'n', '<c-q>', ':q!<CR>', opt }, { 'n', '<c-q>', ':q!<CR>', opt },
{ 'v', '<cs-y>', '"+y', opt },
{ 'n', '<leader>y', 'ggyG', opt }, { 'n', '<leader>y', 'ggyG', opt },

22
lua/lsp/basedpyright.lua Normal file
View File

@ -0,0 +1,22 @@
return {
-- capabilities = require("cmp_nvim_lsp").default_capabilities(),
settings = {
basedpyright = {
analysis = {
autoSearchPaths = true,
diagnosticMode = "openFilesOnly",
useLibraryCodeForTypes = true,
typeCheckingMode = "standard"
},
},
},
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
}

View File

@ -56,7 +56,7 @@ G.au({ "InsertEnter" }, {
end, end,
}) })
G.au({ "VimEnter" }, { G.au({ "VimEnter", "BufEnter" }, {
pattern = { "*.code-snippets" }, pattern = { "*.code-snippets" },
callback = function() callback = function()
G.cmd("setfiletype json") G.cmd("setfiletype json")
@ -69,3 +69,23 @@ G.au({ "VimEnter" }, {
-- if index -- if index
-- } -- }
-- }) -- })
local function isempty(s)
return s == nil or s == ""
end
local function use_if_defined(val, fallback)
return val ~= nil and val or fallback
end
local conda_prefix = os.getenv("CONDA_PREFIX")
if not isempty(conda_prefix) then
vim.g.python_host_prog = use_if_defined(vim.g.python_host_prog, conda_prefix .. "/bin/python")
vim.g.python3_host_prog = use_if_defined(vim.g.python3_host_prog, conda_prefix .. "/bin/python")
else
vim.g.python_host_prog = use_if_defined(vim.g.python_host_prog, "python")
vim.g.python3_host_prog = use_if_defined(vim.g.python3_host_prog, "python3")
end

View File

@ -1,30 +1,28 @@
return { return {
'lilydjwg/colorizer', -- 颜色识别 'lilydjwg/colorizer', -- 颜色识别
{ -- "rest-nvim/rest.nvim",
-- 类似postman的curl工具 -- dependencies = { { "nvim-lua/plenary.nvim" } },
"rest-nvim/rest.nvim", -- config = function()
dependencies = { { "nvim-lua/plenary.nvim" } }, -- require("rest-nvim").setup({
config = function() -- --- Get the same options from Packer setup
require("rest-nvim").setup({ -- })
--- Get the same options from Packer setup -- end
}) -- },
end -- {
}, -- -- go开发
{ -- "ray-x/go.nvim",
-- go开发 -- dependencies = { -- optional packages
"ray-x/go.nvim", -- "ray-x/guihua.lua",
dependencies = { -- optional packages -- "neovim/nvim-lspconfig",
"ray-x/guihua.lua", -- "nvim-treesitter/nvim-treesitter",
"neovim/nvim-lspconfig", -- },
"nvim-treesitter/nvim-treesitter", -- config = function()
}, -- require("go").setup()
config = function() -- end,
require("go").setup() -- -- event = { "CmdlineEnter" },
end, -- ft = { "go", 'gomod' },
-- event = { "CmdlineEnter" }, -- build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
ft = { "go", 'gomod' }, -- },
build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
},
{ {
-- 终端 -- 终端
'akinsho/toggleterm.nvim', 'akinsho/toggleterm.nvim',

View File

@ -45,13 +45,14 @@ return {
end end
}, },
-- { -- {
-- "askfiy/nvim-picgo", -- 'kevinhwang91/nvim-ufo',
-- dependencies = {
-- 'kevinhwang91/promise-async'
-- },
-- config = function () -- config = function ()
-- G.map({ -- require("ufo").setup()
-- { 'n', '<leader>pp', ':UploadClipboard<CR>' }
-- })
-- require("nvim-picgo").setup()
-- end -- end
-- }, -- },
{ {
-- hop -- hop

View File

@ -11,11 +11,10 @@ return {
require 'lspconfig'.lua_ls.setup(require('lsp.lua')) require 'lspconfig'.lua_ls.setup(require('lsp.lua'))
require 'lspconfig'.clangd.setup(require('lsp.c')) require 'lspconfig'.clangd.setup(require('lsp.c'))
require 'lspconfig'.bashls.setup(require('lsp.bash')) 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'.yamlls.setup(require('lsp.yaml'))
require 'lspconfig'.gopls.setup(require('lsp.go')) require 'lspconfig'.gopls.setup(require('lsp.go'))
require 'lspconfig'.jsonls.setup(require('lsp.json')) require 'lspconfig'.jsonls.setup(require('lsp.json'))
require 'lspconfig'.javals.setup()
G.map({ G.map({
@ -51,13 +50,11 @@ return {
} }
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = { ensure_installed = {
"clangd",
"bashls", "bashls",
"pyright", -- "basedpyright",
"lua_ls", "lua_ls",
"jsonls", "jsonls",
"yamlls", "yamlls",
"gopls"
} }
}) })
end end

View File

@ -41,8 +41,8 @@
"#define head g.head", "#define head g.head",
"#define maps g.maps", "#define maps g.maps",
"#define add g.add", "#define add g.add",
"", ""
], ]
}, },
"Class_Graph_Dijkstra": { "Class_Graph_Dijkstra": {
"prefix": "Class_Graph_Dijkstra", "prefix": "Class_Graph_Dijkstra",
@ -74,8 +74,8 @@
" else", " else",
" return -1;", " return -1;",
"}", "}",
"", ""
], ]
}, },
"Class_Graph_SPFA": { "Class_Graph_SPFA": {
"prefix": "Class_Graph_SPFA", "prefix": "Class_Graph_SPFA",
@ -103,8 +103,8 @@
" if(dis[en] == inf) return -1;", " if(dis[en] == inf) return -1;",
" return dis[en];", " return dis[en];",
"}", "}",
"", ""
], ]
}, },
"Class_Graph_Kurskal": { "Class_Graph_Kurskal": {
"prefix": "Class_Graph_Kurskal", "prefix": "Class_Graph_Kurskal",
@ -121,8 +121,8 @@
" }", " }",
" return res;", " return res;",
"}", "}",
"", ""
], ]
}, },
"Class_Graph_Prim": { "Class_Graph_Prim": {
"prefix": "Class_Graph_Prim", "prefix": "Class_Graph_Prim",
@ -166,7 +166,7 @@
" ans = max(ans, max(up[i], dis1[i]));", " ans = max(ans, max(up[i], dis1[i]));",
" }", " }",
" return ans;", " return ans;",
"}", "}"
] ]
}, },
"Class_Graph_SCC": { "Class_Graph_SCC": {
@ -218,8 +218,8 @@
" return;", " return;",
" }", " }",
"};", "};",
"", ""
], ]
}, },
"Class_Graph_Euler": { "Class_Graph_Euler": {
"prefix": "Class_Graph_Euler", "prefix": "Class_Graph_Euler",
@ -270,7 +270,7 @@
"", "",
"};", "};",
"#define path eu.path", "#define path eu.path",
"", ""
] ]
}, },
"Class_Graph_LCA": { "Class_Graph_LCA": {
@ -318,8 +318,8 @@
" return fa[0][a];", " return fa[0][a];",
" }", " }",
"};", "};",
"", ""
], ]
}, },
"Class_Graph_erfen": { "Class_Graph_erfen": {
"prefix": "Class_Graph_erfen", "prefix": "Class_Graph_erfen",
@ -353,7 +353,7 @@
" return false;", " return false;",
" }", " }",
"};", "};",
"", ""
] ]
} }
} }

View File

@ -18,5 +18,26 @@
" $1", " $1",
"}" "}"
] ]
},
"ctx": {
"prefix": "ctx",
"body": [
"ctx := context.Background()"
]
},
"cok": {
"prefix": "cok",
"body": [
"c.JSON(http.StatusOK, vo.Success($1))"
]
},
"cbad": {
"prefix": "cbad",
"body": [
"if err != nil {",
" c.JSON(http.StatusBadRequest, vo.Fail(err))",
" return",
"}"
]
} }
} }