From 7d161228f8fa6f9316845657a2e72d195827902e Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Tue, 22 Aug 2023 12:54:17 -0400 Subject: [PATCH] chore(nvim): reformat --- nvim/lua/my/configure/treesitter.lua | 212 +++++++++++++-------------- nvim/lua/my/lsp/lua.lua | 2 - 2 files changed, 104 insertions(+), 110 deletions(-) diff --git a/nvim/lua/my/configure/treesitter.lua b/nvim/lua/my/configure/treesitter.lua index 26ef043c..a168027a 100644 --- a/nvim/lua/my/configure/treesitter.lua +++ b/nvim/lua/my/configure/treesitter.lua @@ -1,115 +1,111 @@ return { - { - 'calops/hmts.nvim', - version = '*', - filetype = 'nix', - dev = true, - lazy = false, - }, - { - 'nvim-treesitter/nvim-treesitter', - dependencies = { - { - 'hiphish/rainbow-delimiters.nvim', - config = function() - local rainbow = require('rainbow-delimiters') - vim.g.rainbow_delimiters = { - strategy = { - [''] = rainbow.strategy['global'], - vim = rainbow.strategy['local'], - }, - query = { - [''] = 'rainbow-delimiters', - lua = 'rainbow-blocks', - html = 'rainbow-tags', - }, - highlight = { - 'RainbowDelimiterRed', - 'RainbowDelimiterYellow', - 'RainbowDelimiterBlue', - 'RainbowDelimiterOrange', - 'RainbowDelimiterGreen', - 'RainbowDelimiterViolet', - 'RainbowDelimiterCyan', - }, - } - end, - }, - 'windwp/nvim-ts-autotag', - 'JoosepAlviste/nvim-ts-context-commentstring', - 'andymass/vim-matchup', - { - 'ziontee113/query-secretary', - keys = { - { - 'qs', - function() - require('query-secretary').query_window_initiate() - end, - desc = 'Open Query Secretary', + 'nvim-treesitter/nvim-treesitter', + dependencies = { + { + 'calops/hmts.nvim', + version = '*', + filetype = 'nix', + dev = true, + lazy = false, + }, + { + 'hiphish/rainbow-delimiters.nvim', + config = function() + local rainbow = require('rainbow-delimiters') + vim.g.rainbow_delimiters = { + strategy = { + [''] = rainbow.strategy['global'], + vim = rainbow.strategy['local'], }, + query = { + [''] = 'rainbow-delimiters', + lua = 'rainbow-blocks', + html = 'rainbow-tags', + }, + highlight = { + 'RainbowDelimiterRed', + 'RainbowDelimiterYellow', + 'RainbowDelimiterBlue', + 'RainbowDelimiterOrange', + 'RainbowDelimiterGreen', + 'RainbowDelimiterViolet', + 'RainbowDelimiterCyan', + }, + } + end, + }, + 'windwp/nvim-ts-autotag', + 'JoosepAlviste/nvim-ts-context-commentstring', + 'andymass/vim-matchup', + { + 'ziontee113/query-secretary', + keys = { + { + 'qs', + function() + require('query-secretary').query_window_initiate() + end, + desc = 'Open Query Secretary', }, - config = function() - require('query-secretary').setup({}) - end, }, + opts = {}, }, - event = 'BufRead', - cmd = { 'TSInstall', 'TSUpdate', 'TSUpdateSync' }, - build = function() - if #vim.api.nvim_list_uis() == 0 then - -- update sync if running headless - vim.cmd.TSUpdateSync() - else - -- otherwise update async - vim.cmd.TSUpdate() - end - end, - init = function() - vim.g.matchup_matchparen_offscreen = { - method = 'popup', - } - end, - config = function() - vim.filetype.add({ - extension = { - mdx = 'mdx', - }, - }) - -- highlight mdx with markdown -- it's close enough. We also do JSX injection via ./after/queries/markdown/injections.scm - vim.treesitter.language.register('markdown', 'mdx') - require('nvim-treesitter.configs').setup({ - ensure_installed = require('my.lsp.filetypes').treesitter_parsers(), - highlight = { - enable = true, - }, - indent = { - enable = true, - }, - incremental_selection = { - enable = true, - -- not sure why but these don't work correctly - -- if they're defined in keymaps.lua instead of here - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - -- treesitter parser for Swift requires treesitter-cli and only really works on mac - additional_vim_regex_highlighting = { 'swift' }, - autotag = { - enable = true, - }, - context_commentstring = { - enable = true, - }, - matchup = { - enable = true, - include_match_words = true, - }, - }) - end, }, + event = 'BufRead', + cmd = { 'TSInstall', 'TSUpdate', 'TSUpdateSync' }, + build = function() + if #vim.api.nvim_list_uis() == 0 then + -- update sync if running headless + vim.cmd.TSUpdateSync() + else + -- otherwise update async + vim.cmd.TSUpdate() + end + end, + init = function() + vim.g.matchup_matchparen_offscreen = { + method = 'popup', + } + end, + config = function() + vim.filetype.add({ + extension = { + mdx = 'mdx', + }, + }) + -- highlight mdx with markdown -- it's close enough. We also do JSX injection via ./after/queries/markdown/injections.scm + vim.treesitter.language.register('markdown', 'mdx') + require('nvim-treesitter.configs').setup({ + ensure_installed = require('my.lsp.filetypes').treesitter_parsers(), + highlight = { + enable = true, + }, + indent = { + enable = true, + }, + incremental_selection = { + enable = true, + -- not sure why but these don't work correctly + -- if they're defined in keymaps.lua instead of here + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = '', + node_decremental = '', + }, + }, + -- treesitter parser for Swift requires treesitter-cli and only really works on mac + additional_vim_regex_highlighting = { 'swift' }, + autotag = { + enable = true, + }, + context_commentstring = { + enable = true, + }, + matchup = { + enable = true, + include_match_words = true, + }, + }) + end, } diff --git a/nvim/lua/my/lsp/lua.lua b/nvim/lua/my/lsp/lua.lua index 0021ad8a..a4bd2823 100644 --- a/nvim/lua/my/lsp/lua.lua +++ b/nvim/lua/my/lsp/lua.lua @@ -7,8 +7,6 @@ if string.find(assert(vim.loop.cwd()), 'hammerspoon') then globals = { 'hs' } end -require('neodev').setup() - return { root_dir = require('lspconfig.util').root_pattern('.git', '.luacheckrc', 'stylua.toml'), settings = {