commit 725137fca29e56769e30599ec442ef418ac3a59f Author: Job79 Date: Thu Jan 2 15:14:07 2025 +0100 feat: add nvim config diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc5457a --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..2514f9e --- /dev/null +++ b/init.lua @@ -0,0 +1,2 @@ +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..6e2480a --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,43 @@ +{ + "LazyVim": { "branch": "main", "commit": "d0c366e4d861b848bdc710696d5311dca2c6d540" }, + "blink-cmp-copilot": { "branch": "main", "commit": "c5c5cbce5748d21073f1d5348a92ebe6ce63f387" }, + "blink.cmp": { "branch": "main", "commit": "d534f9e8bf39299c480e0c2e11dad21f51cfb2fe" }, + "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, + "conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" }, + "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "fzf-lua": { "branch": "main", "commit": "b622a443ecfb40b54ec6c0114c31eed5b9b10b53" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "gruvbox-material": { "branch": "master", "commit": "055aefde5fd49018f3a858bca7b529bc2e08c02b" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" }, + "mini.icons": { "branch": "main", "commit": "6787321f70d674a481776b7cc2c781fb7002c644" }, + "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, + "neo-tree.nvim": { "branch": "main", "commit": "2a0b2c5d394a280cee9444c9894582ac53098604" }, + "neotest": { "branch": "master", "commit": "0dccb5ebcf00de245e2060fa17822a9464f5c41a" }, + "neotest-golang": { "branch": "main", "commit": "ee3f462da0d94690383c3e06c2ba27bd3bee7820" }, + "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "nvim-dap": { "branch": "master", "commit": "0e673accbb512e1e191dfb4fecea89cc38c1bcdd" }, + "nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" }, + "nvim-dap-ui": { "branch": "master", "commit": "e94d98649dccb6a3884b66aabc2e07beb279e535" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, + "nvim-lint": { "branch": "master", "commit": "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55" }, + "nvim-lspconfig": { "branch": "master", "commit": "88dff6268a068403c87b461aee69beb61ceb8303" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-treesitter": { "branch": "master", "commit": "fc687f38d4ea9a7399707a5a2d57297c2ac17323" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "rose-pine": { "branch": "main", "commit": "91548dca53b36dbb9d36c10f114385f759731be1" }, + "snacks.nvim": { "branch": "main", "commit": "d312053f78b4fb55523def179ac502438dd93193" }, + "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, + "ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" }, + "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } +} diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 0000000..1c60411 --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,15 @@ +{ + "extras": [ + "lazyvim.plugins.extras.ai.copilot", + "lazyvim.plugins.extras.dap.core", + "lazyvim.plugins.extras.lang.go", + "lazyvim.plugins.extras.lang.svelte", + "lazyvim.plugins.extras.lang.tailwind", + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.test.core" + ], + "news": { + "NEWS.md": "10960" + }, + "version": 7 +} diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..eb43eda --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,16 @@ +-- Configure custom keymaps. +local keymap = vim.keymap.set +local delkeymap = vim.keymap.del +local opts = { noremap = true, silent = true } + +-- Improved line start/end +keymap({ "n", "v" }, "H", "^", opts) +keymap({ "n", "v" }, "L", "$", opts) + +-- Improved escape +keymap("n", "", ":noh", opts) +keymap("t", "", "", opts) + +-- Disable alt j/k to move lines (conflict with default vim motions) +delkeymap({ "i", "v" }, "") +delkeymap({ "i", "v" }, "") diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..ede6149 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,43 @@ +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 = { + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + { import = "plugins" }, + }, + defaults = { + lazy = false, + version = false, + }, + install = {}, + checker = { + enabled = true, + notify = true, + }, + performance = { + rtp = { + disabled_plugins = { + "gzip", + "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..ffe07c0 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,15 @@ +-- Set some custom options. +local opt = vim.o +local global = vim.g + +-- Set target text width for gww to 60. +opt.tw = 60 + +-- Use the internal clipboard. +opt.clipboard = "" + +-- Use original gruvbox theme. +global.gruvbox_material_foreground = "original" + +-- Disable snack animations. +global.snacks_animate = false diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..414dfc4 --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,9 @@ +-- Configure rose-pine and gruvbox-material colorschemes. +return { + { "rose-pine/neovim", name = "rose-pine" }, + { "sainnhe/gruvbox-material" }, + { + "LazyVim/LazyVim", + opts = { colorscheme = "rose-pine-dawn" }, + }, +} diff --git a/lua/plugins/disabled.lua b/lua/plugins/disabled.lua new file mode 100644 index 0000000..999edb1 --- /dev/null +++ b/lua/plugins/disabled.lua @@ -0,0 +1,25 @@ +-- Disable unused plugins and functionality. +return { + { + -- Disable the dashboard. + "folke/snacks.nvim", + opts = { + dashboard = { enabled = false }, + notifier = { level = vim.log.levels.WARN }, + }, + }, + { + -- Disable inline hints by default. + "neovim/nvim-lspconfig", + opts = { + inlay_hints = { enabled = false }, + }, + }, + + -- Disable unused plugins. + { "folke/flash.nvim", enabled = false }, + { "folke/todo-comments.nvim", enabled = false }, + { "folke/trouble.nvim", enabled = false }, + { "MagicDuck/grug-far.nvim", enabled = false }, + { "akinsho/bufferline.nvim", enabled = false }, +}