20250529.1748531195
This commit is contained in:
parent
b5ae1c2bbc
commit
7ede1e15c9
5 changed files with 119 additions and 115 deletions
3
global/.config/nvim/ftplugin/html.lua
Normal file
3
global/.config/nvim/ftplugin/html.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
vim.bo.shiftwidth = 2
|
||||||
|
vim.bo.expandtab = true
|
||||||
|
vim.bo.tabstop = 2
|
|
@ -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"
|
||||||
|
|
|
@ -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 = {
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
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,
|
||||||
|
@ -19,96 +16,81 @@ local config = function()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
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",
|
|
||||||
})
|
|
||||||
|
|
||||||
local opts = { buffer = bufnr, remap = false }
|
|
||||||
|
|
||||||
vim.keymap.set("n", "gd", function()
|
vim.keymap.set("n", "gd", function()
|
||||||
vim.lsp.buf.definition()
|
vim.lsp.buf.definition()
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "K", function()
|
vim.keymap.set("n", "Q", function()
|
||||||
vim.lsp.buf.hover()
|
vim.lsp.buf.hover()
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "<leader>vws", function()
|
vim.keymap.set("n", "<leader>vws", function()
|
||||||
vim.lsp.buf.workspace_symbol()
|
vim.lsp.buf.workspace_symbol()
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "<leader>vd", function()
|
vim.keymap.set("n", "<leader>vd", function()
|
||||||
vim.diagnostic.open_float()
|
vim.diagnostic.open_float()
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "[d", function()
|
vim.keymap.set("n", "[d", function()
|
||||||
vim.diagnostic.goto_next()
|
vim.diagnostic.jump({count=-1, float=true})
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "]d", function()
|
vim.keymap.set("n", "]d", function()
|
||||||
vim.diagnostic.goto_prev()
|
vim.diagnostic.jump({count=-1, float=true})
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "<leader>ca", function()
|
vim.keymap.set("n", "<leader>ca", function()
|
||||||
vim.lsp.buf.code_action()
|
vim.lsp.buf.code_action()
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "<leader>vrr", function()
|
vim.keymap.set("n", "<leader>vrr", function()
|
||||||
vim.lsp.buf.references()
|
vim.lsp.buf.references()
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "<leader>vrn", function()
|
vim.keymap.set("n", "<leader>vrn", function()
|
||||||
vim.lsp.buf.rename()
|
vim.lsp.buf.rename()
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("i", "<C-h>", function()
|
vim.keymap.set("i", "<C-h>", function()
|
||||||
vim.lsp.buf.signature_help()
|
vim.lsp.buf.signature_help()
|
||||||
end, opts)
|
end)
|
||||||
vim.keymap.set("n", "<leader>gi", function()
|
vim.keymap.set("n", "<leader>gi", function()
|
||||||
vim.lsp.buf.implementation()
|
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)
|
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)
|
||||||
|
|
||||||
lsp_zero.set_sign_icons({
|
-- vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||||
error = diagnostic_signs.Error,
|
-- border = "rounded",
|
||||||
warn = diagnostic_signs.Warn,
|
-- })
|
||||||
hint = diagnostic_signs.Hint,
|
--
|
||||||
info = diagnostic_signs.Info,
|
-- vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||||
|
-- border = "rounded",
|
||||||
|
-- })
|
||||||
|
|
||||||
|
vim.lsp.config('lua_ls', {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
-- Get the language server to recognize the `vim` global
|
||||||
|
globals = {'vim'}
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = {
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
vim.env.VIMRUNTIME,
|
||||||
|
vim.fn.stdpath('config'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
require("mason").setup({})
|
vim.lsp.config('pyright', {
|
||||||
require("mason-lspconfig").setup({
|
|
||||||
ensure_installed = {
|
|
||||||
"bashls",
|
|
||||||
"ts_ls",
|
|
||||||
"pyright",
|
|
||||||
"lua_ls",
|
|
||||||
"jsonls",
|
|
||||||
"clangd",
|
|
||||||
"biome", -- will install for formatting only
|
|
||||||
"marksman",
|
|
||||||
"ruff",
|
|
||||||
-- "marksman",
|
|
||||||
},
|
|
||||||
automatic_installation = true,
|
|
||||||
handlers = {
|
|
||||||
-- 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({
|
require("lspconfig").pyright.setup({
|
||||||
settings = {
|
settings = {
|
||||||
python = {
|
python = {
|
||||||
|
@ -118,15 +100,30 @@ local config = function()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
})
|
||||||
biome = function() -- use tsserver instead
|
|
||||||
return {}
|
-- vim.lsp.config('clangd', {
|
||||||
end,
|
-- require("lspconfig").clangd.setup({
|
||||||
clangd = function()
|
-- vim.b.lsp_zero_enable_autoformat = 0
|
||||||
vim.b.lsp_zero_enable_autoformat = 0
|
-- })
|
||||||
end,
|
-- })
|
||||||
require("lspconfig").marksman.setup({}),
|
|
||||||
|
require("mason").setup()
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"bashls",
|
||||||
|
"ts_ls",
|
||||||
|
"pyright",
|
||||||
|
"lua_ls",
|
||||||
|
"jsonls",
|
||||||
|
"clangd",
|
||||||
|
"biome", -- will install for formatting only
|
||||||
|
-- "ruff",
|
||||||
|
-- "marksman",
|
||||||
},
|
},
|
||||||
|
automatic_enable = {
|
||||||
|
exclude = { "ruff", "biome" }
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
@ -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",
|
||||||
|
|
|
@ -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"'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue