diff options
| author | schererleander <leander@schererleander.de> | 2025-11-15 22:23:50 +0100 |
|---|---|---|
| committer | schererleander <leander@schererleander.de> | 2025-11-15 22:23:50 +0100 |
| commit | 4a8f0841025f2eeb05809964c64a81c0bb399685 (patch) | |
| tree | d40fa870d3885c8552aa890b1867d2eda36324a8 /nvim/lua | |
| parent | 836d2e2778fcd685d67997df783111bdeec9bbeb (diff) | |
use vim.pack and simplify configuration
Diffstat (limited to 'nvim/lua')
| -rw-r--r-- | nvim/lua/autocmds.lua | 8 | ||||
| -rw-r--r-- | nvim/lua/keymaps.lua | 0 | ||||
| -rw-r--r-- | nvim/lua/options.lua | 45 | ||||
| -rw-r--r-- | nvim/lua/plugins.lua | 343 |
4 files changed, 0 insertions, 396 deletions
diff --git a/nvim/lua/autocmds.lua b/nvim/lua/autocmds.lua deleted file mode 100644 index f7e6923..0000000 --- a/nvim/lua/autocmds.lua +++ /dev/null @@ -1,8 +0,0 @@ -vim.cmd('highlight WinSeparator guibg=None ctermbg=None') -vim.cmd('highlight VertSplit guibg=NONE ctermbg=NONE') --- hide background lsp coloum -vim.cmd('highlight SignColumn guibg=NONE ctermbg=None') - --- transparent background -vim.cmd('highlight Normal guibg=NONE ctermbg=NONE') -vim.cmd('highlight NormalNC guibg=NONE ctermbg=NONE') diff --git a/nvim/lua/keymaps.lua b/nvim/lua/keymaps.lua deleted file mode 100644 index e69de29..0000000 --- a/nvim/lua/keymaps.lua +++ /dev/null diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua deleted file mode 100644 index 891668f..0000000 --- a/nvim/lua/options.lua +++ /dev/null @@ -1,45 +0,0 @@ -local options = { - list = false, - backup = false, -- creates a backup file - clipboard = "unnamedplus", -- allows neovim to access the system clipboard - conceallevel = 2, -- so that `` is visible in markdown files - fileencoding = "utf-8", -- the encoding written to a file - hidden = true, -- required to keep multiple buffers and open multiple buffers - hlsearch = true, -- highlight all matches on previous search pattern - ignorecase = true, -- ignore case in search patterns - mouse = "a", -- allow the mouse to be used in neovim - laststatus = 3, - showmode = false, -- we don't need to see things like -- INSERT -- anymore - smartcase = true, -- smart case - smartindent = true, -- make indenting smarter again - splitbelow = true, -- force all horizontal splits to go below current window ↕️ - splitright = true, -- force all vertical splits to go to the right of current window ↔️ - swapfile = false, -- creates a swapfile - termguicolors = true, -- set term gui colors (most terminals support this) - timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds) - undofile = true, -- enable persistent undo - updatetime = 300, -- faster completion (4000ms default) ⚡ - writebackup = false, -- if a file is being edited by another program, it is not allowed to be edited - expandtab = true, -- use tabs instead of spaces ␣ - pumheight = 10, - cmdheight = 2, - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab ⇥ - cursorline = false, -- highlight the current line (disabled for now) - number = false, -- set numbered lines - relativenumber = false, -- set relative numbered lines - numberwidth = 4, -- set number column width to 2 (default 4) - wrap = false, -- display lines as one long lines -} - -vim.opt.shortmess:append 'c' - -for k, v in pairs(options) do - vim.opt[k] = v -end - -vim.wo.list = false -vim.cmd 'set whichwrap+=<,>,[,],h,l' - --- lazy load -vim.loader.enable() diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua deleted file mode 100644 index ff8c9a8..0000000 --- a/nvim/lua/plugins.lua +++ /dev/null @@ -1,343 +0,0 @@ -require("lazy").setup({ - { - "ellisonleao/gruvbox.nvim", - priority = 1000, - config = function () - require("gruvbox").setup({}) - vim.cmd("colorscheme gruvbox") - end - }, - - { - "hrsh7th/nvim-cmp", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "neovim/nvim-lspconfig", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "L3MON4D3/LuaSnip", - "onsails/lspkind-nvim" - }, - config = function() - require("mason").setup() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "java_language_server", "pyright", "tailwindcss", "clangd" }, - automatic_installation = true, - }) - - local signs = { - Error = " ", - Warn = " ", - Hint = " ", - Info = " ", - } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) - end - - local capabilities = require("cmp_nvim_lsp").default_capabilities() - - local on_attach = function(client, bufnr) - local opts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) - vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) - vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts) - vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts) - vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts) - vim.keymap.set("n", "<leader>wl", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, opts) - vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, opts) - vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) - vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts) - vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) - vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts) - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) - vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) - vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, opts) - end - - local lspconfig = require("lspconfig") - - lspconfig.lua_ls.setup({ - capabilities = capabilities, - on_attach = on_attach, - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - }, - telemetry = { - enable = false, - }, - }, - }, - }) - - lspconfig.jdtls.setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - lspconfig.pyright.setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - lspconfig.tailwindcss.setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - lspconfig.clangd.setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - local cmp = require("cmp") - local luasnip = require("luasnip") - local lspkind = require("lspkind") - require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - ["<C-d>"] = cmp.mapping.scroll_docs(-4), - ["<C-f>"] = cmp.mapping.scroll_docs(4), - ["<C-Space>"] = cmp.mapping.complete(), - ["<C-e>"] = cmp.mapping.close(), - ["<CR>"] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - ["<Tab>"] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - ["<S-Tab>"] = 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" }), - }), - formatting = { - format = lspkind.cmp_format({ - mode = "symbol_text", - maxwidth = 50, - ellipsis_char = "..." - }), - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - }) - - cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'buffer' }, - }) - }) - - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }) - end, - }, - - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = "BufRead", - config = function() - require("nvim-treesitter.configs").setup({ - auto_install = true, - ensure_installed = { "c", "lua", "vim", "python", "java", "javascript", "typescript", "css", "html" }, - highlight = { enable = true, use_languagetree = true }, - indent = { enable = true }, - }) - end, - }, - - { - "nvim-tree/nvim-tree.lua", - enabled = false, - config = function() - require("nvim-tree").setup({ - view = { width = 20, side = "left" }, - disable_netrw = true, - hijack_cursor = true, - update_cwd = true, - hijack_directories = { auto_open = true }, - renderer = { - root_folder_label = false, - indent_markers = { - enable = true, - icons = { corner = "└ ", edge = "│ ", none = " " }, - }, - }, - }) - end, - }, - - { - "nvim-telescope/telescope.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - keys = { - { "<C-s>", ":silent Telescope current_buffer_fuzzy_find<CR>", desc = "Open Telescope" }, - }, - config = function() - require("telescope").setup({ - defaults = { mapping = {} }, - pickers = {}, - extensions = {}, - }) - end, - }, - - { - "akinsho/toggleterm.nvim", - version = "*", - config = true, - }, - - { - "lewis6991/gitsigns.nvim", - config = function() - require("gitsigns").setup() - end, - }, - - { - "mfussenegger/nvim-lint", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local lint = require("lint") - - lint.linters_by_ft = { - lua = { "luacheck" }, - python = { "pylint" }, - } - - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - - vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { - group = lint_augroup, - callback = function() - lint.try_lint() - end, - }) - end, - }, - - { - "echasnovski/mini.nvim", - version = false, - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("mini.starter").setup({ - header = table.concat({ - " /l、 ", - "(゚、 。 7 ", - " l ~ ヽ ", - " じしf_,)ノ ", - }, "\n"), - footer = "", - content_hooks = { - require("mini.starter").gen_hook.adding_bullet("» "), - require("mini.starter").gen_hook.aligning("center", "center"), - }, - }) - end, - }, - - { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = function() - require("nvim-autopairs").setup {} - end, - }, - - { - "tamton-aquib/staline.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("staline").setup { - sections = { - left = { 'file_name', 'branch' }, - mid = { 'lsp' }, - right = { 'line_column' }, - }, - special_table = { - NvimTree = { 'NvimTree', ' ' }, - packer = { 'Packer', ' ' }, - starter = { '', '' }, - lazy = { '', '' }, - mason = { '', '' }, - }, - lsp_symbols = { - Error = " ", - Info = " ", - Warn = " ", - Hint = "", - }, - defaults = { - true_colors = true, - line_column = ' ☰ %l/%L %c', - branch_symbol = " ", - exclude_fts = { 'NvimTree' }, - }, - } - vim.cmd('highlight Statusline guibg=none') - vim.cmd('highlight StatuslineNC guibg=none') - end, - }, - - { - "epwalsh/obsidian.nvim", - enabled = false, - version = "*", - lazy = true, - ft = "markdown", - dependencies = { - "nvim-lua/plenary.nvim", - }, - opts = { - workspaces = { - { - name = "Vaut", - path = "~/Vault/", - }, - }, - }, - }, -}) |
