20250529.1748531195

This commit is contained in:
fz0x1 2025-05-29 17:06:35 +02:00
parent b5ae1c2bbc
commit 7ede1e15c9
Signed by: fz0x1
GPG key ID: 6F81647BE1B459F4
5 changed files with 119 additions and 115 deletions

View file

@ -0,0 +1,3 @@
vim.bo.shiftwidth = 2
vim.bo.expandtab = true
vim.bo.tabstop = 2

View file

@ -68,7 +68,7 @@ opt.clipboard:append("unnamedplus")
opt.modifiable = true opt.modifiable = true
opt.encoding = "UTF-8" opt.encoding = "UTF-8"
opt.fileencoding = "utf-8" opt.fileencoding = "utf-8"
opt.cursorline = false opt.cursorline = true
-- spell -- spell
opt.spelllang = "en_us,ru" opt.spelllang = "en_us,ru"

View file

@ -13,6 +13,9 @@ return {
json = { "biome" }, json = { "biome" },
sh = { "shfmt" }, sh = { "shfmt" },
markdown = { "prettier" }, markdown = { "prettier" },
css = { "prettier" },
html = { "prettier" },
htmldjango = { "prettier" },
["*"] = { "trim_whitespace", "codespell" }, ["*"] = { "trim_whitespace", "codespell" },
}, },
format_on_save = { format_on_save = {

View file

@ -1,85 +1,114 @@
local config = function() local config = function()
local lsp_zero = require("lsp-zero")
local luasnip = require("luasnip") local luasnip = require("luasnip")
local diagnostic_signs = require("utils.icons").diagnostic_signs
lsp_zero.on_attach(function(_, bufnr) vim.diagnostic.config({
vim.diagnostic.config({ virtual_text = false, -- disable virtual text
virtual_text = false, -- disable virtual text update_in_insert = true,
update_in_insert = true, underline = true,
underline = true, severity_sort = true,
severity_sort = true, float = {
float = { focusable = true,
focusable = true, style = "minimal",
style = "minimal", border = "rounded",
border = "rounded", source = true,
source = true, header = "",
header = "", prefix = "",
prefix = "", },
}, })
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { vim.keymap.set("n", "gd", function()
border = "rounded", vim.lsp.buf.definition()
}) end)
vim.keymap.set("n", "Q", function()
vim.lsp.buf.hover()
end)
vim.keymap.set("n", "<leader>vws", function()
vim.lsp.buf.workspace_symbol()
end)
vim.keymap.set("n", "<leader>vd", function()
vim.diagnostic.open_float()
end)
vim.keymap.set("n", "[d", function()
vim.diagnostic.jump({count=-1, float=true})
end)
vim.keymap.set("n", "]d", function()
vim.diagnostic.jump({count=-1, float=true})
end)
vim.keymap.set("n", "<leader>ca", function()
vim.lsp.buf.code_action()
end)
vim.keymap.set("n", "<leader>vrr", function()
vim.lsp.buf.references()
end)
vim.keymap.set("n", "<leader>vrn", function()
vim.lsp.buf.rename()
end)
vim.keymap.set("i", "<C-h>", function()
vim.lsp.buf.signature_help()
end)
vim.keymap.set("n", "<leader>gi", function()
vim.lsp.buf.implementation()
end)
-- nvim-lint
-- vim.keymap.set("n", "<leader>li", function()
-- require("lint").try_lint()
-- end)
-- conform
-- vim.keymap.set("n", "<leader>fr", function()
-- require("conform").format({ bufnr = bufnr })
-- end)
local opts = { buffer = bufnr, remap = false } -- vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
-- border = "rounded",
-- })
--
-- vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
-- border = "rounded",
-- })
vim.keymap.set("n", "gd", function() vim.lsp.config('lua_ls', {
vim.lsp.buf.definition() settings = {
end, opts) Lua = {
vim.keymap.set("n", "K", function() runtime = {
vim.lsp.buf.hover() -- Tell the language server which version of Lua you're using
end, opts) version = 'LuaJIT',
vim.keymap.set("n", "<leader>vws", function() },
vim.lsp.buf.workspace_symbol() diagnostics = {
end, opts) -- Get the language server to recognize the `vim` global
vim.keymap.set("n", "<leader>vd", function() globals = {'vim'}
vim.diagnostic.open_float() },
end, opts) workspace = {
vim.keymap.set("n", "[d", function() checkThirdParty = false,
vim.diagnostic.goto_next() library = {
end, opts) -- Make the server aware of Neovim runtime files
vim.keymap.set("n", "]d", function() vim.env.VIMRUNTIME,
vim.diagnostic.goto_prev() vim.fn.stdpath('config'),
end, opts) },
vim.keymap.set("n", "<leader>ca", function() },
vim.lsp.buf.code_action() }
end, opts) }
vim.keymap.set("n", "<leader>vrr", function() })
vim.lsp.buf.references()
end, opts)
vim.keymap.set("n", "<leader>vrn", function()
vim.lsp.buf.rename()
end, opts)
vim.keymap.set("i", "<C-h>", function()
vim.lsp.buf.signature_help()
end, opts)
vim.keymap.set("n", "<leader>gi", function()
vim.lsp.buf.implementation()
end, opts)
-- nvim-lint
vim.keymap.set("n", "<leader>li", function()
require("lint").try_lint()
end, opts)
-- conform
vim.keymap.set("n", "<leader>fr", function()
require("conform").format({ bufnr = bufnr })
end, opts)
end)
lsp_zero.set_sign_icons({ vim.lsp.config('pyright', {
error = diagnostic_signs.Error, require("lspconfig").pyright.setup({
warn = diagnostic_signs.Warn, settings = {
hint = diagnostic_signs.Hint, python = {
info = diagnostic_signs.Info, analysis = {
}) typeCheckingMode = "off",
},
},
},
})
})
require("mason").setup({}) -- vim.lsp.config('clangd', {
-- require("lspconfig").clangd.setup({
-- vim.b.lsp_zero_enable_autoformat = 0
-- })
-- })
require("mason").setup()
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = { ensure_installed = {
"bashls", "bashls",
@ -89,45 +118,13 @@ local config = function()
"jsonls", "jsonls",
"clangd", "clangd",
"biome", -- will install for formatting only "biome", -- will install for formatting only
"marksman", -- "ruff",
"ruff",
-- "marksman", -- "marksman",
}, },
automatic_installation = true, automatic_enable = {
handlers = { exclude = { "ruff", "biome" }
-- lsp_zero.default_setup, }
-- https://github.com/neovim/nvim-lspconfig/pull/3232 })
function(server_name)
if server_name == "tsserver" then
server_name = "ts_ls"
else
lsp_zero.default_setup(server_name)
end
end,
lua_ls = function()
local lua_opts = lsp_zero.nvim_lua_ls()
require("lspconfig").lua_ls.setup(lua_opts)
end,
pyright = function()
require("lspconfig").pyright.setup({
settings = {
python = {
analysis = {
typeCheckingMode = "off",
},
},
},
})
end,
biome = function() -- use tsserver instead
return {}
end,
clangd = function()
vim.b.lsp_zero_enable_autoformat = 0
end,
require("lspconfig").marksman.setup({}),
},
})
local cmp = require("cmp") local cmp = require("cmp")
local cmp_select = { behavior = cmp.SelectBehavior.Select } local cmp_select = { behavior = cmp.SelectBehavior.Select }
@ -151,7 +148,7 @@ local config = function()
{ name = "nvim_lua" }, { name = "nvim_lua" },
{ name = "buffer" }, { name = "buffer" },
}, },
formatting = lsp_zero.cmp_format(), -- formatting = lsp_zero.cmp_format(),
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
-- ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), -- ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
["<Tab>"] = cmp.mapping.select_next_item(cmp_select), ["<Tab>"] = cmp.mapping.select_next_item(cmp_select),
@ -178,14 +175,12 @@ local config = function()
end end
return { return {
"VonHeikemen/lsp-zero.nvim", "neovim/nvim-lspconfig",
branch = "v3.x",
config = config, config = config,
lazy = false, lazy = false,
dependencies = { dependencies = {
"williamboman/mason.nvim", "williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",

View file

@ -15,6 +15,9 @@ set -g default-terminal tmux-256color
set -sa terminal-features ',alacritty:RGB' set -sa terminal-features ',alacritty:RGB'
set -ga terminal-overrides ",*256col*:Tc" set -ga terminal-overrides ",*256col*:Tc"
set -g pane-active-border-style 'fg=orange'
# reset gpg-agent password cache after close the pane (vimwiki diary) # reset gpg-agent password cache after close the pane (vimwiki diary)
set-hook -g window-unlinked 'run-shell "gpgconf --reload gpg-agent"' set-hook -g window-unlinked 'run-shell "gpgconf --reload gpg-agent"'