update: kitty, nvim and bashrc
This commit is contained in:
parent
a879e32d65
commit
c5570614f5
63 changed files with 7768 additions and 3669 deletions
|
|
@ -8,6 +8,37 @@ bufferline.setup {
|
|||
icon = '▎',
|
||||
style = 'icon',
|
||||
},
|
||||
groups = {
|
||||
items = {
|
||||
{
|
||||
name = 'tornado',
|
||||
matcher = function(buf)
|
||||
return (buf.path or ""):lower():match("tornado")
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = 'gornado',
|
||||
matcher = function(buf)
|
||||
return (buf.path or ""):lower():match("gornado")
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = 'tests',
|
||||
matcher = function(buf)
|
||||
return (buf.name or ""):lower():match("*test*%.cpp$")
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = 'code',
|
||||
matcher = function(buf)
|
||||
return (buf.name or ""):lower():match("%.h$")
|
||||
or (buf.name or ""):lower():match("%.c$")
|
||||
or (buf.name or ""):lower():match("%.cpp$")
|
||||
end,
|
||||
},
|
||||
},
|
||||
hidden = false,
|
||||
},
|
||||
buffer_close_icon = '',
|
||||
modified_icon = '● ',
|
||||
close_icon = ' ',
|
||||
|
|
@ -17,20 +48,6 @@ bufferline.setup {
|
|||
max_prefix_length = 15,
|
||||
truncate_names = true,
|
||||
tab_size = 18,
|
||||
custom_filter = function(buf_number, buf_numbers)
|
||||
if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||
return true
|
||||
end
|
||||
if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||
return true
|
||||
end
|
||||
if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||
return true
|
||||
end
|
||||
if buf_numbers[1] ~= buf_number then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@ require('conform').setup({
|
|||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
cpp = { "clang-format" },
|
||||
go = { "gofmr" },
|
||||
go = { "gofmt" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
notify_on_error = true,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
|
|
|
|||
|
|
@ -1,55 +0,0 @@
|
|||
local M = {}
|
||||
local map = vim.keymap.set
|
||||
|
||||
-- export on_attach & capabilities
|
||||
M.on_attach = function(_, bufnr)
|
||||
local function opts(desc)
|
||||
return { buffer = bufnr, desc = "LSP " .. desc }
|
||||
end
|
||||
|
||||
map("n", "gD", vim.lsp.buf.declaration, opts "Go to declaration")
|
||||
map("n", "gd", vim.lsp.buf.definition, opts "Go to definition")
|
||||
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Add workspace folder")
|
||||
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Remove workspace folder")
|
||||
|
||||
map("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts "List workspace folders")
|
||||
|
||||
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition")
|
||||
end
|
||||
|
||||
-- disable semanticTokens
|
||||
M.on_init = function(client, _)
|
||||
if vim.fn.has "nvim-0.11" ~= 1 then
|
||||
if client.supports_method "textDocument/semanticTokens" then
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
end
|
||||
else
|
||||
if client:supports_method "textDocument/semanticTokens" then
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
M.capabilities.textDocument.completion.completionItem = {
|
||||
documentationFormat = { "markdown", "plaintext" },
|
||||
snippetSupport = true,
|
||||
preselectSupport = true,
|
||||
insertReplaceSupport = true,
|
||||
labelDetailsSupport = true,
|
||||
deprecatedSupport = true,
|
||||
commitCharactersSupport = true,
|
||||
tagSupport = { valueSet = { 1 } },
|
||||
resolveSupport = {
|
||||
properties = {
|
||||
"documentation",
|
||||
"detail",
|
||||
"additionalTextEdits",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
@ -1,30 +1,42 @@
|
|||
local on_attach = require("configs.lsp.e-lspconfig").on_attach
|
||||
local on_init = require("configs.lsp.e-lspconfig").on_init
|
||||
local capabilities = require("configs.lsp.e-lspconfig").capabilities
|
||||
vim.lsp.config('*', {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
on_init = function(client)
|
||||
if client:supports_method('textDocument/semanticTokens') then
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
local map = vim.keymap.set
|
||||
local function opts(desc)
|
||||
return { buffer = args.buf, desc = "LSP " .. desc }
|
||||
end
|
||||
|
||||
map("n", "gD", vim.lsp.buf.declaration, opts "Go to declaration")
|
||||
map("n", "gd", vim.lsp.buf.definition, opts "Go to definition")
|
||||
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Add workspace folder")
|
||||
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Remove workspace folder")
|
||||
map("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts "List workspace folders")
|
||||
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition")
|
||||
end,
|
||||
})
|
||||
|
||||
-- C/C++
|
||||
vim.lsp.config('clangd', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = {
|
||||
"clangd-22",
|
||||
"clangd",
|
||||
"--clang-tidy",
|
||||
},
|
||||
filetypes = { "c", "cpp", "h", "hpp", "objc", "objcpp" },
|
||||
root_markers = { '.git' },
|
||||
})
|
||||
vim.lsp.enable('clangd')
|
||||
|
||||
-- Go (gopls) lsp server
|
||||
-- Go
|
||||
vim.lsp.config('gopls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'gopls' },
|
||||
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
|
||||
root_markers = { 'go.mod', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
|
|
@ -37,32 +49,18 @@ vim.lsp.config('gopls', {
|
|||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('gopls')
|
||||
|
||||
-- PhP
|
||||
-- PHP
|
||||
vim.lsp.config('phpactor', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'phpactor', 'language-server' },
|
||||
filetypes = { 'php' },
|
||||
root_markers = { 'composer.json', '.git' },
|
||||
init_options = {
|
||||
["language_server_phpstan.enabled"] = false,
|
||||
["language_server_psalm.enabled"] = false,
|
||||
["language_server_mago.enabled"] = false,
|
||||
}
|
||||
})
|
||||
vim.lsp.enable('phpactor')
|
||||
|
||||
-- Lua
|
||||
vim.lsp.config('lua_ls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'lua-language-server' },
|
||||
filetypes = { 'lua' },
|
||||
root_markers = { '.luarc.json', '.luarc.jsonc', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {
|
||||
Lua = {
|
||||
telemetry = { enable = false },
|
||||
|
|
@ -78,34 +76,7 @@ vim.lsp.config('lua_ls', {
|
|||
},
|
||||
}
|
||||
})
|
||||
vim.lsp.enable('lua_ls')
|
||||
|
||||
-- Bash
|
||||
vim.lsp.config('bashls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'bash-language-server', 'start' },
|
||||
filetypes = { 'sh', 'bash' },
|
||||
root_markers = { '.git' },
|
||||
single_file_support = true,
|
||||
})
|
||||
vim.lsp.enable('bashls')
|
||||
|
||||
-- Meson
|
||||
vim.lsp.config('meson_ls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'mesonlsp' },
|
||||
filetypes = { 'meson' },
|
||||
root_markers = { 'meson.build', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {}
|
||||
})
|
||||
vim.lsp.enable('meson_ls')
|
||||
|
||||
-- For all
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
|
|
|||
78
nvim/lua/configs/neotree.lua
Normal file
78
nvim/lua/configs/neotree.lua
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
return {
|
||||
close_if_last_window = true,
|
||||
popup_border_style = "rounded",
|
||||
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
|
||||
filesystem = {
|
||||
hijack_netrw_behavior = "open_current",
|
||||
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
|
||||
group_empty_dirs = true,
|
||||
|
||||
filtered_items = {
|
||||
visible = false,
|
||||
hide_hidden = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
hide_by_name = {
|
||||
"docs",
|
||||
".git",
|
||||
".cache",
|
||||
"builddir-debug",
|
||||
},
|
||||
},
|
||||
|
||||
bind_to_cwd = true,
|
||||
cwd_target = {
|
||||
sidebar = "global",
|
||||
current = "window",
|
||||
},
|
||||
|
||||
use_libuv_file_watcher = true,
|
||||
|
||||
window = {
|
||||
width = 30,
|
||||
},
|
||||
},
|
||||
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
with_markers = true,
|
||||
},
|
||||
|
||||
modified = {
|
||||
symbol = "",
|
||||
},
|
||||
|
||||
icon = {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "",
|
||||
default = "",
|
||||
},
|
||||
|
||||
git_status = {
|
||||
symbols = {
|
||||
added = "★",
|
||||
modified = "✗",
|
||||
deleted = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
ignored = "◌",
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
|
||||
name = {
|
||||
use_git_status_colors = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
-- return {
|
||||
-- filters = { dotfiles = false, git_ignored = false, },
|
||||
-- disable_netrw = true,
|
||||
-- hijack_cursor = true,
|
||||
-- sync_root_with_cwd = true,
|
||||
-- update_focused_file = {
|
||||
-- enable = true,
|
||||
-- update_root = false,
|
||||
-- },
|
||||
-- bookmarks = {
|
||||
-- persist = true,
|
||||
-- },
|
||||
-- view = {
|
||||
-- width = 30,
|
||||
-- preserve_window_proportions = true,
|
||||
-- },
|
||||
-- renderer = {
|
||||
-- root_folder_label = false,
|
||||
-- highlight_git = true,
|
||||
-- indent_markers = { enable = true },
|
||||
-- icons = {
|
||||
-- glyphs = {
|
||||
-- default = "",
|
||||
-- folder = {
|
||||
-- default = "",
|
||||
-- empty = "",
|
||||
-- empty_open = "",
|
||||
-- open = "",
|
||||
-- symlink = "",
|
||||
-- },
|
||||
-- git = { unmerged = "" },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
return {
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_ignored = false,
|
||||
},
|
||||
|
||||
disable_netrw = true,
|
||||
hijack_cursor = true,
|
||||
sync_root_with_cwd = true,
|
||||
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = false,
|
||||
},
|
||||
|
||||
bookmarks = {
|
||||
persist = true,
|
||||
},
|
||||
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = false,
|
||||
timeout = 5000,
|
||||
},
|
||||
|
||||
|
||||
view = {
|
||||
width = 30,
|
||||
preserve_window_proportions = true,
|
||||
},
|
||||
|
||||
renderer = {
|
||||
root_folder_label = false,
|
||||
highlight_git = "all",
|
||||
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
icons = {
|
||||
show = {
|
||||
git = true,
|
||||
modified = false,
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
},
|
||||
|
||||
glyphs = {
|
||||
default = "",
|
||||
folder = {
|
||||
default = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
open = "",
|
||||
symlink = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
require("telescope").setup(){
|
||||
require("telescope").setup {
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue