dotfiles/dot_config/nvim/lua/core/options.lua.tmpl

67 lines
1.5 KiB
Cheetah
Raw Normal View History

2024-01-14 23:03:03 +09:00
{{- if (or (eq .chezmoi.hostname "arch") (eq .chezmoi.hostname "buzz")) }}
if (vim.g.neovide) then
vim.g.neovide_scale_factor = 0.7
vim.g.neovide_cursor_animation_length = 0
end
{{- end }}
vim.cmd([[
try
if exists('+termguicolors')
set termguicolors
endif
colorscheme yah
catch
colorscheme desert
endtry
]])
vim.g.mapleader = " "
vim.opt.incsearch = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.cmd(":filetype plugin indent on")
vim.cmd(":syntax enable")
vim.opt.backspace = "indent,eol,start"
vim.opt.smarttab = true
vim.opt.ruler = true
vim.opt.wildmenu = true
vim.opt.gdefault = true vim.opt.autoread = true vim.opt.history = 1000
vim.opt.encoding = "utf-8"
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.laststatus = 2
vim.opt.showcmd = true
vim.opt.showmatch = true
vim.opt.cmdheight = 3
vim.opt.list = true
vim.opt.listchars = "tab:>>,trail:_,eol:$,multispace:··,extends:>,precedes:<,nbsp:%"
vim.opt.encoding = "utf-8"
vim.opt.fenc = "utf-8"
{{- if eq .chezmoi.username "root" }}
vim.opt.expandtab = false
{{- else }}
vim.opt.expandtab = true
{{- end }}
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
-- abbreviations
vim.cmd(":ca cd. lcd %:p:h")
vim.cmd(':ca mkdir. call mkdir(expand("%:p:h"), "p")')
{{- if ne .chezmoi.username "root" }}
vim.cmd(':ca W! w !sudo -A tee %')
{{- end }}
{{- if (or (eq .chezmoi.hostname "arch") (eq .chezmoi.hostname "buzz")) }}
vim.cmd([[ autocmd InsertLeave * call system("fcitx5-remote -c") ]])
{{- end }}
vim.cmd("set clipboard+=unnamedplus")