diff --git a/nvim/.gitignore b/nvim/.gitignore deleted file mode 100644 index 9d7085c..0000000 --- a/nvim/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -tt.* -.tests -doc/tags -debug -.repro -foo.* -*.log -data -*.spl -*.sug diff --git a/nvim/LICENSE b/nvim/LICENSE index 5ee6e88..261eeb9 100644 --- a/nvim/LICENSE +++ b/nvim/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 Michael Rolli + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/nvim/README.md b/nvim/README.md index 71ef220..185280b 100644 --- a/nvim/README.md +++ b/nvim/README.md @@ -1,54 +1,4 @@ # 💤 LazyVim -My own Neovim config based on starter template of [LazyVim](https://github.com/LazyVim/LazyVim). - -In addition to the standard set of plugins coming with LazyVim I added a bunch -of additional plugins I'm used to. These are added using their own config files, -see `lua/plugins/*.lua`. - -## Activated LazyVim Extras - -The following LazyVim Extras are activated in `nvim/lua/config/lazy.lua`: - -* lazyvim.plugins.extras.editor.navic -* lazyvim.plugins.extras.lang.markdown -* lazyvim.plugins.extras.lang.terraform -* lazyvim.plugins.extras.lang.yaml -* lazyvim.plugins.extras.util.project - -## Additional plugins - -| Plugin | Description | -|--------------- | --------------- | -| NvChad/nvim-colorizer.lua | Add visual representaton for colors inline as virtualtext | -| sainhe/gruvbox-material | A great colorscheme based on gruvbox | -| zbirenbaum/copilot | GitHub Copilot at your fingertips | -| folke/zen-mode.nvim | Plugin for distraction free coding | -| folke/twilight.nvim | Plugin that dims inactive portions of the code using TreeSitter | - -## Custom Keymaps - -As I use the Expose keybindings on my Mac, I added new key bindings for moving -lines. These work in normal, insert and virtual mode: - -| Keymap | Function | -|--------| ----------- | -| \ | Move current line/selecton up one line | -| \ | Move current line/selecton down one line | - -As I have turned off direct yanking to the system clipboard (unnamedplus), there -are additional keymaps regarding system clipboard handling: - -| Keymap | Function | -|----------| ----------- | -| \y | Yank to the clipboard | -| \yy | Yank line to the clipboard | -| \p | Paste fromt the system clipboard | -| \d | Delete to the back hole register | - -Other keymaps include: - -| Keymap | Function | -|----------- | ----------- | -| \fx | Make current file in buffer executable | -| \cs | Show list of available snippets for the current filetype | +A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). +Refer to the [documentation](https://lazyvim.github.io/installation) to get started. diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 2cdbd04..1b8396a 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -5,15 +5,16 @@ "bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" }, "catppuccin": { "branch": "main", "commit": "7be452ee067978cdc8b2c5f3411f0c71ffa612b9" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-git": { "branch": "main", "commit": "50d526dff0f6bc441b51fc269d9fdc99a50c76af" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "conform.nvim": { "branch": "master", "commit": "40d4e98fcc3e6f485f0e8924c63734bc7e305967" }, + "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, "dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, - "gen.nvim": { "branch": "main", "commit": "83f1d6b6ffa6a6f32f6a93a33adc853f27541a94" }, "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, "grug-far.nvim": { "branch": "main", "commit": "f47594f05d10b0bedfc0ed78e488e7fd714d57be" }, "gruvbox-material": { "branch": "master", "commit": "b16dcd787db5ba9302b54ebeac186784c2aed29a" }, @@ -31,18 +32,18 @@ "mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" }, "mini.pairs": { "branch": "main", "commit": "694d9beb488ff1afaf3d1977b067e53c827d9af5" }, "mini.surround": { "branch": "main", "commit": "e1ac1ce5c7499aa4cc2ca9fb1adec9e730dd9394" }, + "modicator.nvim": { "branch": "main", "commit": "d1d327fd4bdfc3af4cfdf83b85c2eaefa71de7a8" }, "neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, "noice.nvim": { "branch": "main", "commit": "df448c649ef6bc5a6a633a44f2ad0ed8d4442499" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-ansible": { "branch": "main", "commit": "9c3b4a771b8c8d7b4f2171466464d978cb3846f7" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" }, - "nvim-lint": { "branch": "master", "commit": "27f44d1cc3d733a38a736acb902f94879d99c76c" }, - "nvim-lspconfig": { "branch": "master", "commit": "ff69ecca55d83ffc70657f260a799f79a5637831" }, + "nvim-lint": { "branch": "master", "commit": "f707b3ae50417067fa63fdfe179b0bff6b380da1" }, + "nvim-lspconfig": { "branch": "master", "commit": "c38af37e4ee71d70b7d60267d96b0a83e5d346f5" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, "nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" }, - "nvim-treesitter": { "branch": "master", "commit": "9d2acd49976e2a9da72949008df03436f781fd23" }, + "nvim-treesitter": { "branch": "master", "commit": "19079207ba4a8c7ed956f40a111a22b1a2dfa6e8" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, @@ -57,7 +58,9 @@ "tokyonight.nvim": { "branch": "main", "commit": "2c85fad417170d4572ead7bf9fdd706057bd73d7" }, "trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" }, "ts-comments.nvim": { "branch": "main", "commit": "98d7d4dec0af1312d38e288f800bbf6ff562b6ab" }, - "twilight.nvim": { "branch": "main", "commit": "1584c0b0a979b71fd86b18d302ba84e9aba85b1b" }, - "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }, - "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" } + "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, + "vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" }, + "vim-dadbod-ui": { "branch": "master", "commit": "f29c85ab42861c6ef683289b0c6a51e0d436dcf6" }, + "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" }, + "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } } diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json index 57693ea..81f4847 100644 --- a/nvim/lazyvim.json +++ b/nvim/lazyvim.json @@ -1,13 +1,18 @@ { "extras": [ + "lazyvim.plugins.extras.coding.copilot", "lazyvim.plugins.extras.coding.copilot-chat", "lazyvim.plugins.extras.coding.mini-surround", "lazyvim.plugins.extras.editor.inc-rename", "lazyvim.plugins.extras.editor.navic", "lazyvim.plugins.extras.lang.ansible", + "lazyvim.plugins.extras.lang.git", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", + "lazyvim.plugins.extras.lang.php", + "lazyvim.plugins.extras.lang.sql", "lazyvim.plugins.extras.lang.terraform", + "lazyvim.plugins.extras.lang.toml", "lazyvim.plugins.extras.lang.yaml", "lazyvim.plugins.extras.ui.mini-animate", "lazyvim.plugins.extras.util.dot", diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index 13d7060..27e9e06 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -1,62 +1,3 @@ -- Autocmds are automatically loaded on the VeryLazy event -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua -- Add any additional autocmds here - --- vim.api.nvim_create_autocmd("BufEnter", { --- pattern = { "*.json", "*.jsonc" }, --- -- enable wrap mode for json files only --- command = "setlocal wrap", --- }) --- vim.api.nvim_create_autocmd("FileType", { --- pattern = "zsh", --- callback = function() --- -- let treesitter use bash highlight for zsh files as well --- require("nvim-treesitter.highlight").attach(0, "bash") --- end, --- }) - --- Automatically set text width for markdown files -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "markdown" }, - command = "set tw=80", -}) - --- Empty formatexpr for markdwon files to make gqq and gqap work again -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "markdown", "gitcommit" }, - command = "set formatexpr=", -}) - --- Markdown should have wrapping enabled by default -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "markdown" }, - command = "set wrap", -}) - --- Disable the concealing in some file formats --- The default conceallevel is 3 in LazyVim -vim.api.nvim_create_autocmd("FileType", { - pattern = { "json", "jsonc" }, - callback = function() - vim.opt.conceallevel = 0 - end, -}) - --- Empty formatexpr for LSP buffers to make gqq and gqap work again --- vim.api.nvim_create_autocmd('LspAttach', { --- callback = function(args) --- vim.bo[args.buf].formatexpr = nil --- end, --- }) - --- Set relative line numbers when not in insert mode -vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, { - pattern = "*", - command = 'if &nu && mode() != "i" | set rnu | endif', -}) - --- Set absolute line numbers when in insert mode -vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" }, { - pattern = "*", - command = "if &nu | set nornu | endif", -}) diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index e0511ba..2c134f7 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -1,70 +1,3 @@ -- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here - -local function map(mode, lhs, rhs, opts) - local keys = require("lazy.core.handler").handlers.keys - ---@cast keys LazyKeysHandler - -- do not create the keymap if a lazy keys handler exists - if not keys.active[keys.parse({ lhs, mode = mode }).id] then - opts = opts or {} - opts.silent = opts.silent ~= false - vim.keymap.set(mode, lhs, rhs, opts) - end -end - --- These remaps make the jumps scroll to the middle of --- the screen for less eye distraction -map("n", "", "zz") -map("n", "", "zz") -map("n", "", "zz") -map("n", "", "zz") -map("n", "n", "nzzzv") -map("n", "N", "Nzzzv") -map("n", "gd", "gdzzzv") - --- Resize window using arrow keys -map("n", "", "resize +2", { desc = "Increase window height" }) -map("n", "", "resize -2", { desc = "Decrease window height" }) -map("n", "", "vertical resize +2", { desc = "Decrease window width" }) -map("n", "", "vertical resize -2", { desc = "Increase window width" }) - ---[[ - Using leader + y/Y to yank to unnameplus or paste from unnamedplus register. - The register unnamedplus is the system's clipboard and is the default - clipboard register in LazyVim, but I don't like that. - Therefore clipboard is changed to empty value (see lua/config/options.lua) and these - additional mappings below using the leader key are in place to yank to and paste - from the unnamedplus register. - Found at https://github.com/LunarVim/LunarVim/issues/930#issuecomment-890597260 - ]] - --- Increment/decrement -map("n", "+", "", { desc = "Increment" }) -map("n", "-", "", { desc = "Decrement" }) - --- Select all text in buffer -map("n", "", "ggVG", { desc = "Select all" }) - --- Yank to system clipboard -map("n", "y", '"+y', { desc = "Yank to clipboard" }) -map("n", "yy", '"+yy', { desc = "Yank line to clipboard" }) -map("v", "y", '"+y', { desc = "Yank to clipboard" }) - --- Paste from system clipbard -map("n", "p", '"+p', { desc = "Paste from clipboard" }) -map("n", "P", '"+P', { desc = "Paste from clipboard" }) -map("v", "p", '"+p', { desc = "Paste from clipboard" }) - --- Deliberately delete to black hole register -map("n", "d", '"_d', { desc = "Delete to black hole" }) -map("v", "d", '"_d', { desc = "Delete to black hole" }) - --- Make file in current buffer executable -map("n", "fx", "silent !chmod +x %", { desc = "Make % executable" }) - --- Show all known snippets for the current filetype -map("n", "cs", ":lua require('luasnip.extras.snippet_list').open()", { desc = "Show Snippet List" }) - --- Align markdown tables using pa'doc -map("v", "ct", "!pandoc -t markdown-simple_tables", { desc = "Align selected md table using pandoc" }) diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 224e8eb..d73bfa1 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -1,29 +1,23 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +if not (vim.uv or vim.loop).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 + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) +vim.opt.rtp:prepend(lazypath) require("lazy").setup({ spec = { -- add LazyVim and import its plugins - { - "LazyVim/LazyVim", - import = "lazyvim.plugins", - opts = { - colorscheme = "gruvbox-material", - news = { - lazyvim = true, - neovim = true, - }, - }, - }, - -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, -- import/override with your plugins { import = "plugins" }, }, @@ -37,7 +31,10 @@ require("lazy").setup({ -- version = "*", -- try installing the latest stable version for plugins that support semver }, install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates + checker = { + enabled = true, -- check for plugin updates periodically + notify = false, -- notify on update + }, -- automatically check for plugin updates performance = { rtp = { -- disable some rtp plugins diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 2627ba9..b5e1406 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -4,32 +4,10 @@ -- no automatic system clipboard usage -- see also keybindings regarding yanking -vim.opt.clipboard = "" --- add a highlighted column -vim.opt.colorcolumn = "80" +-- vim.opt.clipboard = "" + -- turn off formatting on save -- vim.g.autoformat = false + -- configure spellcheck to use both english and german vim.opt.spelllang = { "en", "de" } - --- configure wildmenu related options -vim.opt.wildmode = "full" --- vim.opt.wildoptions = "pum" -vim.opt.wildignore = { - "*~", - "**/.git/*", - "**/.vagrant/*", - "*.o", - "*.pyc", - "*pycache*", -} --- vim.opt.pumblend = 10 -- make pop-up menu slightly transparent - --- Custom filetypes --- vim.filetype.add({ --- pattern = { --- [".*/ansible.*/.*%.ya?ml"] = "yaml.ansible", --- [".*/playbooks/.*%.ya?ml"] = "yaml.ansible", --- [".*/roles/.*%.ya?ml"] = "yaml.ansible", --- }, --- }) diff --git a/nvim/lua/plugins/ai.lua b/nvim/lua/plugins/ai.lua deleted file mode 100644 index e2e977e..0000000 --- a/nvim/lua/plugins/ai.lua +++ /dev/null @@ -1,85 +0,0 @@ --- This file contains all the configuration related to AI plugins: --- - David-Kunz/gen.nvimdev --- - ChatGPT.vim --- - Github Copilot plugin - -return { - { - -- Setup David-Kunz/gen.nvim - -- see https://github.com/David-Kunz/gen.nvim - "David-Kunz/gen.nvim", - enabled = true, - keys = { - { "ap", ":Gen", mode = { "n", "v" }, desc = "Select Gen command" }, - }, - config = function() - local gen = require("gen") - gen.setup({ - model = "mistral", - -- The display mode can be "float" or "split" - display_mode = "split", - show_prompt = false, - }) - gen.prompts["Ask the DevOps Engineer"] = { - prompt = "You are a senior devops engineer, acting as an assistant. You offer help with cloud technologies like: Terraform, Packer, Azure, Ansible, Bash, Python, HCL. You answer with code examples when possible. $input:\n$text", - replace = true, - } - gen.prompts["Make_Style"] = { - prompt = "Transform the following text into the styole of $input:\n$text", - replace = true, - } - end, - }, - { - -- Setup ChatGPT.vim plugin - -- see https://github.com/jackMort/ChatGPT.nvim - "jackMort/ChatGPT.nvim", - enabled = false, - event = "VeryLazy", - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - }, - config = function() - require("chatgpt").setup({ - api_key_cmd = "op read op://Privat/openai.com/credential --no-newline", - }) - end, - }, - { - -- Setup Github Copilot plugin - -- see https://github.com/zbirenbaum/copilot.lua - "zbirenbaum/copilot.lua", - cmd = "Copilot", - build = ":Copilot auth", - event = "InsertEnter", - config = function() - require("copilot").setup({ - panel = { - enabled = false, - }, - enabled = false, - suggestion = { - enabled = true, - auto_trigger = true, - debounce = 75, - keymap = { - accept = "", - next = "", - prev = "", - dismiss = "a", group = "ai tools", mode = { "n", "v" } }, - }, - }, - }, - { - "nvim-neo-tree/neo-tree.nvim", - opts = { - filesystem = { - filtered_items = { - visible = true, - hide_dotfiles = true, - hide_gitignored = true, - }, - }, - }, - }, -} diff --git a/nvim/lua/plugins/example.lua b/nvim/lua/plugins/example.lua index f84ebdc..4ad9825 100644 --- a/nvim/lua/plugins/example.lua +++ b/nvim/lua/plugins/example.lua @@ -30,14 +30,6 @@ return { -- disable trouble { "folke/trouble.nvim", enabled = false }, - -- add symbols-outline - { - "simrat39/symbols-outline.nvim", - cmd = "SymbolsOutline", - keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - config = true, - }, - -- override nvim-cmp and add cmp-emoji { "hrsh7th/nvim-cmp", @@ -71,18 +63,6 @@ return { }, }, - -- add telescope-fzf-native - { - "telescope.nvim", - dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - }, - -- add pyright to lspconfig { "neovim/nvim-lspconfig", @@ -102,7 +82,7 @@ return { dependencies = { "jose-elias-alvarez/typescript.nvim", init = function() - require("lazyvim.util").on_attach(function(_, buffer) + require("lazyvim.util").lsp.on_attach(function(_, buffer) -- stylua: ignore vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) @@ -210,56 +190,4 @@ return { }, }, }, - - -- Use for completion and snippets (supertab) - -- first: disable default and behavior in LuaSnip - { - "L3MON4D3/LuaSnip", - keys = function() - return {} - end, - }, - -- then: setup supertab in cmp - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-emoji", - }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local luasnip = require("luasnip") - local cmp = require("cmp") - - opts.mapping = vim.tbl_extend("force", opts.mapping, { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- this way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }) - end, - }, } diff --git a/nvim/lua/plugins/lsp-config.lua b/nvim/lua/plugins/lsp-config.lua deleted file mode 100644 index 35a0cea..0000000 --- a/nvim/lua/plugins/lsp-config.lua +++ /dev/null @@ -1,52 +0,0 @@ --- LSP related addtional configuration - -local diag_format = function(d) - local code = d.code or (d.user_data and d.user_data.lsp.code) - if code then - return string.format("%s (%s)", d.message, code):gsub("1. ", "") - end - return d.message -end - -return { - -- Automatically intall addditional language server, - -- debug adapters, linters and formatters - { - "williamboman/mason.nvim", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { - -- language servers - "bash-language-server", - "intelephense", - "lua-language-server", - -- debug adapters - -- linters - "shellcheck", - -- formatters - }) - end, - }, - - -- Configure changes to LSP servers - { - "neovim/nvim-lspconfig", - opts = { - -- -@type lspconfig.options - -- Show error code in virtual text output - virtual_text = { - format = diag_format, - }, - servers = { - lua_ls = { - settings = { - Lua = { - diagnostics = { - disable = { "lowercase-global" }, - }, - }, - }, - }, - }, - }, - }, -} diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua deleted file mode 100644 index 27e9ddc..0000000 --- a/nvim/lua/plugins/lualine.lua +++ /dev/null @@ -1,114 +0,0 @@ --- Change lualine plugin configuration to my taste --- see https://github.com/nvim-lualine/lualine.nvim - -local window_width_limit = 100 - -local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > window_width_limit - end, - check_git_workspace = function() - local filepath = vim.fn.expand("%:p:h") - local gitdir = vim.fn.finddir(".git", filepath .. ";") - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, -} - -local function mixed_indenting() - local space_pat = [[\v^ +]] - local tab_pat = [[\v^\t+]] - local space_indent = vim.fn.search(space_pat, "nwc") - local tab_indent = vim.fn.search(tab_pat, "nwc") - local mixed = (space_indent > 0 and tab_indent > 0) - local mixed_same_line - if not mixed then - mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], "nwc") - mixed = mixed_same_line > 0 - end - if not mixed then - return "" - end - if mixed_same_line ~= nil and mixed_same_line > 0 then - return "MI:" .. mixed_same_line - end - local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total - local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total - if space_indent_cnt > tab_indent_cnt then - return "MI:" .. tab_indent - else - return "MI:" .. space_indent - end -end - --- See https://github.com/nvim-lualine/lualine.nvim#general-component-options -local components = { - encoding = { - "encoding", - -- fmt = string.upper, - cond = conditions.hide_in_width, - padding = 0, - }, - fileformat = { - "fileformat", - icons_enabled = true, - symbols = { - unix = "LF", - dos = "CRLF", - mac = "CR", - }, - cond = nil, - }, - filetype = { "filetype", cond = nil, padding = 0 }, - location = { "location", cond = nil, padding = 0 }, - mixedindent = { - mixed_indenting(), - cond = nil, - padding = 0, - }, - progress = { "progress", cond = nil, padding = 0 }, - spaces = { - function() - local shiftwidth = vim.api.nvim_buf_get_option(0, "shiftwidth") - return " " .. shiftwidth - end, - cond = nil, - padding = 1, - }, - time = { - function() - return " " .. os.date("%R") - end, - cond = conditions.hide_in_width, - padding = { left = 1, right = 0 }, - }, -} - -return { - { - "nvim-lualine/lualine.nvim", - enabled = true, - opts = { - options = { - component_separators = { left = "", right = "" }, - -- section_separators = { left = '', right = ''}, - }, - sections = { - lualine_y = { - components.filetype, - components.fileformat, - components.encoding, - components.spaces, - components.mixedindent, - }, - lualine_z = { - components.progress, - components.location, - components.time, - }, - }, - }, - }, -} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 04349c6..0000000 --- a/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,16 +0,0 @@ --- Setup telescpoe-fzf-native plugin --- see https://github.com/nvim-telescope/telescope-fzf-native.nvim - -return { - -- add telescope-fzf-native - { - "telescope.nvim", - dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - }, -} diff --git a/nvim/lua/plugins/template.lua b/nvim/lua/plugins/template.lua deleted file mode 100644 index 4ad7ecb..0000000 --- a/nvim/lua/plugins/template.lua +++ /dev/null @@ -1,18 +0,0 @@ --- Setup plugin --- see https://github.com//.nvim - --- remove these two lines upon copying this template -if true then - return {} -end - -return { - { - "/", - enabled = true, - opts = { - -- add your options that should be passed to the setup() function here - --option = "value", - }, - }, -} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua deleted file mode 100644 index dd05b0c..0000000 --- a/nvim/lua/plugins/treesitter.lua +++ /dev/null @@ -1,20 +0,0 @@ --- Automatically install some more parsers --- -return { - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "css", - "gitignore", - "go", - "graphql", - "http", - "java", - "php", - "rust", - "sql", - }, - }, - }, -} diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua new file mode 100644 index 0000000..6c5b038 --- /dev/null +++ b/nvim/lua/plugins/ui.lua @@ -0,0 +1,12 @@ +return { + -- Setup virt-column.nvim by lukas-reineke + -- see https://github.com/lukas-reineke/virt-column.nvim + -- see :help virt-column.txt + { + "lukas-reineke/virt-column.nvim", + opts = { + char = { "┆" }, + virtcolumn = "80", + }, + }, +} diff --git a/nvim/lua/plugins/zenmode_twilight.lua b/nvim/lua/plugins/zenmode_twilight.lua deleted file mode 100644 index 8901387..0000000 --- a/nvim/lua/plugins/zenmode_twilight.lua +++ /dev/null @@ -1,29 +0,0 @@ --- Setup zen-mode and twilight plugin --- see https://github.com/folke/zen-mode.nvim --- see https://github.com/folke/twilight.nvim - -return { - { - "folke/zen-mode.nvim", - enabled = true, - keys = { - { "uz", "ZenMode", desc = "Toggle ZenMode" }, - }, - opts = { - window = { - options = { - number = true, - relativenumber = false, - }, - }, - }, - }, - { - "folke/twilight.nvim", - enabled = true, - keys = { - { "ut", "Twilight", desc = "Toggle Twilight" }, - }, - opts = { context = 6 }, - }, -} diff --git a/nvim/spell/de.utf-8.add b/nvim/spell/de.utf-8.add deleted file mode 100644 index ccb120d..0000000 --- a/nvim/spell/de.utf-8.add +++ /dev/null @@ -1,6 +0,0 @@ -Repository -Kreativmethoden -Dokumentenzentrierte -Analogietechniken -dokumentenzentrierten -Perspektivenbasiertes diff --git a/nvim/spell/en.utf-8.add b/nvim/spell/en.utf-8.add deleted file mode 100644 index e97754e..0000000 --- a/nvim/spell/en.utf-8.add +++ /dev/null @@ -1,70 +0,0 @@ -epyc2 -ivybridge -SingleR -bnode -Slurm -Ansible -gitignore -gitattributes -rebases -ansible -config -rebase -Spotify -Miniconda -conda -macOS -Homebrew -YAML -tmux -iTerm2 -neovim -lua -VimL -lvim -Pandoc -Cheatsheet -whitespace -autocommand -autocommands -stdout -stderr -ShellCheck -ERD -MariaDB -CentOS -SuSE -Rolli -parallelizable -checkpointing -CUDA -pragma -OpenACC -Podman -VirtualBox -vbox -Dektop -QEMU -VMware -Javascript -MkDocs -abstract -dotfiles -DevOps -Geerling -Ansible -vSphere -iLUB -quickfix -vimgrep -cfdo -DigitalOcean -CSR -MD5 -ProxyCommand -ProxyJump -OpenSSH -Nginx -TrueNAS -markdownlint -UniBE