diff options
| author | Max Bossing <info@maxbossing.de> | 2025-08-12 15:47:14 +0200 | 
|---|---|---|
| committer | Max Bossing <info@maxbossing.de> | 2025-08-12 15:47:14 +0200 | 
| commit | 991c272423d8fa41c9dd21169ce0c3e9979f1c64 (patch) | |
| tree | b4343fb3035989a6bfcafcb02e7db91e91a39785 /nvim/lua/config | |
| parent | 7c8d9ae3b0b5e843ffe10fad81e776806c0c5a8b (diff) | |
feat: finally a usable neovim config (switched to LazyVim)
Diffstat (limited to 'nvim/lua/config')
| -rw-r--r-- | nvim/lua/config/autocmds.lua | 8 | ||||
| -rw-r--r-- | nvim/lua/config/keymaps.lua | 7 | ||||
| -rw-r--r-- | nvim/lua/config/lazy.lua | 53 | ||||
| -rw-r--r-- | nvim/lua/config/options.lua | 7 | 
4 files changed, 75 insertions, 0 deletions
| diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..4221e75 --- /dev/null +++ b/nvim/lua/config/autocmds.lua @@ -0,0 +1,8 @@ +-- 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 +-- with `vim.api.nvim_create_autocmd` +-- +-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) +-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..8450d44 --- /dev/null +++ b/nvim/lua/config/keymaps.lua @@ -0,0 +1,7 @@ +-- 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 + +-- move code in visual line mode +vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") +vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..d73bfa1 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,53 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +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(lazypath) + +require("lazy").setup({ +  spec = { +    -- add LazyVim and import its plugins +    { "LazyVim/LazyVim", import = "lazyvim.plugins" }, +    -- import/override with your plugins +    { import = "plugins" }, +  }, +  defaults = { +    -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. +    -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. +    lazy = false, +    -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, +    -- have outdated releases, which may break your Neovim install. +    version = false, -- always use the latest git commit +    -- version = "*", -- try installing the latest stable version for plugins that support semver +  }, +  install = { colorscheme = { "tokyonight", "habamax" } }, +  checker = { +    enabled = true, -- check for plugin updates periodically +    notify = false, -- notify on update +  }, -- automatically check for plugin updates +  performance = { +    rtp = { +      -- disable some rtp plugins +      disabled_plugins = { +        "gzip", +        -- "matchit", +        -- "matchparen", +        -- "netrwPlugin", +        "tarPlugin", +        "tohtml", +        "tutor", +        "zipPlugin", +      }, +    }, +  }, +}) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua new file mode 100644 index 0000000..98dddd5 --- /dev/null +++ b/nvim/lua/config/options.lua @@ -0,0 +1,7 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.smarttab = true +vim.opt.expandtab = true | 
