neovim-config/lua/macbook/settings.lua

60 lines
1.4 KiB
Lua

local g = vim.g
local opt = vim.opt
local cmd = vim.cmd
local o = vim.o
-- common settings
-- enable color support
o.termguicolors = true
-- Number of screen lines to keep above and below the cursor
o.scrolloff = 8
-- Better editor UI
o.number = true -- show line number
o.numberwidth = 2
o.relativenumber = true
o.signcolumn = 'auto'
o.cursorline = true -- highlight entire cursor line, increases readability
-- Better editing experience
o.expandtab = true
o.smarttab = true
o.cindent = true
o.autoindent = true
o.wrap = true
o.textwidth = 300
o.tabstop = 4
o.shiftwidth = 4
o.softtabstop = -1 -- if negative, shiftwidth value is used
o.list = false -- show tabs and spaces as different signifiers, sane to keep it as off as it clutters the UI otherwise
o.listchars = 'trail:·,nbsp:◇,tab:→ ,extends:▸,precedes:◂' -- list of chars to show if o.list is set to true
-- Makes neovim and host OS clipboard play nicely with each other
o.clipboard = 'unnamedplus'
-- Case insensitive searching unless /C or capital in search
o.ignorecase = true
o.smartcase = true
-- Undo and backup options
o.backup = false
o.writebackup = false
o.undofile = true
o.swapfile = false
-- Remember 50 items in commandline history
o.history = 50
-- Better buffer splitting
o.splitright = true
o.splitbelow = true
-- Preserve view while jumpting [TODO] Figure out what these jumpoptions mean
o.jumpoptions = 'view'
-- Map <leader> to space
g.mapleader = ' '
g.maplocalleader = ' '