dotconf/private_dot_config/private_nvim/private_init.lua

66 lines
1.9 KiB
Lua
Raw Normal View History

2026-01-29 22:53:35 -06:00
-- 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)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
2026-01-31 17:43:09 -06:00
vim.opt.hlsearch = false
vim.opt.whichwrap:append("<,>,h,l")
vim.opt.listchars = 'tab:┆-,trail:~,extends:>,precedes:<,nbsp:•'
vim.opt.list = true
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = 2
vim.opt.splitbelow = true
vim.opt.splitright = true
function tblmerge(x, y) for k,v in pairs(y) do x[k] = v end return x end
local function map(mode, lhs, rhs, opts) vim.api.nvim_set_keymap(mode, lhs, rhs, tblmerge({ noremap = true, silent = true}, opts or {})) end
function nmap(l, r, opt) map('n', l, r, opt) end
function imap(l, r, opt) map('i', l, r, opt) end
function vmap(l, r, opt) map('v', l, r, opt) end
-- Treat long lines as broken lines so you can move in them
nmap('j', 'gj')
nmap('k', 'gk')
-- maintain visual selection when changing indentation
vmap('<', '<gv')
vmap('>', '>gv')
nmap("<Leader>w", ":w<CR>")
nmap("<Leader>tn", ":tabnew<CR>")
nmap('<Leader>te', ':tabedit <c-r>=expand("%:p:h")<cr>/<cr>')
2026-01-29 22:53:35 -06:00
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{ import = "plugins" },
},
install = { colorscheme = { "habamax" } },
checker = { enabled = false },
})