59 lines
1.8 KiB
Lua
59 lines
1.8 KiB
Lua
local vim = _G["vim"]
|
|
|
|
vim.g.loaded_netrw = 1
|
|
vim.g.loaded_netrwPlugin = 1
|
|
|
|
vim.g.mapleader = ","
|
|
vim.g.maplocalleader = ",,"
|
|
|
|
vim.opt.encoding = "utf-8"
|
|
vim.opt.nu = true
|
|
vim.opt.relativenumber = true
|
|
vim.opt.expandtab = false
|
|
vim.opt.numberwidth = 1
|
|
vim.opt.tabstop = 4
|
|
vim.opt.shiftwidth = 4
|
|
vim.opt.termguicolors = true
|
|
vim.opt.splitbelow = true
|
|
vim.opt.splitright = true
|
|
vim.opt.confirm = true
|
|
vim.opt.ignorecase = true
|
|
vim.opt.smartcase = true
|
|
vim.opt.listchars = "tab:│ "
|
|
vim.opt.list = true
|
|
vim.opt.undofile = true
|
|
vim.opt.undodir = os.getenv("HOME").."/.local/nvim/undo"
|
|
vim.opt.hidden = true
|
|
-- vim.opt.formatoptions-=cro
|
|
vim.opt.foldmethod = "indent"
|
|
vim.opt.foldlevelstart = 20
|
|
vim.opt.swapfile = false
|
|
-- vim.opt.omnifunc=syntaxcomplete#Complete
|
|
-- vim.opt.completeopt+=preview
|
|
vim.opt.cmdheight = 2
|
|
vim.opt.updatetime = 300
|
|
vim.opt.mouse = ""
|
|
vim.opt.showtabline = 2
|
|
|
|
vim.opt.viminfo:append("f1")
|
|
|
|
vim.cmd([[
|
|
autocmd BufRead,BufNewFile * if &filetype !=# 'TelescopePrompt' && &filetype !=# 'TelescopeResults' | set autoindent noexpandtab tabstop=4 shiftwidth=4
|
|
|
|
augroup remember_folds
|
|
autocmd!
|
|
autocmd BufWinLeave * if &filetype !=# 'TelescopePrompt' && &filetype !=# 'TelescopeResults' && bufname('%') != '' | mkview
|
|
autocmd BufWinEnter * if &filetype !=# 'TelescopePrompt' && &filetype !=# 'TelescopeResults' && bufname('%') != '' | silent! loadview
|
|
augroup END
|
|
]])
|
|
|
|
-- vim.api.nvim_create_augroup("CaddyFileType", { clear = true })
|
|
-- vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
|
|
-- pattern = "/etc/caddy/conf.d/*",
|
|
-- callback = function()
|
|
-- vim.opt_local.filetype = "caddyfile"
|
|
-- end,
|
|
-- group = "CaddyFileType",
|
|
-- })
|
|
|
|
|