09012024
stylua
This commit is contained in:
parent
6be2114458
commit
f549b63062
19 changed files with 406 additions and 364 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "e48ce1805697e4bb97bc171c081e849a65859244" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
|
|
|
@ -26,8 +26,7 @@ opt.scrolloff = 10
|
|||
opt.completeopt = "menuone,noinsert,noselect"
|
||||
-- opt.guicursor = ""
|
||||
opt.showmode = false
|
||||
opt.tabline = '%!v:lua.require("utils").tabline()'
|
||||
|
||||
-- opt.tabline = '%!v:lua.require("utils").tabline()'
|
||||
|
||||
-- Behaviour
|
||||
opt.hidden = true
|
||||
|
@ -47,4 +46,4 @@ opt.modifiable = true
|
|||
-- opt.guicursor =
|
||||
-- "n-v-c:block,i-ci-ve:block,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175"
|
||||
opt.encoding = "UTF-8"
|
||||
opt.cursorline = true
|
||||
opt.cursorline = false
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
local config = function()
|
||||
require('ts_context_commentstring').setup {
|
||||
enable_autocmd = false,
|
||||
}
|
||||
require('Comment').setup {
|
||||
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(),
|
||||
}
|
||||
require("ts_context_commentstring").setup({
|
||||
enable_autocmd = false,
|
||||
})
|
||||
require("Comment").setup({
|
||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||
})
|
||||
end
|
||||
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
opts = config,
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
{"JoosepAlviste/nvim-ts-context-commentstring"}
|
||||
}
|
||||
dependencies = {
|
||||
{ "JoosepAlviste/nvim-ts-context-commentstring" },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
return {
|
||||
'stevearc/conform.nvim',
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "ruff_format", "ruff_fix" },
|
||||
javascript = { "biome" },
|
||||
typescript = { "biome" },
|
||||
javascriptreact = { "biome" },
|
||||
typescriptreact = { "biome" },
|
||||
json = { "biome" },
|
||||
sh = { "shfmt" },
|
||||
['*'] = { 'trim_whitespace', 'codespell' },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "ruff_format", "ruff_fix" },
|
||||
javascript = { "biome" },
|
||||
typescript = { "biome" },
|
||||
javascriptreact = { "biome" },
|
||||
typescriptreact = { "biome" },
|
||||
json = { "biome" },
|
||||
sh = { "shfmt" },
|
||||
["*"] = { "trim_whitespace", "codespell" },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
return {
|
||||
"m4xshen/hardtime.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
max_time = 0,
|
||||
},
|
||||
lazy = false
|
||||
"m4xshen/hardtime.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
max_time = 0,
|
||||
},
|
||||
lazy = false,
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 900
|
||||
end,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
},
|
||||
{ "folke/neodev.nvim" },
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 900
|
||||
end,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
},
|
||||
{ "folke/neodev.nvim" },
|
||||
}
|
||||
|
|
|
@ -1,156 +1,187 @@
|
|||
local config = function()
|
||||
local lsp_zero = require 'lsp-zero'
|
||||
local luasnip = require 'luasnip'
|
||||
local diagnostic_signs = require("utils.icons").diagnostic_signs
|
||||
local lsp_zero = require("lsp-zero")
|
||||
local luasnip = require("luasnip")
|
||||
local diagnostic_signs = require("utils.icons").diagnostic_signs
|
||||
|
||||
lsp_zero.on_attach(function(_, bufnr)
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false, -- disable virtual text
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = true,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
lsp_zero.on_attach(function(_, bufnr)
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false, -- disable virtual text
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = true,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
})
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
border = "rounded",
|
||||
})
|
||||
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.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||
border = "rounded",
|
||||
})
|
||||
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() 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)
|
||||
vim.keymap.set("n", "gd", function()
|
||||
vim.lsp.buf.definition()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "K", function()
|
||||
vim.lsp.buf.hover()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function()
|
||||
vim.lsp.buf.workspace_symbol()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function()
|
||||
vim.diagnostic.open_float()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "[d", function()
|
||||
vim.diagnostic.goto_next()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "]d", function()
|
||||
vim.diagnostic.goto_prev()
|
||||
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({
|
||||
error = diagnostic_signs.Error,
|
||||
warn = diagnostic_signs.Warn,
|
||||
hint = diagnostic_signs.Hint,
|
||||
info = diagnostic_signs.Info
|
||||
})
|
||||
lsp_zero.set_sign_icons({
|
||||
error = diagnostic_signs.Error,
|
||||
warn = diagnostic_signs.Warn,
|
||||
hint = diagnostic_signs.Hint,
|
||||
info = diagnostic_signs.Info,
|
||||
})
|
||||
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
"bashls",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"lua_ls",
|
||||
"jsonls",
|
||||
"clangd",
|
||||
"ruff_lsp",
|
||||
"biome" -- will install for formatting only
|
||||
},
|
||||
automatic_installation = true,
|
||||
handlers = {
|
||||
lsp_zero.default_setup,
|
||||
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,
|
||||
}
|
||||
})
|
||||
require("mason").setup({})
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"bashls",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"lua_ls",
|
||||
"jsonls",
|
||||
"clangd",
|
||||
"ruff_lsp",
|
||||
"biome", -- will install for formatting only
|
||||
},
|
||||
automatic_installation = true,
|
||||
handlers = {
|
||||
lsp_zero.default_setup,
|
||||
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,
|
||||
},
|
||||
})
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
local cmp = require("cmp")
|
||||
local cmp_select = { behavior = cmp.SelectBehavior.Select }
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
preselect = 'item',
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert'
|
||||
},
|
||||
sources = {
|
||||
{name = 'luasnip'},
|
||||
{name = 'path'},
|
||||
{name = 'nvim_lsp'},
|
||||
{name = 'nvim_lua'},
|
||||
{name = 'buffer'},
|
||||
},
|
||||
formatting = lsp_zero.cmp_format(),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<Tab>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-f>'] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {'i', 's'}),
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
preselect = "item",
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
sources = {
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "buffer" },
|
||||
},
|
||||
formatting = lsp_zero.cmp_format(),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
["<Tab>"] = cmp.mapping.select_next_item(cmp_select),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-f>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
['<C-b>'] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {'i', 's'}),
|
||||
}),
|
||||
})
|
||||
["<C-b>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
return {
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
branch = 'v3.x',
|
||||
config = config,
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
{"L3MON4D3/LuaSnip", version = "v2.*", build = "make install_jsregexp", dependencies={"rafamadriz/friendly-snippets"}},
|
||||
}
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
branch = "v3.x",
|
||||
config = config,
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,69 +1,69 @@
|
|||
local config = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
component_separators = { left = "|", right = "|" },
|
||||
section_separators = { left = "", right = "" },
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "buffers" },
|
||||
lualine_x = { "diagnostics", "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
lualine_c = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
component_separators = { left = "|", right = "|" },
|
||||
section_separators = { left = "", right = "" },
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "" },
|
||||
lualine_x = { "diagnostics", "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
lualine_c = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
}
|
||||
|
||||
local function ins_left(component)
|
||||
table.insert(config.sections.lualine_c, component)
|
||||
table.insert(config.sections.lualine_c, component)
|
||||
end
|
||||
|
||||
local function ins_right(component)
|
||||
table.insert(config.sections.lualine_x, 1, component)
|
||||
table.insert(config.sections.lualine_x, 1, component)
|
||||
end
|
||||
|
||||
ins_right {
|
||||
-- Lsp server name .
|
||||
function()
|
||||
local msg = 'No Active Lsp'
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) == nil then
|
||||
return msg
|
||||
end
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return client.name
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end,
|
||||
icon = ' LSP:',
|
||||
color = { fg = '#ff6b6b' },
|
||||
}
|
||||
ins_right({
|
||||
-- Lsp server name .
|
||||
function()
|
||||
local msg = "No Active Lsp"
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) == nil then
|
||||
return msg
|
||||
end
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return client.name
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end,
|
||||
icon = " LSP:",
|
||||
color = { fg = "#ff6b6b" },
|
||||
})
|
||||
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
lazy = false,
|
||||
opts = config,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
}
|
||||
"nvim-lualine/lualine.nvim",
|
||||
lazy = false,
|
||||
opts = config,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
return {
|
||||
"karb94/neoscroll.nvim",
|
||||
config = function ()
|
||||
require('neoscroll').setup {}
|
||||
end,
|
||||
lazy = false,
|
||||
"karb94/neoscroll.nvim",
|
||||
config = function()
|
||||
require("neoscroll").setup({})
|
||||
end,
|
||||
lazy = false,
|
||||
}
|
||||
|
|
12
linux/.config/nvim/lua/plugins/nvim-bufferline.lua
Normal file
12
linux/.config/nvim/lua/plugins/nvim-bufferline.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
local config = function()
|
||||
require("bufferline").setup()
|
||||
end
|
||||
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
opts = config,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
lazy = false,
|
||||
}
|
|
@ -1,19 +1,18 @@
|
|||
local config = function()
|
||||
require('lint').linters_by_ft = {
|
||||
python = { "mypy" },
|
||||
}
|
||||
require("lint").linters_by_ft = {
|
||||
python = { "mypy" },
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {},
|
||||
config = config,
|
||||
lazy = false,
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {},
|
||||
config = config,
|
||||
lazy = false,
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
lazy = false,
|
||||
opts = {
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
}
|
||||
}
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
lazy = false,
|
||||
opts = {
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
return {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
return {
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
config = function()
|
||||
vim.cmd('colorscheme tokyonight-storm')
|
||||
end
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
config = function()
|
||||
vim.cmd("colorscheme tokyonight-storm")
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -4,61 +4,61 @@ local maplazykey = require("utils.keymapper").maplazykey
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
position = "bottom", -- position of the list can be: bottom, top, left, right
|
||||
height = 10, -- height of the trouble list when position is top or bottom
|
||||
width = 50, -- width of the list when position is left or right
|
||||
icons = true, -- use devicons for filenames
|
||||
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
|
||||
severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT
|
||||
fold_open = "", -- icon used for open folds
|
||||
fold_closed = "", -- icon used for closed folds
|
||||
group = true, -- group results by file
|
||||
padding = true, -- add an extra new line on top of the list
|
||||
cycle_results = true, -- cycle item list when reaching beginning or end of list
|
||||
action_keys = { -- key mappings for actions in the trouble list
|
||||
-- map to {} to remove a mapping, for example:
|
||||
-- close = {},
|
||||
close = "q", -- close the list
|
||||
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
|
||||
refresh = "r", -- manually refresh
|
||||
jump = { "<cr>", "<tab>", "<2-leftmouse>" }, -- jump to the diagnostic or open / close folds
|
||||
open_split = { "<c-x>" }, -- open buffer in new split
|
||||
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
|
||||
open_tab = { "<c-t>" }, -- open buffer in new tab
|
||||
jump_close = {"o"}, -- jump to the diagnostic and close the list
|
||||
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
|
||||
switch_severity = "s", -- switch "diagnostics" severity filter level to HINT / INFO / WARN / ERROR
|
||||
toggle_preview = "P", -- toggle auto_preview
|
||||
hover = "K", -- opens a small popup with the full multiline message
|
||||
preview = "p", -- preview the diagnostic location
|
||||
open_code_href = "c", -- if present, open a URI with more information about the diagnostic error
|
||||
close_folds = {"zM", "zm"}, -- close all folds
|
||||
open_folds = {"zR", "zr"}, -- open all folds
|
||||
toggle_fold = {"zA", "za"}, -- toggle fold of current file
|
||||
previous = "k", -- previous item
|
||||
next = "j", -- next item
|
||||
help = "?" -- help menu
|
||||
},
|
||||
multiline = true, -- render multi-line messages
|
||||
indent_lines = true, -- add an indent guide below the fold icons
|
||||
win_config = { border = "single" }, -- window configuration for floating windows. See |nvim_open_win()|.
|
||||
auto_open = false, -- automatically open the list when you have diagnostics
|
||||
auto_close = false, -- automatically close the list when you have no diagnostics
|
||||
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
|
||||
auto_fold = false, -- automatically fold a file trouble list at creation
|
||||
auto_jump = {"lsp_definitions"}, -- for the given modes, automatically jump if there is only a single result
|
||||
include_declaration = { "lsp_references", "lsp_implementations", "lsp_definitions" }, -- for the given modes, include the declaration of the current symbol in the results
|
||||
signs = {
|
||||
-- icons / text used for a diagnostic
|
||||
error = diagnostic_signs.Error,
|
||||
warning = diagnostic_signs.Warn,
|
||||
hint = diagnostic_signs.Hint,
|
||||
information = diagnostic_signs.Info,
|
||||
other = diagnostic_signs.Info,
|
||||
},
|
||||
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
|
||||
},
|
||||
opts = {
|
||||
position = "bottom", -- position of the list can be: bottom, top, left, right
|
||||
height = 10, -- height of the trouble list when position is top or bottom
|
||||
width = 50, -- width of the list when position is left or right
|
||||
icons = true, -- use devicons for filenames
|
||||
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
|
||||
severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT
|
||||
fold_open = "", -- icon used for open folds
|
||||
fold_closed = "", -- icon used for closed folds
|
||||
group = true, -- group results by file
|
||||
padding = true, -- add an extra new line on top of the list
|
||||
cycle_results = true, -- cycle item list when reaching beginning or end of list
|
||||
action_keys = { -- key mappings for actions in the trouble list
|
||||
-- map to {} to remove a mapping, for example:
|
||||
-- close = {},
|
||||
close = "q", -- close the list
|
||||
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
|
||||
refresh = "r", -- manually refresh
|
||||
jump = { "<cr>", "<tab>", "<2-leftmouse>" }, -- jump to the diagnostic or open / close folds
|
||||
open_split = { "<c-x>" }, -- open buffer in new split
|
||||
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
|
||||
open_tab = { "<c-t>" }, -- open buffer in new tab
|
||||
jump_close = { "o" }, -- jump to the diagnostic and close the list
|
||||
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
|
||||
switch_severity = "s", -- switch "diagnostics" severity filter level to HINT / INFO / WARN / ERROR
|
||||
toggle_preview = "P", -- toggle auto_preview
|
||||
hover = "K", -- opens a small popup with the full multiline message
|
||||
preview = "p", -- preview the diagnostic location
|
||||
open_code_href = "c", -- if present, open a URI with more information about the diagnostic error
|
||||
close_folds = { "zM", "zm" }, -- close all folds
|
||||
open_folds = { "zR", "zr" }, -- open all folds
|
||||
toggle_fold = { "zA", "za" }, -- toggle fold of current file
|
||||
previous = "k", -- previous item
|
||||
next = "j", -- next item
|
||||
help = "?", -- help menu
|
||||
},
|
||||
multiline = true, -- render multi-line messages
|
||||
indent_lines = true, -- add an indent guide below the fold icons
|
||||
win_config = { border = "single" }, -- window configuration for floating windows. See |nvim_open_win()|.
|
||||
auto_open = false, -- automatically open the list when you have diagnostics
|
||||
auto_close = false, -- automatically close the list when you have no diagnostics
|
||||
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
|
||||
auto_fold = false, -- automatically fold a file trouble list at creation
|
||||
auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
|
||||
include_declaration = { "lsp_references", "lsp_implementations", "lsp_definitions" }, -- for the given modes, include the declaration of the current symbol in the results
|
||||
signs = {
|
||||
-- icons / text used for a diagnostic
|
||||
error = diagnostic_signs.Error,
|
||||
warning = diagnostic_signs.Warn,
|
||||
hint = diagnostic_signs.Hint,
|
||||
information = diagnostic_signs.Info,
|
||||
other = diagnostic_signs.Info,
|
||||
},
|
||||
use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client
|
||||
},
|
||||
keys = {
|
||||
maplazykey("<leader>xx", function()
|
||||
require("trouble").toggle()
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
local M = {}
|
||||
|
||||
function M.tabline()
|
||||
local s = ''
|
||||
for i = 1, vim.fn.tabpagenr('$') do
|
||||
local winnr = vim.fn.tabpagewinnr(i)
|
||||
local buflist = vim.fn.tabpagebuflist(i)
|
||||
local bufnr = buflist[winnr]
|
||||
local bufname = vim.fn.bufname(bufnr)
|
||||
local filename = vim.fn.fnamemodify(bufname, ':t')
|
||||
local icon = require'nvim-web-devicons'.get_icon(filename)
|
||||
local s = ""
|
||||
for i = 1, vim.fn.tabpagenr("$") do
|
||||
local winnr = vim.fn.tabpagewinnr(i)
|
||||
local buflist = vim.fn.tabpagebuflist(i)
|
||||
local bufnr = buflist[winnr]
|
||||
local bufname = vim.fn.bufname(bufnr)
|
||||
local filename = vim.fn.fnamemodify(bufname, ":t")
|
||||
local icon = require("nvim-web-devicons").get_icon(filename)
|
||||
|
||||
-- Отмечаем активный таб
|
||||
if i == vim.fn.tabpagenr() then
|
||||
s = s .. '%#TabLineSel#'
|
||||
else
|
||||
s = s .. '%#TabLine#'
|
||||
end
|
||||
-- Отмечаем активный таб
|
||||
if i == vim.fn.tabpagenr() then
|
||||
s = s .. "%#TabLineSel#"
|
||||
else
|
||||
s = s .. "%#TabLine#"
|
||||
end
|
||||
|
||||
s = s .. ' ' .. (icon or '') .. ' ' .. filename .. ' '
|
||||
end
|
||||
s = s .. '%#TabLineFill#%='
|
||||
return s
|
||||
s = s .. " " .. (icon or "") .. " " .. filename .. " "
|
||||
end
|
||||
s = s .. "%#TabLineFill#%="
|
||||
return s
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue