2021-09-30 17:57:37 +00:00
|
|
|
local utils = require("utils")
|
2021-08-24 17:38:14 +00:00
|
|
|
|
2022-01-26 22:28:14 +00:00
|
|
|
-- Set backup on
|
2024-09-19 18:01:47 +00:00
|
|
|
vim.o.backup = true
|
|
|
|
vim.o.backupdir = table.concat({
|
2022-01-28 03:31:37 +00:00
|
|
|
(vim.env.XDG_DATA_HOME or "") .. "/nvim/backup//",
|
|
|
|
(vim.env.XDG_CONFIG_HOME or "") .. "/nvim/backup//",
|
2022-01-27 20:32:42 +00:00
|
|
|
"~/.config/nvim/backup//",
|
|
|
|
".",
|
|
|
|
}, ",")
|
2022-01-26 22:28:14 +00:00
|
|
|
|
2021-08-24 17:38:14 +00:00
|
|
|
-- Set leader to space
|
2024-09-19 18:01:47 +00:00
|
|
|
vim.g.mapleader = " "
|
2021-08-24 17:38:14 +00:00
|
|
|
|
2022-01-26 22:28:33 +00:00
|
|
|
-- Get terminal colors and unicode working, hopefully
|
2021-12-15 23:24:22 +00:00
|
|
|
vim.cmd([[
|
|
|
|
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
|
|
|
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
|
|
|
|
]])
|
2024-09-19 18:01:47 +00: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 23:11:02 +00:00
|
|
|
|
2021-09-30 17:57:37 +00:00
|
|
|
-- Autocomplete options
|
2024-09-19 18:01:47 +00:00
|
|
|
vim.o.completeopt = "menuone,noinsert,noselect,preview"
|
2024-05-29 20:16:28 +00:00
|
|
|
vim.api.nvim_create_autocmd({ "CompleteDone" }, {
|
|
|
|
pattern = "*",
|
|
|
|
command = "if pumvisible() == 0 | pclose | endif",
|
|
|
|
group = vim.api.nvim_create_augroup("close_preview", { clear = true }),
|
|
|
|
})
|
2021-09-30 17:57:37 +00:00
|
|
|
|
2021-08-24 17:38:14 +00:00
|
|
|
local has = vim.fn.has
|
2024-09-19 18:01:47 +00: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 18:55:58 +00:00
|
|
|
vim.g.is_gui = (vim.g.neovide or has("gui_macvim"))
|
2024-05-29 19:04:26 +00:00
|
|
|
|
|
|
|
-- Require some local values
|
|
|
|
utils.require_with_local("variables")
|