first push

This commit is contained in:
newbieQQ 2024-08-24 00:39:19 +08:00
parent 6abd9e80c4
commit 89668c0024
2 changed files with 18 additions and 3 deletions

View File

@ -1,5 +1,22 @@
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
return { return {
on_attach = function() on_attach = function()
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
G.api.nvim_create_user_command('R', function() G.api.nvim_create_user_command('R', function()
G.cmd [[set splitbelow]] G.cmd [[set splitbelow]]
G.cmd [[sp]] G.cmd [[sp]]

View File

@ -50,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