This commit is contained in:
dmitz 2024-05-25 14:02:16 +03:00
parent 94e1fbd349
commit dd9ff9c0f3
15 changed files with 302 additions and 16 deletions

View file

@ -1,3 +1,5 @@
[init]
defaultBranch = main
[alias]
ap = add -p
br = branch

View file

@ -10,3 +10,4 @@ image/png=img.desktop;
image/jpeg=img.desktop;
image/gif=img.desktop;
inode/directory=file.desktop
x-scheme-handler/fcade=fcade-quark.desktop

View file

@ -26,7 +26,7 @@ map("n", "<leader>c", ":w! | !compiler '<c-r>%'<CR>")
map("n", "<leader>op", ":!opout <c-r>%<CR><CR>")
map("n", "<leader>se", ":setlocal spell! spelllang=en_us<CR>")
map('n', 'ge', vim.diagnostic.open_float)
map('n', '[d', vim.diagnostic.goto_prev)
map('n', ']d', vim.diagnostic.goto_next)
map('n', '<leader>q', vim.diagnostic.setloclist)
map("n", "ge", vim.diagnostic.open_float)
map("n", "[d", vim.diagnostic.goto_prev)
map("n", "]d", vim.diagnostic.goto_next)
map("n", "<leader>q", vim.diagnostic.setloclist)

View file

@ -0,0 +1,43 @@
return {
"RRethy/base16-nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd("colorscheme base16-eighties")
local hi = vim.cmd.highlight
local base16 = require("base16-colorscheme")
base16.setup({
base00 = "#1a1a1a", base01 = "#262626", base02 = "#515151", base03 = "#747369",
base04 = "#a09f93", base05 = "#d3d0c8", base06 = "#e8e6df", base07 = "#f2f0ec",
base08 = "#f2f0ec", base09 = "#f99157", base0A = "#ffcc66", base0B = "#99cc99",
base0C = "#66cccc", base0D = "#538cc6", base0E = "#cc99cc", base0F = "#d27b53"
})
hi({"MiniJump", "guifg=" .. base16.colors.base0F})
hi({"LineNr", "guifg=" .. base16.colors.base03})
hi({"NormalFloat", "guibg=" .. base16.colors.base01})
hi({"VertSplit", "guibg=none", "guifg=" .. base16.colors.base02})
hi({"StatusLine", "guibg=" .. base16.colors.base01, "guifg=none"})
hi({"TelescopeBorder", "guifg=" .. base16.colors.base02, "guibg=none"})
hi({"TelescopeMatching", "guibg=" .. base16.colors.base09, "guifg=" .. base16.colors.base01})
hi({"TelescopeNormal", "guifg=" .. base16.colors.base0D, "guibg=none"})
hi({"TelescopePreviewLine", "guibg=" .. base16.colors.base02})
hi({"TelescopePreviewTitle", "guifg=" .. base16.colors.base05, "guibg=none"})
hi({"TelescopePromptBorder", "guibg=none"})
hi({"TelescopePromptNormal", "guibg=" .. base16.colors.base01})
hi({"TelescopePromptTitle", "guifg=" .. base16.colors.base05, "guibg=none"})
hi({"TelescopeResultsTitle", "guifg=" .. base16.colors.base05, "guibg=none"})
hi({"TelescopeSelection", "guifg=" .. base16.colors.base0A, "guibg=none", "gui=bold"})
hi({"LspInlayHint", "gui=none"})
hi({"TSConstBuiltin", "gui=none"})
hi({"TSFuncBuiltin", "gui=none"})
hi({"TSTypeBuiltin", "gui=none"})
hi({"TSVariableBuiltin", "gui=none"})
hi({"TreesitterContext", "gui=none"})
end,
}

View file

@ -0,0 +1,20 @@
return {
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
config = function()
local hooks = require("ibl.hooks")
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_tab_indent_level)
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
require("ibl").setup({
indent = { char = "" },
whitespace = {
remove_blankline_trail = false,
},
scope = {
show_start = false,
show_end = false,
exclude = { language = { "help" } }
}
})
end
}

View file

@ -0,0 +1,7 @@
return {
"echasnovski/mini.jump",
version = "*",
config = function()
require("mini.jump").setup()
end,
}

View file

@ -0,0 +1,55 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/nvim-cmp",
"williamboman/mason-lspconfig.nvim",
"williamboman/mason.nvim",
},
config = function()
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities = vim.tbl_deep_extend(
"force",
{},
vim.lsp.protocol.make_client_capabilities(),
cmp_lsp.default_capabilities())
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"csharp_ls",
"gopls",
},
handlers = {
function(server_name)
require("lspconfig")[server_name].setup{ capabilities = capabilities }
end
}
})
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }),
callback = function(event)
local builtin = require("telescope.builtin")
local map = function(keys, func)
vim.keymap.set("n", keys, func, { buffer = event.buf })
end
map("gd", builtin.lsp_definitions)
map("gr", builtin.lsp_references)
map("gI", builtin.lsp_implementations)
map("<leader>D", builtin.lsp_type_definitions)
map("<leader>ds", builtin.lsp_document_symbols)
map("<leader>ws", builtin.lsp_dynamic_workspace_symbols)
map("<leader>cw", vim.lsp.buf.rename)
map("<leader>ca", vim.lsp.buf.code_action)
map("K", vim.lsp.buf.hover)
map("gD", vim.lsp.buf.declaration)
end,
})
end
}

