vim-settings/neovim/lua/_settings.lua

46 lines
1.0 KiB
Lua
Raw Normal View History

2021-08-24 17:38:14 +00:00
local o = vim.o
local g = vim.g
local utils = require("utils")
2021-08-24 17:38:14 +00:00
2022-01-26 22:28:14 +00:00
-- Set backup on
o.backup = true
2022-01-27 20:32:42 +00:00
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
g.mapleader = " "
2022-01-26 22:28:33 +00: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"
]])
2021-08-24 17:38:14 +00:00
o.termguicolors = true
2022-01-26 22:28:33 +00:00
-- o.term = "xterm-256color"
2021-08-24 17:38:14 +00:00
o.number = true
o.expandtab = true
o.tabstop = 4
o.softtabstop = 4
o.shiftwidth = 4
o.virtualedit = "onemore"
o.scrolljump = 5
o.scrolloff = 3
-- o.backspace = "2"
2021-08-24 23:11:02 +00:00
-- o.mousehide = true
o.mouse = "a"
-- Autocomplete options
o.completeopt = "menuone,noinsert,noselect,preview"
utils.augroup("close_preview", function()
vim.cmd("autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif")
end)
2021-08-24 17:38:14 +00:00
local has = vim.fn.has
g.is_mac = (has("mac") or has("macunix") or has("gui_macvim") or vim.fn.system("uname"):find("^darwin") ~= nil)