summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/settings.lua
blob: ef8fb95cc757b4af89c04a23c4aa0a9639ce2528 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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.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 *.Dockerfile,Dockerfile.* setlocal filetype=dockerfile
  au BufNewFile,BufRead *.j2*,*.jinja* setlocal filetype=django
  au BufNewFile,BufRead */task/config setlocal filetype=taskrc
  au BufNewFile,BufRead *.env* setlocal filetype=sh

  au BufNewFile,BufRead */playbooks/*.yml set filetype=yaml.ansible

  au BufNewFile,BufRead */.config/neomutt/*
    \ if &filetype == "" |
    \ setlocal filetype=neomuttrc |
    \ endif
]])

--[[
require'nvim-treesitter.configs'.setup {
  textobjects = {
    lsp_interop = {
      enable = true,
      border = 'none',
      peek_definition_code = {
        ["<space>k"] = "@function.outer",
        ["<space>K"] = "@class.outer",
      },
    },
  },
}
]]--
remember that computers suck.