-- Author: microfracture / https://linuxious.com/ -- Updated: 2026-06-07 local g = vim.g g.mapleader = " " -- Key used for custom key mappings g.maplocalleader = " " -- Same, but for certain file types/buffers local opt = vim.opt -- ============================================================================ -- Appearance -- ============================================================================ opt.termguicolors = true -- Enable true color support opt.background = "dark" -- Enable colors for dark backgrounds opt.number = true -- Always show line numbers opt.cursorline = true -- Highlight the line with the cursor opt.scrolloff = 4 -- Keep 4 lines above/below the cursor opt.textwidth = 80 -- Maximum text length before a new line opt.colorcolumn = "80" -- A visual guide for column 80 opt.laststatus = 3 -- Always show the statusline opt.signcolumn = "yes" -- Always show the sign column opt.splitbelow = true -- Horizontal split below the window opt.splitright = true -- Vertical split to the right of the window -- ============================================================================ -- Tabs and Folds -- ============================================================================ opt.expandtab = true -- Use spaces instead of tabs opt.autoindent = true -- Enable automatic indentation opt.smartindent = false -- Disable smart auto-indenting new lines opt.preserveindent = true -- Preserves indentation when pasting text opt.foldenable = true -- Enable folding opt.foldlevel = 99 -- All folds are open upon start opt.foldlevelstart = 99 -- All folds are open when opening a file -- ============================================================================ -- Clipboard and Undo -- ============================================================================ opt.clipboard = "unnamedplus" -- Use the system clipboard opt.undofile = true -- Enable persistent undo -- Set the undo directory to ~/.local/state/nvim/undo -- (or wherever your state directory is located) opt.undodir = vim.fn.stdpath("state") .. "/undo" -- ============================================================================ -- Load Plugins -- ============================================================================ --[[ Plugins: alpha-nvim: Greeter barbar: Tabline blink.cmp: A fast completion plugin friendly-snippets: Snippets collection for various languages fzf-lua: Integrates fzf / fuzzy finding into Nvim indent-blankline: Indentation guides nvim-colorizer: Color highlighter nvim-lualine: Statusline nvim-scrollview: Interactive vertical scrollbars nvim-tree: File explorer nvim-treesitter: Treesitter configurations nvim-web-devicons: Adds Nerd font icons. which-key: Shows available key binds within a popup Colorschemes: vague: A nice dark and low contrast colorscheme ]]-- vim.pack.add({ { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main", data = { run = function(_) vim.cmd "TSUpdate" end, }, }, { src = "https://github.com/saghen/blink.cmp", version = vim.version.range("1.*"), }, "https://github.com/goolord/alpha-nvim", "https://github.com/romgrk/barbar.nvim", "https://github.com/rafamadriz/friendly-snippets", "https://github.com/ibhagwan/fzf-lua", "https://github.com/lukas-reineke/indent-blankline.nvim", "https://github.com/catgoose/nvim-colorizer.lua", "https://github.com/nvim-lualine/lualine.nvim", "https://github.com/dstein64/nvim-scrollview", "https://github.com/nvim-tree/nvim-tree.lua", "https://github.com/folke/which-key.nvim", -- Dependencies "https://github.com/nvim-tree/nvim-web-devicons", -- Colorschemes "https://github.com/vague-theme/vague.nvim", }) -- ============================================================================ -- Configure Plugins -- ============================================================================ -- Enable the vague colorscheme vim.cmd.colorscheme("vague") -- No config needed. Just setup require("lualine").setup() require("colorizer").setup() -- alpha-nvim local status_ok, alpha = pcall(require, "alpha") if status_ok then local dashboard = require("alpha.themes.startify") alpha.setup(dashboard.config) end -- nvim-tree require("nvim-tree").setup({ sort = { sorter = "case_sensitive", }, view = { width = 30, }, renderer = { group_empty = true, }, filters = { dotfiles = true, }, }) -- blink.cmp require("blink.cmp").setup({ keymap = { preset = "super-tab", }, sources = { default = { "lsp", "path", "snippets", "buffer", }, }, }) -- treesitter vim.api.nvim_create_autocmd('FileType', { pattern = { "css", "html", "javascript", "json", "lua", "markdown", "python", "ruby", "scss", "xml", "yaml", }, callback = function() -- Enable highlighting vim.treesitter.start() -- Enable folding opt.foldmethod = "expr" opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" -- Enable experimental indentation vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end, })