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

74 lines
1.6 KiB
Cheetah
Raw Permalink Normal View History

2024-01-14 23:03:03 +09:00
vim.cmd([[
try
if exists('+termguicolors')
set termguicolors
endif
colorscheme catppuccin
2024-01-14 23:03:03 +09:00
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
2024-03-06 16:47:02 +09:00
vim.opt.scrolloff = 12
2024-01-14 23:03:03 +09:00
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"
2024-03-24 19:51:22 +09:00
vim.opt.spell = true
2024-01-14 23:03:03 +09:00
2024-03-12 12:25:38 +09:00
if vim.fn.executable('rg') then
vim.opt.grepprg = 'rg --vimgrep --smart-case --hidden'
end
2024-01-14 23:03:03 +09:00
{{- 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 }}
2024-01-17 11:18:44 +09:00
{{- if (and (eq .hosttype "desktop" "laptop") (eq .chezmoi.os "linux")) }}
2024-01-14 23:03:03 +09:00
vim.cmd([[ autocmd InsertLeave * call system("fcitx5-remote -c") ]])
{{- end }}
vim.cmd("set clipboard+=unnamedplus")
-- folding
vim.opt.fillchars = { fold = " " }
vim.opt.foldmethod = "indent"
vim.opt.foldenable = false
vim.opt.foldlevel = 99
vim.g.markdown_folding = 1 -- enable markdown folding