Files
dotfiles/nvim/init.lua
2025-08-24 22:33:05 -05:00

85 lines
1.9 KiB
Lua

-----------------------------
-- General Settings
-----------------------------
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.g.have_nerd_font = true
vim.opt.undofile = true
vim.opt.updatetime = 250
vim.opt.timeoutlen = 200
-- Sync clipboard between nvim and host
vim.schedule(function()
vim.opt.clipboard = 'unnamedplus'
end)
-----------------------------
-- Visual Settings
-----------------------------
vim.opt.cmdheight = 0
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.mouse = 'a'
vim.opt.showmode = false
vim.opt.cursorline = true
vim.opt.conceallevel = 2
vim.opt.scrolloff = 5
vim.opt.splitright = true
vim.opt.splitbelow = true
-----------------------------
-- Font & Text Settings
-----------------------------
vim.opt.spell = true
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.linebreak = true
vim.opt.breakindent = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.signcolumn = 'yes'
vim.opt.inccommand = 'split'
vim.opt.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
require 'config.keybinds'
-- Bootstrap lazy.nvim
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)
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "catppuccin-mocha" } },
-- automatically check for plugin updates
checker = { enabled = true },
})