diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-05-31 22:20:30 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-05-31 22:20:30 +0200 |
commit | 7d1e8075b8f156f3f8c300326abf730a1a8f2875 (patch) | |
tree | 4fff845d6cd1b66e267ef76dfad122a174f2c7a4 /.config/nvim/lua/_autocommands | |
parent | 0ce9de258802b9c3259083e6f1ab5739e8e51084 (diff) |
Copying of Luke's dots
Diffstat (limited to '.config/nvim/lua/_autocommands')
-rw-r--r-- | .config/nvim/lua/_autocommands/init.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/.config/nvim/lua/_autocommands/init.lua b/.config/nvim/lua/_autocommands/init.lua index 1642127..0b69c0f 100644 --- a/.config/nvim/lua/_autocommands/init.lua +++ b/.config/nvim/lua/_autocommands/init.lua @@ -22,16 +22,25 @@ if O.lua.autoformat then table.insert(auto_formatters, lua_format) end local json_format = {'BufWritePre', '*.json', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} if O.json.autoformat then table.insert(auto_formatters, json_format) end +local go_format = {'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'} +if O.go.autoformat then table.insert(auto_formatters, go_format) end + utils.define_augroups({ _general_settings = { {'TextYankPost', '*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'}, {'BufWinEnter', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, {'BufRead', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, {'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, - {'VimLeavePre', '*', 'set title set titleold='} + {'VimLeavePre', '*', 'set title set titleold='}, + {'FileType', 'qf', 'set nobuflisted'}, - -- {'User', 'GoyoLeave', 'lua require(\'galaxyline\').disable_galaxyline()'}, - -- {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'}, + }, + _go = { + -- Go generally requires Tabs instead of spaces. + {'FileType', 'go', 'setlocal tabstop=4'}, + {'FileType', 'go', 'setlocal shiftwidth=4'}, + {'FileType', 'go', 'setlocal softtabstop=4'}, + {'FileType', 'go', 'setlocal noexpandtab'}, }, _dashboard = { -- seems to be nobuflisted that makes my stuff disapear will do more testing |