Files
nix/users/blake/dotfiles/nvim/lua.old/base/base.lua
2025-10-10 02:06:54 -05:00

65 lines
1.3 KiB
Lua

-- blake's nvim config in lua
-- base.base
-- general nvim settings
-- define functions for settings
local g = vim.g
local o = vim.o
local opt = vim.opt
-- clipboard
o.clipboard = "unnamedplus"
-- enable filetype detection
vim.cmd('filetype indent plugin on')
vim.cmd('syntax on')
-- o.nocompatible = true
-- line numbers
o.number = true
o.numberwidth = 2
o.relativenumber = true
vim.cmd('highlight LineNr ctermfg=054')
-- tabs
o.tabstop = 2
o.shiftwidth = 2
o.softtabstop = -1 -- if negative uses shift width
o.expandtab = true
o.smarttab = true
o.autoindent = true
-- improve search
o.ignorecase = true
o.smartcase = true
-- backup files
o.backup = false
o.writebackup = false
o.undofile = true
o.swapfile = true
-- auto-read file changes
o.autoread = true
-- spell checker
o.spelllang = 'en_us'
o.spell = false
-- word wrapping
o.wrap = true
o.linebreak = true
o.breakindent = true
-- visual line movement
vim.keymap.set({'i'}, '<Up>', '<C-o>gk', {desc = 'Visual Line Up (Insert)'})
vim.keymap.set({'i'}, '<Down>', '<C-o>gj', {desc = 'Visual Line Down (Insert)'})
vim.keymap.set({'n', 'v'}, '<Up>', 'g<Up>', {desc = 'Visual Line Up'})
vim.keymap.set({'n', 'v'}, '<Down>', 'g<Down>', {desc = 'Visual Line Down'})
-- set leader
g.mapleader = " "
g.maplocalleader = " "