Last active
January 4, 2026 07:25
-
-
Save aelobdog/b78be4fbacd26d3de5411eb9636afc37 to your computer and use it in GitHub Desktop.
latest vim configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- ------------------------------ | |
| -- alobdog's neovim configuration | |
| -- ------------------------------ | |
| 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) | |
| -- ------------------------------ | |
| vim.g.mapleader = " " | |
| vim.g.maplocalleader = "\\" | |
| vim.o.termguicolors = true | |
| vim.o.tabstop = 4 | |
| vim.o.softtabstop = 4 | |
| vim.o.shiftwidth = 4 | |
| vim.o.expandtab = true | |
| vim.o.smartindent = true | |
| vim.o.autoindent = true | |
| vim.o.scrolloff = 8 | |
| vim.o.wrap = false | |
| vim.o.number = true | |
| vim.o.relativenumber = true | |
| vim.o.cursorline = true | |
| vim.o.signcolumn = "yes" | |
| -- ------------------------------ | |
| require("lazy").setup({ | |
| spec = { | |
| { | |
| "https://github.com/aelobdog/lodo", | |
| lazy = false, | |
| priority = 1000, | |
| config = function() | |
| vim.cmd([[colorscheme lodo]]) | |
| end, | |
| }, | |
| { "https://github.com/neovim/nvim-lspconfig" }, | |
| { "https://github.com/mason-org/mason.nvim" }, | |
| { "https://github.com/mason-org/mason-lspconfig.nvim" }, | |
| { "https://github.com/nvim-mini/mini.completion", version = "*" }, | |
| }, | |
| install = { colorscheme = { "lodo" } }, | |
| checker = { enabled = true }, | |
| }) | |
| require("mason").setup() | |
| require("mason-lspconfig").setup({ | |
| ensure_installed = {"lua_ls", "clangd"} | |
| }) | |
| require("mini.completion").setup() | |
| -- ------------------------------ | |
| local servers = { | |
| lua_ls = { settings = { Lua = { diagnostics = { globals = { "vim" }, }, }, }, }, | |
| clangd = {}, | |
| } | |
| for server, config in pairs(servers) do | |
| vim.lsp.config(server, config) | |
| vim.lsp.enable(server) | |
| end | |
| -- ------------------------------ | |
| vim.diagnostic.config({ | |
| virtual_text = true, | |
| }) | |
| -- ------------------------------- | |
| vim.keymap.set("n", "<C-h>", "<C-w>h", { desc = "Move to left window" }) | |
| vim.keymap.set("n", "<C-j>", "<C-w>j", { desc = "Move to lower window" }) | |
| vim.keymap.set("n", "<C-k>", "<C-w>k", { desc = "Move to upper window" }) | |
| vim.keymap.set("n", "<C-l>", "<C-w>l", { desc = "Move to right window" }) | |
| vim.keymap.set("n", "<C-s>", ":w<CR>", { desc = "Save File" }) | |
| vim.keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode" }) | |
| vim.keymap.set("n", "<leader>r", ":vsplit<CR><C-w>l", { desc = "Open a (V)Split" }) | |
| vim.keymap.set("n", "<leader>t", ":split<CR><C-w>j", { desc = "Open a (H)Split" }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment