2021-11-25 22:10:31 +01:00
|
|
|
local utils = require('utils')
|
|
|
|
local indent = 4
|
|
|
|
|
2023-07-30 04:26:25 +02:00
|
|
|
vim.cmd 'syntax enable'
|
|
|
|
vim.cmd 'filetype plugin indent on'
|
|
|
|
--
|
|
|
|
-- Highlight on yank
|
|
|
|
vim.cmd 'au TextYankPost * lua vim.highlight.on_yank {on_visual = false}'
|
|
|
|
|
2021-11-25 22:10:31 +01:00
|
|
|
utils.opt('b', 'expandtab', true)
|
|
|
|
utils.opt('b', 'shiftwidth', indent)
|
|
|
|
utils.opt('b', 'tabstop', indent)
|
2023-07-30 04:26:25 +02:00
|
|
|
utils.opt('b', 'softtabstop', indent)
|
|
|
|
utils.opt('b', 'smartindent', true)
|
2021-11-25 22:10:31 +01:00
|
|
|
utils.opt('o', 'hidden', true)
|
|
|
|
utils.opt('o', 'ignorecase', true)
|
2024-04-18 14:45:57 +02:00
|
|
|
utils.opt('o', 'scrolloff', 4)
|
2021-11-25 22:10:31 +01:00
|
|
|
utils.opt('o', 'shiftround', true)
|
|
|
|
utils.opt('o', 'smartcase', true)
|
|
|
|
utils.opt('o', 'splitbelow', true)
|
|
|
|
utils.opt('o', 'splitright', true)
|
|
|
|
utils.opt('o', 'wildmode', 'list:longest')
|
|
|
|
utils.opt('w', 'number', true)
|
2024-04-18 14:45:57 +02:00
|
|
|
utils.opt('o', 'clipboard', 'unnamed,unnamedplus')
|
2024-07-22 09:08:34 +02:00
|
|
|
utils.opt('o', 'mouse', 'a')
|
2021-11-25 22:10:31 +01:00
|
|
|
|
2024-03-20 12:49:43 +01:00
|
|
|
vim.opt.autoindent = false
|
|
|
|
vim.opt.smartindent = false
|
2023-07-30 04:26:25 +02:00
|
|
|
vim.opt.background = 'light'
|
|
|
|
vim.opt.errorformat:prepend('%f|%l col %c|%m')
|
|
|
|
vim.opt.fileformat = 'unix'
|
|
|
|
vim.opt.undofile = true
|
2023-09-26 02:25:19 +02:00
|
|
|
|
2023-07-30 04:26:25 +02:00
|
|
|
-- Enable vimrc files per project and disable unsafe commands in project vimrc
|
|
|
|
vim.opt.exrc = true
|
|
|
|
vim.opt.secure = true
|
2024-03-20 12:49:43 +01:00
|
|
|
|
|
|
|
-- unknown filetypes mappings
|
|
|
|
vim.cmd([[
|
|
|
|
autocmd BufRead,BufNewFile *.bu set filetype=yaml
|
2024-07-22 09:08:34 +02:00
|
|
|
autocmd BufRead,BufNewFile *.yml.example set filetype=yaml
|
|
|
|
autocmd BufRead,BufNewFile *.yaml.example set filetype=yaml
|
2024-03-20 12:49:43 +01:00
|
|
|
autocmd BufRead,BufNewFile *.ign set filetype=json
|
|
|
|
]])
|