vim-settings/neovim/lua/default_settings.lua

50 lines
1.3 KiB
Lua
Raw Normal View History

local utils = require("utils")
2021-08-24 10:38:14 -07:00
2022-01-26 14:28:14 -08:00
-- Set backup on
2024-09-19 11:01:47 -07:00
vim.o.backup = true
vim.o.backupdir = table.concat({
2022-01-27 19:31:37 -08:00
(vim.env.XDG_DATA_HOME or "") .. "/nvim/backup//",
(vim.env.XDG_CONFIG_HOME or "") .. "/nvim/backup//",
2022-01-27 12:32:42 -08:00
"~/.config/nvim/backup//",
".",
}, ",")
2022-01-26 14:28:14 -08:00
2021-08-24 10:38:14 -07:00
-- Set leader to space
2024-09-19 11:01:47 -07:00
vim.g.mapleader = " "
2021-08-24 10:38:14 -07:00
2022-01-26 14:28:33 -08:00
-- Get terminal colors and unicode working, hopefully
vim.cmd([[
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
]])
2024-09-19 11:01:47 -07:00
vim.o.termguicolors = true
-- vim.o.term = "xterm-256color"
vim.o.number = true
vim.o.expandtab = true
vim.o.tabstop = 4
vim.o.softtabstop = 4
vim.o.shiftwidth = 4
vim.o.virtualedit = "onemore"
vim.o.scrolljump = 5
vim.o.scrolloff = 3
-- vim.o.backspace = "2"
-- vim.o.mousehide = true
vim.o.mouse = "a"
2021-08-24 16:11:02 -07:00
-- Autocomplete options
2024-09-19 11:01:47 -07:00
vim.o.completeopt = "menuone,noinsert,noselect,preview"
vim.api.nvim_create_autocmd({ "CompleteDone" }, {
pattern = "*",
command = "if pumvisible() == 0 | pclose | endif",
group = vim.api.nvim_create_augroup("close_preview", { clear = true }),
})
2021-08-24 10:38:14 -07:00
local has = vim.fn.has
2024-09-19 11:01:47 -07:00
vim.g.is_mac = (has("mac") or has("macunix") or has("gui_macvim") or vim.fn.system("uname"):find("^darwin") ~= nil)
2024-09-19 11:55:58 -07:00
vim.g.is_gui = (vim.g.neovide or has("gui_macvim"))
-- Require some local values
utils.require_with_local("variables")