From 13c23dfa1cc200c41b73c22816e7559a15c9c9a0 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Fri, 16 Feb 2024 14:20:24 +0100 Subject: [PATCH] cleanup --- dot_config/nvim/after/ftplugin/tex.lua | 26 --- dot_config/nvim/after/plugin/cmp.lua | 85 -------- dot_config/nvim/after/plugin/lsp.lua.tmpl | 220 -------------------- dot_config/nvim/after/plugin/telekasten.lua | 76 ------- dot_config/nvim/after/plugin/telescope.lua | 34 --- dot_config/nvim/after/plugin/treesitter.lua | 94 --------- dot_tmux.conf.tmpl | 3 +- 7 files changed, 1 insertion(+), 537 deletions(-) delete mode 100644 dot_config/nvim/after/ftplugin/tex.lua delete mode 100644 dot_config/nvim/after/plugin/cmp.lua delete mode 100644 dot_config/nvim/after/plugin/lsp.lua.tmpl delete mode 100644 dot_config/nvim/after/plugin/telekasten.lua delete mode 100644 dot_config/nvim/after/plugin/telescope.lua delete mode 100644 dot_config/nvim/after/plugin/treesitter.lua diff --git a/dot_config/nvim/after/ftplugin/tex.lua b/dot_config/nvim/after/ftplugin/tex.lua deleted file mode 100644 index aca76a7..0000000 --- a/dot_config/nvim/after/ftplugin/tex.lua +++ /dev/null @@ -1,26 +0,0 @@ -vim.g.tex_flavor = "latex" - -vim.opt_local.conceallevel = 2 --- vim.opt_local.spell = true -vim.opt_local.wrap = true - -require("nvim-surround").buffer_setup({ - surrounds = { - ['"'] = { - add = { "``", "''" }, - find = "``.-''", - delete = "^(``)().-('')()$", - }, - ["$"] = { - add = { "\\(", "\\)" }, - find = "\\%(.-\\%)", - delete = "^(\\%()().-(\\%))()$", - change = { - target = "^\\(%()().-(\\%))()$", - replacement = function() - return { { "[", "\t" }, { "", "\\]" } } - end, - }, - }, - }, -}) diff --git a/dot_config/nvim/after/plugin/cmp.lua b/dot_config/nvim/after/plugin/cmp.lua deleted file mode 100644 index 01f483e..0000000 --- a/dot_config/nvim/after/plugin/cmp.lua +++ /dev/null @@ -1,85 +0,0 @@ -local ok, cmp = pcall(require, 'cmp') -if not ok then - return -end - -require('luasnip.loaders.from_vscode').lazy_load() - -local luasnip = require('luasnip') -local lspkind = require('lspkind') -local select_opts = {behavior = cmp.SelectBehavior.Select} - -cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end - }, - sources = { - {name = 'path'}, - {name = 'nvim_lsp', keyword_length = 1}, - {name = 'buffer', keyword_length = 3}, - {name = 'luasnip', keyword_length = 2}, - }, - window = { - documentation = cmp.config.window.bordered() - }, - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol_text', -- show only symbol annotations - maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - }) - }, - mapping = { - [''] = cmp.mapping.select_prev_item(select_opts), - [''] = cmp.mapping.select_next_item(select_opts), - - [''] = cmp.mapping.select_prev_item(select_opts), - [''] = cmp.mapping.select_next_item(select_opts), - - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({select = true}), - [''] = cmp.mapping.confirm({select = false}), - - [''] = cmp.mapping(function(fallback) - if luasnip.jumpable(1) then - luasnip.jump(1) - else - fallback() - end - end, {'i', 's'}), - - [''] = cmp.mapping(function(fallback) - if luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, {'i', 's'}), - - [''] = cmp.mapping(function(fallback) - local col = vim.fn.col('.') - 1 - - if cmp.visible() then - cmp.select_next_item(select_opts) - elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - fallback() - else - cmp.complete() - end - end, {'i', 's'}), - - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item(select_opts) - else - fallback() - end - end, {'i', 's'}), - }, -}) - - diff --git a/dot_config/nvim/after/plugin/lsp.lua.tmpl b/dot_config/nvim/after/plugin/lsp.lua.tmpl deleted file mode 100644 index 769c630..0000000 --- a/dot_config/nvim/after/plugin/lsp.lua.tmpl +++ /dev/null @@ -1,220 +0,0 @@ -local ok, lsp = pcall(require, 'lspconfig') -if not ok then - return -end - -{{- if ne .chezmoi.os "openbsd" }} --- See :help mason-settings -require('mason').setup({ - ui = { border = 'rounded' } -}) - --- See :help mason-lspconfig-settings -require('mason-lspconfig').setup({ - ensure_installed = { - 'clangd', - 'gopls', - 'ltex', - 'marksman', - 'svelte', - 'tsserver', - 'eslint', - 'html', - 'cssls', - 'lua_ls' - } -}) -{{- end }} - -local lsp_defaults = lsp.util.default_config - -lsp_defaults.capabilities = vim.tbl_deep_extend( - 'force', - lsp_defaults.capabilities, - require('cmp_nvim_lsp').default_capabilities() -) - -local sign = function(opts) - -- See :help sign_define() - vim.fn.sign_define(opts.name, { - texthl = opts.name, - text = opts.text, - numhl = '' - }) -end - -sign({ name = 'DiagnosticSignError', text = '✘' }) -sign({ name = 'DiagnosticSignWarn', text = '▲' }) -sign({ name = 'DiagnosticSignHint', text = '⚑' }) -sign({ name = 'DiagnosticSignInfo', text = '' }) - -vim.diagnostic.config({ - virtual_text = false, - severity_sort = true, - float = { - border = 'rounded', - source = 'always', - header = '', - prefix = '', - }, -}) - -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["workspace/diagnostic/refresh"] = function(_, _, ctx) - local ns = vim.lsp.diagnostic.get_namespace(ctx.client_id) - pcall(vim.diagnostic.reset, ns) - return true -end - -vim.api.nvim_create_autocmd('BufWritePre', { - pattern = '*.go', - callback = function() - vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true }) - end -}) - -require("lsp-format").setup { - html = { - exclude = { "html" } - }, - svelte = { - exclude = { "svelte" } - } -} - -{{- if ne .chezmoi.os "openbsd" }} -local group = vim.api.nvim_create_augroup('lsp_cmds', { clear = true }) - -vim.api.nvim_create_autocmd('LspAttach', { - group = group, - desc = 'LSP actions', - callback = function(args) - local bufmap = function(mode, lhs, rhs) - local opts = { buffer = true } - vim.keymap.set(mode, lhs, rhs, opts) - end - local client = vim.lsp.get_client_by_id(args.data.client_id) - require("lsp-format").on_attach(client) - - bufmap('n', 'K', 'lua vim.lsp.buf.hover()') - bufmap('n', 'gd', 'lua vim.lsp.buf.definition()') - bufmap('n', 'gD', 'lua vim.lsp.buf.declaration()') - bufmap('n', 'go', 'lua vim.lsp.buf.type_definition()') - bufmap('n', 'gs', 'lua vim.lsp.buf.signature_help()') - bufmap('n', 'gA', 'Telescope diagnostics') - bufmap('n', 'gr', 'Telescope lsp_references') - bufmap('n', 'gi', 'Telescope lsp_implementations') - bufmap('n', '', 'lua vim.lsp.buf.rename()') - bufmap('n', '', 'lua vim.lsp.buf.format({async = true})') - bufmap('n', '', 'lua vim.lsp.buf.code_action()') - bufmap('x', '', 'lua vim.lsp.buf.range_code_action()') - bufmap('n', 'gl', 'lua vim.diagnostic.open_float()') - bufmap('n', '[d', 'lua vim.diagnostic.goto_prev()') - bufmap('n', ']d', 'lua vim.diagnostic.goto_next()') - end -}) - -require('mason-lspconfig').setup_handlers({ - function(server) - lsp[server].setup({}) - end, - ['tsserver'] = function() - lsp.tsserver.setup({ - settings = { - completions = { - completeFunctionCalls = true - } - } - }) - end, - ['lua_ls'] = function() - lsp.lua_ls.setup({ - settings = { - Lua = { - diagnostics = { - globals = { 'vim' } - }, - } - } - }) - end, - ['gopls'] = function() - lsp.gopls.setup({ - settings = { - gopls = { - analyses = { - unusedparams = true, - unusedvariable = true, - shadow = true - }, - staticcheck = true, - }, - } - }) - end, -}) -{{- else }} -local on_attach = function(client) - local bufmap = function(mode, lhs, rhs) - local opts = {buffer = true} - vim.keymap.set(mode, lhs, rhs, opts) - end - require("lsp-format").on_attach(client) - - bufmap('n', 'K', 'lua vim.lsp.buf.hover()') - bufmap('n', 'gd', 'lua vim.lsp.buf.definition()') - bufmap('n', 'gD', 'lua vim.lsp.buf.declaration()') - bufmap('n', 'go', 'lua vim.lsp.buf.type_definition()') - bufmap('n', 'gs', 'lua vim.lsp.buf.signature_help()') - bufmap('n', 'gA', 'Telescope diagnostics') - bufmap('n', 'gr', 'Telescope lsp_references') - bufmap('n', 'gi', 'Telescope lsp_implementations') - bufmap('n', '', 'lua vim.lsp.buf.rename()') - bufmap('n', '', 'lua vim.lsp.buf.format({async = true})') - bufmap('n', '', 'lua vim.lsp.buf.code_action()') - bufmap('x', '', 'lua vim.lsp.buf.range_code_action()') - bufmap('n', 'gl', 'lua vim.diagnostic.open_float()') - bufmap('n', '[d', 'lua vim.diagnostic.goto_prev()') - bufmap('n', ']d', 'lua vim.diagnostic.goto_next()') -end - -lsp.gopls.setup { - settings = { - gopls = { - analyses = { - unusedparams = true, - unusedvariable = true, - shadow = true - }, - staticcheck = true, - }, - }, - on_attach = on_attach -} -lsp.clangd.setup { on_attach = on_attach } -lsp.ltex.setup { - on_attach = on_attach, - filetypes = { "latex", "tex", "bib", "mkd", "gitcommit", "text" }, - } -lsp.svelte.setup { on_attach = on_attach } -lsp.tsserver.setup { on_attach = on_attach } -lsp.lua_ls.setup { - settings = { - Lua = { - diagnostics = { - globals = { 'vim' } - }, - } - }, - on_attach = on_attach -} -{{- end }} diff --git a/dot_config/nvim/after/plugin/telekasten.lua b/dot_config/nvim/after/plugin/telekasten.lua deleted file mode 100644 index b8d1955..0000000 --- a/dot_config/nvim/after/plugin/telekasten.lua +++ /dev/null @@ -1,76 +0,0 @@ -local ok, telekasten = pcall(require, 'telekasten') -local home = vim.fn.expand("~/doc/zettelkasten") - -telekasten.setup { - home = home, - take_over_my_home = true, - auto_set_filetype = true, - dailies = home .. '/' .. 'daily', - weeklies = home .. '/' .. 'weekly', - templates = home .. '/' .. 'templates', - image_subdir = "img", - extension = ".md", - new_note_filename = "uuid-title", - uuid_type = "%Y%m%d%H%M", - uuid_sep = "-", - follow_creates_nonexisting = true, - dailies_create_nonexisting = true, - weeklies_create_nonexisting = true, - journal_auto_open = false, - - -- template for new notes (new_note, follow_link) - -- set to `nil` or do not specify if you do not want a template - template_new_note = home .. '/' .. 'templates/new_note.md', - - -- template for newly created daily notes (goto_today) - -- set to `nil` or do not specify if you do not want a template - template_new_daily = home .. '/' .. 'templates/daily.md', - - -- template for newly created weekly notes (goto_thisweek) - -- set to `nil` or do not specify if you do not want a template - template_new_weekly= home .. '/' .. 'templates/weekly.md', - - -- image link style - -- wiki: ![[image name]] - -- markdown: ![](image_subdir/xxxxx.png) - image_link_style = "wiki", - - -- default sort option: 'filename', 'modified' - sort = "filename", - - -- integrate with calendar-vim - plug_into_calendar = true, - calendar_opts = { - weeknm = 4, - calendar_monday = 1, - calendar_mark = 'left-fit', - }, - - close_after_yanking = false, - insert_after_inserting = true, - tag_notation = "#tag", - command_palette_theme = "dropdown", - show_tags_theme = "ivy", - subdirs_in_links = true, - template_handling = "smart", - new_note_location = "smart", - rename_update_links = true, - follow_url_fallback = nil, -} - -local map = vim.keymap.set -map('n',"zf", "Telekasten find_notes") -map('n',"zd", "Telekasten find_daily_notes") -map('n',"zg", "Telekasten search_notes") -map('n',"zz", "Telekasten follow_link") -map('n',"zn", "Telekasten new_note") -map('n',"zr", "Telekasten rename_note") -map('n',"zc", "Telekasten show_calendar") -map('n',"#", "Telekasten show_tags") - -map('n',"z", "Telekasten panel") - -vim.api.nvim_set_hl(0, "tklink", { fg = "#689d6a", bg = "" }) -vim.api.nvim_set_hl(0, "tkBrackets", { fg = "gray", bg = "gray" }) - - diff --git a/dot_config/nvim/after/plugin/telescope.lua b/dot_config/nvim/after/plugin/telescope.lua deleted file mode 100644 index 8ed8247..0000000 --- a/dot_config/nvim/after/plugin/telescope.lua +++ /dev/null @@ -1,34 +0,0 @@ -local ok, telescope = pcall(require, 'telescope') -if not ok then - return -end - -telescope.setup { - defaults = { - prompt_prefix = '❯ ', - selection_caret = '❯ ', - layout_config = { horizontal = { preview_width = 0.5 } }, - file_ignore_patterns = { 'node_modules/.*' }, - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - } - } -} - -telescope.load_extension('fzf') -telescope.load_extension('file_browser') - -local map = vim.keymap.set -map('n', "", "Telescope file_browser") -map('n', "", "Telescope current_buffer_tags") - -map('n', "e", "Telescope find_files") -map('n', "f", "Telescope live_grep") -map('n', "b", "Telescope buffers") -map('n', "h", "Telescope help_tags") -map('n', "z=", "Telescope spell_suggest") diff --git a/dot_config/nvim/after/plugin/treesitter.lua b/dot_config/nvim/after/plugin/treesitter.lua deleted file mode 100644 index 78b6ff8..0000000 --- a/dot_config/nvim/after/plugin/treesitter.lua +++ /dev/null @@ -1,94 +0,0 @@ -local ok, treesitter = pcall(require, 'nvim-treesitter.configs') -if not ok then - return -end - - -treesitter.setup { - incremental_selection = { - enable = true, - keymaps = { - -- mappings for incremental selection (visual mappings) - init_selection = "gnn", -- maps in normal mode to init the node/scope selection - node_incremental = "grn", -- increment to the upper named parent - scope_incremental = "grc", -- increment to the upper scope (as defined in locals.scm) - node_decremental = "grm" -- decrement to the previous node - } - }, - textobjects = { - -- syntax-aware textobjects - enable = true, - lsp_interop = { - enable = true, - peek_definition_code = { - ["DF"] = "@function.outer", - } - }, - keymaps = { - ["iL"] = { - -- you can define your own textobjects directly here - go = "(function_definition) @function", - }, - -- or you use the queries from supported languages with textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["aC"] = "@class.outer", - ["iC"] = "@class.inner", - ["ac"] = "@conditional.outer", - ["ic"] = "@conditional.inner", - ["ae"] = "@block.outer", - ["ie"] = "@block.inner", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - ["is"] = "@statement.inner", - ["as"] = "@statement.outer", - ["ad"] = "@comment.outer", - ["am"] = "@call.outer", - ["im"] = "@call.inner" - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]]"] = "@function.outer", - ["]c"] = { query = "@class.outer", desc = "Next class start" }, - -- - -- You can use regex matching and/or pass a list in a "query" key to group multiple queires. - ["]o"] = "@loop.*", - -- ["]o"] = { query = { "@loop.inner", "@loop.outer" } } - -- - -- You can pass a query group to use query from `queries//.scm file in your runtime path. - -- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. - ["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" }, - ["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, - }, - goto_next_end = { - ["]["] = "@function.outer", - ["]C"] = "@class.outer", - }, - goto_previous_start = { - ["[["] = "@function.outer", - ["[c"] = "@class.outer", - }, - goto_previous_end = { - ["[]"] = "@function.outer", - ["[C"] = "@class.outer", - } - } - }, - ensure_installed = { - 'javascript', - 'typescript', - 'css', - 'json', - 'c', - 'lua', - 'go' - }, - sync_install = false, - auto_install = true, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, -} diff --git a/dot_tmux.conf.tmpl b/dot_tmux.conf.tmpl index 3e8fa84..5ee92ce 100644 --- a/dot_tmux.conf.tmpl +++ b/dot_tmux.conf.tmpl @@ -68,9 +68,8 @@ set -g @catppuccin_status_right_separator_inverse "no" set -g @catppuccin_status_fill "icon" set -g @catppuccin_status_connect_separator "no" -set -g @catppuccin_directory_text "#{pane_current_path}" -set -g @catppuccin_host_text "#{host_short}" set -g @catppuccin_directory_icon " " +set -g @catppuccin_host_text "#{host_short}" set -g @catppuccin_user_icon " " set -g @catppuccin_host_icon " " set -g @catppuccin_date_time_icon " "