Skip to content

Commit

Permalink
chore(nvim): reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Aug 22, 2023
1 parent 4350901 commit 7d16122
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 110 deletions.
212 changes: 104 additions & 108 deletions nvim/lua/my/configure/treesitter.lua
Original file line number Diff line number Diff line change
@@ -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 = {
{
'<leader>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 = {
{
'<leader>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 = '<CR>',
node_incremental = '<CR>',
scope_incremental = '<S-CR>',
node_decremental = '<BS>',
},
},
-- 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 = '<CR>',
node_incremental = '<CR>',
scope_incremental = '<S-CR>',
node_decremental = '<BS>',
},
},
-- 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,
}
2 changes: 0 additions & 2 deletions nvim/lua/my/lsp/lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 7d16122

Please sign in to comment.