View file

@ -0,0 +1,20 @@
return {
"nvim-lualine/lualine.nvim",
opts = {
options = {
icons_enabled = false,
component_separators = { left = "", right = ""},
section_separators = { left = "", right = ""},
},
sections = {
lualine_a = {
{ "buffers", use_mode_colors = true }
},
lualine_b = {},
lualine_c = {},
lualine_x = { "location" },
lualine_y = { "branch" },
lualine_z = {},
}
}
}

View file

@ -0,0 +1,25 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
config = function()
local cmp = require("cmp")
cmp.setup{
preselect = cmp.PreselectMode.None,
view = {
entries = { follow_cursor = true }
},
mapping = {
["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-u>"] = cmp.mapping.scroll_docs(4),
},
sources = {
{name = "nvim_lsp", max_item_count = 10},
{name = "buffer", max_item_count = 10},
}
}
end
}

View file

@ -0,0 +1,14 @@
return {
"echasnovski/mini.surround",
opts = {
mappings = {
add = "sa",
delete = "sd",
find = "sf",
find_left = "sF",
highlight = "sh",
replace = "sr",
update_n_lines = "sn",
},
}
}

View file

@ -0,0 +1,52 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-project.nvim"
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
local builtin = require("telescope.builtin")
local extensions = telescope.extensions
map("n", "<leader>fh", builtin.help_tags)
map("n", "<leader>fd", builtin.find_files)
map("n", "<leader>fp", extensions.project.project)
map("n", "<leader>fw", builtin.grep_string)
map("n", "<leader>fg", builtin.live_grep)
map("n", "<leader>fe", builtin.diagnostics)
map("n", "<leader>r", builtin.resume)
map("n", "<leader>so", builtin.oldfiles)
telescope.setup{
defaults = {
initial_mode = "normal",
prompt_prefix = "",
results_title = false,
selection_caret = " ",
sorting_strategy = "ascending",
layout_config = {
horizontal = {
prompt_position = "top",
width = { padding = 0 },
height = { padding = 0 },
preview_width = 0.5,
}
}
},
pickers = {
buffers = {
ignore_current_buffer = true,
previewer = true,
sort_lastused = true,
}
},
find_files = { hidden = false },
live_grep = {
initial_mode = "insert",
no_ignore = true,
},
}
end
}

View file

@ -0,0 +1,53 @@
return {
"nvim-treesitter/nvim-treesitter",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"nvim-treesitter/nvim-treesitter-context",
},
build = ":TSUpdate",
config = function ()
local configs = require("nvim-treesitter.configs")
configs.setup({
sync_install = false,
auto_install = true,
highlight = { enable = true },
indent = { enable = false },
incremental_selection = {
enable = true,
keymaps = {
node_incremental = "v",
node_decremental = "b",
}
},
textobjects = {
select = {
enable = true,
keymaps = {
['aa'] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["ii"] = "@conditional.inner",
["ai"] = "@conditional.outer",
["il"] = "@loop.inner",
["al"] = "@loop.outer",
},
move = {
enable = true,
goto_next_start = {
["]m"] = "@function.outer",
["]c"] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[c"] = "@class.outer",
}
}
}
}
})
end,
}

View file

@ -1,5 +1,6 @@
local o = vim.o
local au = vim.api.nvim_create_autocmd
local bo = vim.bo
local o = vim.o
local wo = vim.wo
o.clipboard = "unnamedplus"
@ -34,3 +35,6 @@ au("TextYankPost", { pattern = "*", callback = function() vim.highlight.on_yank(
au("BufWritePre", { pattern = "*", command = [[%s/\s\+$//e]] })
au("FileType", { pattern = "help", command = ":wincmd L | :vert" })
au("FileType", { pattern = "lua", command = "setlocal ts=3 sw=3 et" })
au("FileType", { pattern = "yaml", command = "setlocal ts=2 sw=2 et" })
au("FileType", { pattern = "yaml", command = "setlocal ts=2 sw=2 et" })
au("FileType", { pattern = "yaml", command = ":lua vim.b.editorconfig = false" })

View file

@ -44,4 +44,4 @@ export LESS_TERMCAP_us="$(printf '%b' '')"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s river >/dev/null 2>&1 && dbus-run-session river -no-xwayland
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s river >/dev/null 2>&1 && dbus-run-session river

View file

@ -1,10 +0,0 @@
#!/bin/sh
FIFO="$XDG_RUNTIME_DIR/sandbar-0"
[ -e "$FIFO" ] && rm -f "$FIFO"
mkfifo "$FIFO"
while cat "$FIFO"; do :; done | sandbar -hide-vacant-tags -no-title -vertical-padding 3 -title-bg-color '222222ff' -font 'monospace:size=10' &
pidof -sx someblocks || someblocks -s "$FIFO" &