59 lines
1.3 KiB
Lua
59 lines
1.3 KiB
Lua
local cmd = vim.cmd
|
|
local opt = vim.opt
|
|
local has = vim.fn.has
|
|
|
|
cmd('filetype plugin indent on')
|
|
cmd('syntax enable')
|
|
|
|
-- system
|
|
opt.encoding = 'utf-8'
|
|
opt.fileencoding = 'utf-8'
|
|
opt.fileencodings = {'utf-8'}
|
|
opt.backup = false -- no .bak
|
|
opt.swapfile = false -- no .swap
|
|
opt.undofile = true -- use undo file
|
|
opt.updatetime = 300 -- time (in ms) to write to swap file
|
|
-- buffer
|
|
opt.expandtab = true
|
|
opt.tabstop = 2
|
|
opt.softtabstop = 2
|
|
opt.autoindent = true
|
|
opt.shiftwidth = 2
|
|
-- window
|
|
opt.number = true
|
|
-- editing
|
|
vim.g.mapleader = ','
|
|
vim.g.maplocalleader = ','
|
|
opt.whichwrap = 'b,s,<,>,[,]'
|
|
opt.backspace = {'indent', 'eol', 'start'}
|
|
opt.list = true
|
|
opt.ignorecase = false
|
|
opt.hlsearch = true
|
|
opt.incsearch = false
|
|
opt.inccommand = 'nosplit'
|
|
opt.completeopt = {'menuone', 'noselect'}
|
|
opt.hidden = true
|
|
opt.cursorline = true
|
|
opt.ruler = true
|
|
opt.colorcolumn = {120}
|
|
opt.signcolumn = 'yes'
|
|
opt.mouse = 'nv'
|
|
cmd('set mousehide')
|
|
opt.showmatch = true
|
|
opt.cmdheight = 2
|
|
opt.wildmenu = true
|
|
opt.wildmode = {'longest', 'full'}
|
|
opt.splitright = true
|
|
opt.splitbelow = true
|
|
opt.shortmess:append('c')
|
|
|
|
if not has('gui_running') then
|
|
opt.t_Co = 256
|
|
end
|
|
|
|
opt.background = 'dark'
|
|
if has('termguicolors') then
|
|
cmd('let &t_8f = "\\<Esc>[38;2;%lu;%lu;%lum"')
|
|
cmd('let &t_8b = "\\<Esc>[48;2;%lu;%lu;%lum"')
|
|
opt.termguicolors = true
|
|
end
|