From 0111b31cb0008f4fcc55ddc373e63f124652b156 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 7 Jul 2021 01:05:06 +0200 Subject: Updated config based on Chris LunarVim release --- .config/nvim/lua/_autocommands/init.lua | 67 --------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 .config/nvim/lua/_autocommands/init.lua (limited to '.config/nvim/lua/_autocommands') diff --git a/.config/nvim/lua/_autocommands/init.lua b/.config/nvim/lua/_autocommands/init.lua deleted file mode 100644 index 0b69c0f..0000000 --- a/.config/nvim/lua/_autocommands/init.lua +++ /dev/null @@ -1,67 +0,0 @@ -local utils = require('_utils') - -local auto_formatters = { } - -local python_autoformat = {'BufWritePre', '*.py', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} -if O.python.autoformat then table.insert(auto_formatters, python_autoformat) end - -local javascript_autoformat = {'BufWritePre', '*.js', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} -local javascriptreact_autoformat = {'BufWritePre', '*.jsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} -local typescript_autoformat = {'BufWritePre', '*.ts', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} -local typescriptreact_autoformat = {'BufWritePre', '*.tsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} -if O.tsserver.autoformat then - table.insert(auto_formatters, javascript_autoformat) - table.insert(auto_formatters, javascriptreact_autoformat) - table.insert(auto_formatters, typescript_autoformat) - table.insert(auto_formatters, typescriptreact_autoformat) -end - -local lua_format = {'BufWritePre', '*.lua', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} -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='}, - {'FileType', 'qf', 'set nobuflisted'}, - - }, - _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 - { - 'FileType', 'dashboard', - 'setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= ' - }, {'FileType', 'dashboard', 'set showtabline=0 | autocmd BufLeave set showtabline=2'} - }, - _markdown = {{'FileType', 'markdown', 'setlocal wrap'}, {'FileType', 'markdown', 'setlocal spell'}}, - _solidity = { - {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'}, - {'BufNewFile', '*.sol', 'setlocal filetype=solidity'} - }, - _gemini = { - {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'}, - {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'} - }, - _buffer_bindings = { - {'FileType', 'dashboard', 'nnoremap q :q'}, - {'FileType', 'lspinfo', 'nnoremap q :q'}, - {'FileType', 'floaterm', 'nnoremap q :q'}, - }, - _auto_formatters = auto_formatters -}) -- cgit v1.2.3-70-g09d2