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