add nvim config
This commit is contained in:
parent
83844b5812
commit
0e5c113b48
9 changed files with 208 additions and 0 deletions
59
dot_config/nvim/lua/options.lua
Normal file
59
dot_config/nvim/lua/options.lua
Normal file
|
@ -0,0 +1,59 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue