Skip to content

Commit

Permalink
Merge pull request #23 from TonyWu20/ayamir-main
Browse files Browse the repository at this point in the history
ayamir main
  • Loading branch information
TonyWu20 authored Jul 27, 2023
2 parents 55d0bc7 + 8a94272 commit 5d9be65
Show file tree
Hide file tree
Showing 11 changed files with 426 additions and 129 deletions.
482 changes: 385 additions & 97 deletions lazy-lock.json

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions lua/core/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,22 @@ local function load_options()
wrapscan = true,
writebackup = false,
}

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

-- custom python provider
local conda_prefix = os.getenv("CONDA_PREFIX")
if not isempty(conda_prefix) then
vim.g.python_host_prog = conda_prefix .. "/bin/python"
vim.g.python3_host_prog = conda_prefix .. "/bin/python"
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 = "python"
vim.g.python3_host_prog = "python3"
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

for name, value in pairs(global_local) do
Expand Down
2 changes: 1 addition & 1 deletion lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ settings["load_big_files_faster"] = true
-- Settings will complete their replacement at initialization.
-- Parameters will be automatically completed as you type.
-- Example: { sky = "#04A5E5" }
---@type palette
---@type palette[]
settings["palette_overwrite"] = {}

-- Set the colorscheme to use here.
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/configs/completion/lspsaga.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ return function()
frequency = 12,
},
ui = {
title = false,
title = true,
devicon = true,
border = "single", -- Can be single, double, rounded, solid, shadow.
actionfix = icons.ui.Spell,
Expand Down
40 changes: 25 additions & 15 deletions lua/modules/configs/completion/null-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,31 @@ return function()
handlers = {},
})

-- NOTE: Users don't need to specify null-ls sources if using only default config.
-- "mason-null-ls" will auto-setup for users.
-- mason_null_ls.setup_handlers({
-- black = function()
-- null_reg(btnf.black.with({ extra_args = { "--fast" } }))
-- end,
-- markdownlint = function()
-- null_reg(btnf.markdownlint)
-- null_reg(btnd.markdownlint.with({ extra_args = { "--disable MD033" } }))
-- end,
-- -- example for changing diagnostics_format
-- -- shellcheck = function()
-- -- null_reg(btnd.shellcheck.with({ diagnostics_format = "#{m} [#{s} #{c}]" }))
-- -- end,
-- })
-- Setup usercmd to register/deregister available source(s)
local function _gen_completion()
local sources_cont = null_ls.get_source({
filetype = vim.api.nvim_get_option_value("filetype", { scope = "local" }),
})
local completion_items = {}
for _, server in pairs(sources_cont) do
table.insert(completion_items, server.name)
end
return completion_items
end
vim.api.nvim_create_user_command("NullLsToggle", function(opts)
if vim.tbl_contains(_gen_completion(), opts.args) then
null_ls.toggle({ name = opts.args })
else
vim.notify(
string.format("[Null-ls] Unable to find any registered source named [%s].", opts.args),
vim.log.levels.ERROR,
{ title = "Null-ls Internal Error" }
)
end
end, {
nargs = 1,
complete = _gen_completion,
})

require("completion.formatting").configure_format_on_save()
end
5 changes: 0 additions & 5 deletions lua/modules/configs/editor/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ return vim.schedule_wrap(function()
},
},
},
rainbow = {
enable = true,
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
max_file_lines = 2000, -- Do not enable for files with more than 2000 lines, int
},
context_commentstring = { enable = true, enable_autocmd = false },
matchup = { enable = true },
})
Expand Down
4 changes: 2 additions & 2 deletions lua/modules/configs/ui/lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ return function()
if vim.api.nvim_get_option_value("filetype", { scope = "local" }) == "python" then
local venv = os.getenv("CONDA_DEFAULT_ENV")
if venv then
return string.format("%s", env_cleanup(venv))
return icons.misc.PyEnv .. env_cleanup(venv)
end
venv = os.getenv("VIRTUAL_ENV")
if venv then
return string.format("%s", env_cleanup(venv))
return icons.misc.PyEnv .. env_cleanup(venv)
end
end
return ""
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ completion["neovim/nvim-lspconfig"] = {
{ "williamboman/mason.nvim" },
{ "williamboman/mason-lspconfig.nvim" },
{
"ray-x/lsp_signature.nvim",
"Jint-lzxy/lsp_signature.nvim",
config = require("completion.lsp-signature"),
},
},
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ editor["LunarVim/bigfile.nvim"] = {
}
editor["ojroques/nvim-bufdel"] = {
lazy = true,
event = "BufReadPre",
cmd = { "BufDel", "BufDelAll", "BufDelOthers" },
}
editor["rhysd/clever-f.vim"] = {
lazy = true,
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/utils/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ local data = {
Gavel = "",
Glass = "󰂖",
NoActiveLsp = "󱚧",
PyEnv = "󰌠",
PyEnv = "󰢩",
Squirrel = "",
Tag = "",
Tree = "",
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function M.gen_lspkind_hl()
Package = colors.blue,
Property = colors.teal,
Struct = colors.yellow,
TypeParameter = colors.maroon,
TypeParameter = colors.blue,
Variable = colors.peach,
Array = colors.peach,
Boolean = colors.peach,
Expand Down

0 comments on commit 5d9be65

Please sign in to comment.