Updated config
This commit is contained in:
19
.emmyrc.json
19
.emmyrc.json
@@ -1,20 +1,29 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
|
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
|
||||||
|
"diagnostics": {
|
||||||
|
"disable": [
|
||||||
|
"undefined-field",
|
||||||
|
"undefined-field"
|
||||||
|
]
|
||||||
|
},
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"version": "LuaJIT",
|
|
||||||
"requirePattern": [
|
"requirePattern": [
|
||||||
"lua/?.lua",
|
"lua/?.lua",
|
||||||
"lua/?/init.lua",
|
"lua/?/init.lua",
|
||||||
"?/lua/?.lua",
|
"?/lua/?.lua",
|
||||||
"?/lua/?/init.lua"
|
"?/lua/?/init.lua"
|
||||||
]
|
],
|
||||||
|
"version": "LuaJIT"
|
||||||
},
|
},
|
||||||
"workspace": {
|
"workspace": {
|
||||||
|
"ignoreGlobs": [
|
||||||
|
"**/*_spec.lua"
|
||||||
|
],
|
||||||
"library": [
|
"library": [
|
||||||
"$VIMRUNTIME",
|
"$VIMRUNTIME",
|
||||||
"$HOME/.local/share/nvim/lazy/luvit-meta",
|
"$HOME/.local/share/nvim/lazy/luvit-meta",
|
||||||
"$HOME/.local/share/nvim/lazy/lazy.nvim"
|
"$HOME/.local/share/nvim/lazy/lazy.nvim",
|
||||||
],
|
"$HOME/.local/share/nvim/lazy"
|
||||||
"ignoreGlobs": ["**/*_spec.lua"]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ cmd("SetTheme", function(arg)
|
|||||||
|
|
||||||
local allthemes = themefuncs.get_all_themes()
|
local allthemes = themefuncs.get_all_themes()
|
||||||
if vim.tbl_contains(allthemes, themeselected) then
|
if vim.tbl_contains(allthemes, themeselected) then
|
||||||
|
---@diagnostic disable-next-line: param-type-not-match
|
||||||
themefuncs.change_theme(themeselected)
|
themefuncs.change_theme(themeselected)
|
||||||
else
|
else
|
||||||
vim.notify("Invalid selection", vim.log.levels.ERROR)
|
vim.notify("Invalid selection", vim.log.levels.ERROR)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
--- @type Maps
|
||||||
local M = {
|
local M = {
|
||||||
v = {
|
v = {
|
||||||
["J"] = { ":m '>+1<CR>gv=gv" },
|
["J"] = { ":m '>+1<CR>gv=gv" },
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ vim.opt.rtp:prepend(lazypath)
|
|||||||
|
|
||||||
local lazy = require("lazy")
|
local lazy = require("lazy")
|
||||||
|
|
||||||
--- @type LazyPluginSpec[]
|
|
||||||
local plugins = {
|
local plugins = {
|
||||||
{ import = "taken.plugins" },
|
{ import = "taken.plugins" },
|
||||||
{ import = "taken.plugins.lsp" },
|
{ import = "taken.plugins.lsp" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
--- @type LazyConfig
|
--- @type LazyConfig
|
||||||
local opts = {
|
local opts = {
|
||||||
checker = {
|
checker = {
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ return {
|
|||||||
local line3 = " " .. version
|
local line3 = " " .. version
|
||||||
|
|
||||||
local line1_width = vim.fn.strdisplaywidth(line1)
|
local line1_width = vim.fn.strdisplaywidth(line1)
|
||||||
|
---@diagnostic disable-next-line: param-type-not-match
|
||||||
local line2Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line2)) / 2) .. line2
|
local line2Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line2)) / 2) .. line2
|
||||||
|
---@diagnostic disable-next-line: param-type-not-match
|
||||||
local line3Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line3)) / 2) .. line3
|
local line3Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line3)) / 2) .. line3
|
||||||
|
|
||||||
dashboard.section.footer.val = {
|
dashboard.section.footer.val = {
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ return {
|
|||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
config = function()
|
config = function()
|
||||||
local function checkPrettierConfig()
|
local function checkPrettierConfig()
|
||||||
local prettier_config = vim.fn.glob(".prettierrc*", false, 1)
|
local prettier_config = vim.fn.glob(".prettierrc*", false, true)
|
||||||
if prettier_config[1] == nil then
|
if prettier_config[1] == nil then
|
||||||
return false
|
return false
|
||||||
|
else
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -40,6 +42,11 @@ return {
|
|||||||
local range = nil
|
local range = nil
|
||||||
if args.count ~= -1 then
|
if args.count ~= -1 then
|
||||||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||||
|
|
||||||
|
if end_line == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
range = {
|
range = {
|
||||||
start = { args.line1, 0 },
|
start = { args.line1, 0 },
|
||||||
["end"] = { args.line2, end_line:len() },
|
["end"] = { args.line2, end_line:len() },
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: undefined-field
|
||||||
--- @type LazyPluginSpec
|
--- @type LazyPluginSpec
|
||||||
return {
|
return {
|
||||||
"ThePrimeagen/harpoon",
|
"ThePrimeagen/harpoon",
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ return {
|
|||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
main = "ibl",
|
main = "ibl",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
enabled = false,
|
|
||||||
config = function()
|
config = function()
|
||||||
local blankline = require("ibl")
|
local blankline = require("ibl")
|
||||||
local hooks = require("ibl.hooks")
|
local hooks = require("ibl.hooks")
|
||||||
@@ -12,38 +11,21 @@ return {
|
|||||||
vim.opt.listchars:append("space:⋅")
|
vim.opt.listchars:append("space:⋅")
|
||||||
|
|
||||||
local highlight = {
|
local highlight = {
|
||||||
"RainbowDelimiterRed",
|
"CursorColumn",
|
||||||
"RainbowDelimiterYellow",
|
"Whitespace",
|
||||||
"RainbowDelimiterBlue",
|
|
||||||
"RainbowDelimiterOrange",
|
|
||||||
"RainbowDelimiterGreen",
|
|
||||||
"RainbowDelimiterViolet",
|
|
||||||
"RainbowDelimiterCyan",
|
|
||||||
}
|
}
|
||||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowDelimiterRed", { fg = "#E06C75" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowDelimiterYellow", { fg = "#E5C07B" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowDelimiterBlue", { fg = "#61AFEF" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowDelimiterOrange", { fg = "#D19A66" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowDelimiterGreen", { fg = "#98C379" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowDelimiterViolet", { fg = "#C678DD" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowDelimiterCyan", { fg = "#56B6C2" })
|
|
||||||
end)
|
|
||||||
|
|
||||||
vim.g.rainbow_delimiters = { highlight = highlight }
|
|
||||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
|
||||||
|
|
||||||
blankline.setup({
|
blankline.setup({
|
||||||
indent = {
|
|
||||||
char = "│",
|
|
||||||
highlight = highlight,
|
|
||||||
},
|
|
||||||
scope = {
|
scope = {
|
||||||
enabled = true,
|
enabled = false,
|
||||||
char = "│",
|
char = "│",
|
||||||
highlight = highlight,
|
|
||||||
show_exact_scope = true,
|
show_exact_scope = true,
|
||||||
},
|
},
|
||||||
|
indent = { highlight = highlight, char = "" },
|
||||||
|
whitespace = {
|
||||||
|
highlight = highlight,
|
||||||
|
remove_blankline_trail = false,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,15 +11,16 @@ return {
|
|||||||
},
|
},
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
config = function()
|
config = function()
|
||||||
|
local blink = require("blink.cmp")
|
||||||
|
-- local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||||
local tserrortranslator = require("ts-error-translator")
|
local tserrortranslator = require("ts-error-translator")
|
||||||
local on_attach = require("taken.utils.on_attach")
|
local on_attach = require("taken.utils.on_attach")
|
||||||
local get_python_path = require("taken.utils.lsp").get_python_path
|
local get_python_path = require("taken.utils.lsp").get_python_path
|
||||||
|
|
||||||
-- local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
|
||||||
-- local capabilities = cmp_nvim_lsp.default_capabilities()
|
-- local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
|
|
||||||
local blink = require("blink.cmp")
|
local default_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
local capabilities = blink.get_lsp_capabilities()
|
local capabilities = vim.tbl_deep_extend("force", default_capabilities, blink.get_lsp_capabilities({}, false))
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
signs = {
|
signs = {
|
||||||
@@ -41,41 +42,45 @@ return {
|
|||||||
"eslint",
|
"eslint",
|
||||||
"cspell_ls",
|
"cspell_ls",
|
||||||
"kulala_ls",
|
"kulala_ls",
|
||||||
-- "emmylua_ls",
|
"emmylua_ls",
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config("*", {
|
vim.lsp.config("*", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
---@diagnostic disable-next-line: assign-type-mismatch
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--- @class LspConfigs
|
||||||
|
--- @field lsp string
|
||||||
|
--- @field config vim.lsp.Config
|
||||||
local lsps = {
|
local lsps = {
|
||||||
{
|
-- {
|
||||||
lsp = "lua_ls",
|
-- lsp = "lua_ls",
|
||||||
config = {
|
-- config = {
|
||||||
capabilities = capabilities,
|
-- capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
-- on_attach = on_attach,
|
||||||
settings = {
|
-- settings = {
|
||||||
Lua = {
|
-- Lua = {
|
||||||
hint = {
|
-- hint = {
|
||||||
enable = true,
|
-- enable = true,
|
||||||
},
|
-- },
|
||||||
runtime = {
|
-- runtime = {
|
||||||
version = "LuaJIT",
|
-- version = "LuaJIT",
|
||||||
},
|
-- },
|
||||||
diagnostics = {
|
-- diagnostics = {
|
||||||
globals = { "vim" },
|
-- globals = { "vim" },
|
||||||
},
|
-- },
|
||||||
completion = {
|
-- completion = {
|
||||||
callSnippet = "Replace",
|
-- callSnippet = "Replace",
|
||||||
},
|
-- },
|
||||||
format = {
|
-- format = {
|
||||||
enable = false,
|
-- enable = false,
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
{
|
{
|
||||||
lsp = "pyright",
|
lsp = "pyright",
|
||||||
config = {
|
config = {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local on_attach = require("taken.utils.on_attach")
|
local on_attach = require("taken.utils.on_attach")
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: missing-fields, param-type-not-match, missing-parameter
|
||||||
require("tailwind-tools").setup({
|
require("tailwind-tools").setup({
|
||||||
server = {
|
server = {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ return {
|
|||||||
timeout = 2500,
|
timeout = 2500,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: assign-type-mismatch
|
||||||
vim.notify = notify
|
vim.notify = notify
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---@diagnostic disable: undefined-field
|
||||||
--- @type LazyPluginSpec
|
--- @type LazyPluginSpec
|
||||||
return {
|
return {
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ return {
|
|||||||
Snacks.notifier.show_history()
|
Snacks.notifier.show_history()
|
||||||
end, { desc = "Show notification history" })
|
end, { desc = "Show notification history" })
|
||||||
vim.keymap.set("n", "<leader>oh", function()
|
vim.keymap.set("n", "<leader>oh", function()
|
||||||
snacks.notifier.show_history()
|
Snacks.notifier.show_history()
|
||||||
end, { desc = "Show notification history" })
|
end, { desc = "Show notification history" })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
-- maps
|
-- maps
|
||||||
--- @class MappingOpts
|
--- @class MappingOpts
|
||||||
--- @field [1] string
|
--- @field [1] string | function
|
||||||
--- @field desc string
|
--- @field desc string?
|
||||||
|
|
||||||
--- @alias Mapping table<string, MappingOpts>
|
--- @alias Mapping table<string, MappingOpts>
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
--- @param client vim.lsp.Client
|
--- @param client vim.lsp.Client
|
||||||
--- @param bufnr number
|
--- @param bufnr number
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
|
--- @param desc string?
|
||||||
|
--- @return vim.keymap.set.Opts?
|
||||||
local function opts(desc)
|
local function opts(desc)
|
||||||
if desc then
|
if desc then
|
||||||
|
---@diagnostic disable-next-line: return-type-mismatch
|
||||||
return { silent = true, buffer = bufnr, desc = desc }
|
return { silent = true, buffer = bufnr, desc = desc }
|
||||||
else
|
else
|
||||||
|
---@diagnostic disable-next-line: return-type-mismatch
|
||||||
return { silent = true, buffer = bufnr }
|
return { silent = true, buffer = bufnr }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -31,6 +35,7 @@ local on_attach = function(client, bufnr)
|
|||||||
end, opts("Get code actions"))
|
end, opts("Get code actions"))
|
||||||
vim.keymap.set("n", "<leader>vr", function()
|
vim.keymap.set("n", "<leader>vr", function()
|
||||||
return ":IncRename " .. vim.fn.expand("<cword>")
|
return ":IncRename " .. vim.fn.expand("<cword>")
|
||||||
|
---@diagnostic disable-next-line: param-type-not-match
|
||||||
end, { expr = true, silent = true, buffer = bufnr, desc = "Rename symbol" })
|
end, { expr = true, silent = true, buffer = bufnr, desc = "Rename symbol" })
|
||||||
vim.keymap.set("n", "<leader>vn", function()
|
vim.keymap.set("n", "<leader>vn", function()
|
||||||
vim.lsp.buf.rename()
|
vim.lsp.buf.rename()
|
||||||
@@ -41,6 +46,10 @@ local on_attach = function(client, bufnr)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if client.server_capabilities == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if client.server_capabilities.inlayHintProvider then
|
if client.server_capabilities.inlayHintProvider then
|
||||||
local current_state = vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr })
|
local current_state = vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr })
|
||||||
vim.lsp.inlay_hint.enable(not current_state, { bufnr = bufnr })
|
vim.lsp.inlay_hint.enable(not current_state, { bufnr = bufnr })
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ local get_all_themes = function()
|
|||||||
|
|
||||||
local colors = vim.fn.globpath(vim.o.rtp, "colors/*", true, true)
|
local colors = vim.fn.globpath(vim.o.rtp, "colors/*", true, true)
|
||||||
local dataDir = vim.fn.stdpath("data")
|
local dataDir = vim.fn.stdpath("data")
|
||||||
---@diagnostic disable-next-line: param-type-mismatch
|
---@diagnostic disable-next-line: param-type-not-match
|
||||||
local newpath = string.gsub(dataDir, "%-", "%%-")
|
local newpath = string.gsub(dataDir, "%-", "%%-")
|
||||||
local themes = {}
|
local themes = {}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ function M.themeselector(opts)
|
|||||||
if selection == nil then
|
if selection == nil then
|
||||||
vim.notify("Error while selecting theme", vim.log.levels.ERROR)
|
vim.notify("Error while selecting theme", vim.log.levels.ERROR)
|
||||||
end
|
end
|
||||||
|
---@diagnostic disable-next-line: need-check-nil
|
||||||
vim.cmd("colorscheme " .. selection.value)
|
vim.cmd("colorscheme " .. selection.value)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user