nvim: Move util to core.util module
Moved all utility functions from their own directory into the core functionality direcotyr as a single file.
This commit is contained in:
parent
e939305df3
commit
405af0f020
11 changed files with 32 additions and 59 deletions
|
|
@ -165,7 +165,7 @@ local python_path
|
|||
lspconfig.pyright.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
if python_path == nil then
|
||||
python_path, _ = require("util").get_python_venv(client.config.root_dir)
|
||||
python_path, _ = require("core.util").get_python_venv(client.config.root_dir)
|
||||
end
|
||||
-- print(string.format("[PYTHON VENV]: %s", vim.inspect(python_path)))
|
||||
client.config.settings.python.pythonPath = python_path
|
||||
|
|
@ -176,14 +176,14 @@ lspconfig.ruff_lsp.setup({
|
|||
on_attach = function(client, bufnr)
|
||||
on_attach(client, bufnr)
|
||||
if python_path == nil then
|
||||
python_path, _ = require("util").get_python_venv(client.config.root_dir)
|
||||
python_path, _ = require("core.util").get_python_venv(client.config.root_dir)
|
||||
end
|
||||
client.config.settings.python.pythonPath = python_path
|
||||
end,
|
||||
})
|
||||
|
||||
-- set up arduino with the help of arduino.nvim plugin
|
||||
if require("util").is_available("arduino") then
|
||||
if require("core.util").is_available("arduino") then
|
||||
lspconfig.arduino_language_server.setup({
|
||||
on_new_config = require("arduino").on_new_config,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ return {
|
|||
hooks = {
|
||||
pre = function()
|
||||
-- use treesitter commentstring functionality if it's installed
|
||||
if require("util").is_available("ts_context_commentstring") then
|
||||
if require("core.util").is_available("ts_context_commentstring") then
|
||||
require("ts_context_commentstring.internal").update_commentstring()
|
||||
end
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ return {
|
|||
}),
|
||||
},
|
||||
})
|
||||
if require("util").is_available("which-key") then
|
||||
if require("core.util").is_available("which-key") then
|
||||
require("which-key").register({ ["<localleader>t"] = { name = "+test" } })
|
||||
end
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ local prose_plugs = {
|
|||
{
|
||||
"mickael-menu/zk-nvim",
|
||||
config = function()
|
||||
if require("util").is_available("which-key") then
|
||||
if require("core.util").is_available("which-key") then
|
||||
local prefix = require("which-key").register
|
||||
prefix({ ["<leader>n"] = { name = "+notes" } })
|
||||
prefix({ ["<localleader>n"] = { name = "+note" } })
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ return {
|
|||
},
|
||||
cmd = "Telescope",
|
||||
config = function()
|
||||
if require("util").is_available("which-key") then
|
||||
if require("core.util").is_available("which-key") then
|
||||
require("which-key").register({ ["<leader>f"] = { name = "+find" } })
|
||||
end
|
||||
-- Setup up telescope fuzzy finding settings
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ return {
|
|||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
|
||||
-- need to disable indentlines since they obscure first line of terminal
|
||||
if require("util").is_available("mini.nvim") then
|
||||
if require("core.util").is_available("mini.nvim") then
|
||||
vim.api.nvim_create_autocmd({ "TermOpen" }, {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue