bo.expandtab = false
bo.shiftwidth = 8
bo.softtabstop = 8
o.completeopt = 'longest,menuone'
o.shell = '/bin/sh'
o.encoding = 'utf-8'
o.scrolloff = 3
o.lazyredraw = true
o.autochdir = false
o.smarttab = true
o.number = true
o.list = true
o.mouse = ''
o.backspace = 'indent,eol,start'
o.swapfile = false
-- o.foldmethod = 'expr'
-- o.foldexpr = 'nvim_treesitter#foldexpr()'
local format = function(diagnostic)
if diagnostic.severity == vim.diagnostic.severity.ERROR then
-- return string.format("E: %s", diagnostic.message)
return diagnostic.message .. diagnostic.source
end
return diagnostic.message
end
cmd 'syntax enable'
cmd 'filetype on'
cmd 'filetype plugin on'
cmd 'filetype indent on'
cmd 'colorscheme colorscheme'
vim.cmd([[
au BufNewFile,BufRead *.j2*,*.jinja* setlocal filetype=django
au BufNewFile,BufRead */.config/neomutt/*
\ if &filetype == "" |
\ setlocal filetype=neomuttrc |
\ endif
]])
vim.filetype.add({
pattern = {
['.*playbooks/.*%.yml'] = 'yaml.ansible',
['.*roles/.*/tasks/.*%.yml'] = 'yaml.ansible',
['.*roles/.*/defaults/.*%.yml'] = 'yaml.ansible',
['.*roles/.*/vars/.*%.yml'] = 'yaml.ansible',
['.*roles/.*/meta/.*%.yml'] = 'yaml.ansible',
['.*roles/.*/templates/.*%.yml'] = 'yaml.ansible',
['.*%.Dockerfile'] = 'dockerfile',
['Dockerfile%..*'] = 'dockerfile',
['.*%.env.*'] = 'sh',
['.*/task/config'] = 'taskrc',
['%.ansible%-lint'] = 'yaml',
['%.yamllint'] = 'yaml',
}
})
--[[
require'nvim-treesitter.configs'.setup {
textobjects = {
lsp_interop = {
enable = true,
border = 'none',
peek_definition_code = {
["<space>k"] = "@function.outer",
["<space>K"] = "@class.outer",
},
},
},
}
]]--