From dd9ff9c0f3742bb6fa427e4124bc6a10a6d70b97 Mon Sep 17 00:00:00 2001 From: dmitz Date: Sat, 25 May 2024 14:02:16 +0300 Subject: [PATCH] Update --- .config/git/config | 2 + .config/mimeapps.list | 1 + .config/nvim/lua/maps.lua | 8 +-- .config/nvim/lua/plugins/eighties.lua | 43 +++++++++++++++ .config/nvim/lua/plugins/indent-blankline.lua | 20 +++++++ .config/nvim/lua/plugins/jump.lua | 7 +++ .config/nvim/lua/plugins/lspconfig.lua | 55 +++++++++++++++++++ .config/nvim/lua/plugins/lualine.lua | 20 +++++++ .config/nvim/lua/plugins/nvim-cmp.lua | 25 +++++++++ .config/nvim/lua/plugins/surround.lua | 14 +++++ .config/nvim/lua/plugins/telescope.lua | 52 ++++++++++++++++++ .config/nvim/lua/plugins/treesitter.lua | 53 ++++++++++++++++++ .config/nvim/lua/sets.lua | 6 +- .config/zsh/.zprofile | 2 +- .local/bin/sbar | 10 ---- 15 files changed, 302 insertions(+), 16 deletions(-) create mode 100644 .config/nvim/lua/plugins/eighties.lua create mode 100644 .config/nvim/lua/plugins/indent-blankline.lua create mode 100644 .config/nvim/lua/plugins/jump.lua create mode 100644 .config/nvim/lua/plugins/lspconfig.lua create mode 100644 .config/nvim/lua/plugins/lualine.lua create mode 100644 .config/nvim/lua/plugins/nvim-cmp.lua create mode 100644 .config/nvim/lua/plugins/surround.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua delete mode 100755 .local/bin/sbar diff --git a/.config/git/config b/.config/git/config index ba704aa..14d3c55 100644 --- a/.config/git/config +++ b/.config/git/config @@ -1,3 +1,5 @@ +[init] + defaultBranch = main [alias] ap = add -p br = branch diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 514c67f..03210de 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -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 diff --git a/.config/nvim/lua/maps.lua b/.config/nvim/lua/maps.lua index dd94f21..4e78afe 100644 --- a/.config/nvim/lua/maps.lua +++ b/.config/nvim/lua/maps.lua @@ -26,7 +26,7 @@ map("n", "c", ":w! | !compiler '%'") map("n", "op", ":!opout %") map("n", "se", ":setlocal spell! spelllang=en_us") -map('n', 'ge', vim.diagnostic.open_float) -map('n', '[d', vim.diagnostic.goto_prev) -map('n', ']d', vim.diagnostic.goto_next) -map('n', '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", "q", vim.diagnostic.setloclist) diff --git a/.config/nvim/lua/plugins/eighties.lua b/.config/nvim/lua/plugins/eighties.lua new file mode 100644 index 0000000..1b3d147 --- /dev/null +++ b/.config/nvim/lua/plugins/eighties.lua @@ -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, +} diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..a01c3e5 --- /dev/null +++ b/.config/nvim/lua/plugins/indent-blankline.lua @@ -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 +} diff --git a/.config/nvim/lua/plugins/jump.lua b/.config/nvim/lua/plugins/jump.lua new file mode 100644 index 0000000..ad38427 --- /dev/null +++ b/.config/nvim/lua/plugins/jump.lua @@ -0,0 +1,7 @@ +return { + "echasnovski/mini.jump", + version = "*", + config = function() + require("mini.jump").setup() + end, +} diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..accdf19 --- /dev/null +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -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("D", builtin.lsp_type_definitions) + map("ds", builtin.lsp_document_symbols) + map("ws", builtin.lsp_dynamic_workspace_symbols) + map("cw", vim.lsp.buf.rename) + map("ca", vim.lsp.buf.code_action) + map("K", vim.lsp.buf.hover) + map("gD", vim.lsp.buf.declaration) + + end, + }) + end +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..15745a7 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -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 = {}, + } + } +} diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..56e2faa --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -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 = { + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + }, + sources = { + {name = "nvim_lsp", max_item_count = 10}, + {name = "buffer", max_item_count = 10}, + } + } + end +} + diff --git a/.config/nvim/lua/plugins/surround.lua b/.config/nvim/lua/plugins/surround.lua new file mode 100644 index 0000000..e8d30e1 --- /dev/null +++ b/.config/nvim/lua/plugins/surround.lua @@ -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", + }, + } +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..62eb5e2 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -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", "fh", builtin.help_tags) + map("n", "fd", builtin.find_files) + map("n", "fp", extensions.project.project) + map("n", "fw", builtin.grep_string) + map("n", "fg", builtin.live_grep) + map("n", "fe", builtin.diagnostics) + map("n", "r", builtin.resume) + map("n", "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 +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..2695b72 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -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, +} diff --git a/.config/nvim/lua/sets.lua b/.config/nvim/lua/sets.lua index 537039a..dd0685f 100644 --- a/.config/nvim/lua/sets.lua +++ b/.config/nvim/lua/sets.lua @@ -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" }) diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 4ab169e..b09d12a 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -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 diff --git a/.local/bin/sbar b/.local/bin/sbar deleted file mode 100755 index b7ea244..0000000 --- a/.local/bin/sbar +++ /dev/null @@ -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" &