Skip to content

Commit

Permalink
nvim: format
Browse files Browse the repository at this point in the history
  • Loading branch information
juliamertz committed Dec 26, 2024
1 parent bdab672 commit 5109778
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 102 deletions.
9 changes: 4 additions & 5 deletions nvim/lua/julia/plugins/mini.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ return {
})
end,
},

{
'echasnovski/mini.surround',
version = '*',
Expand All @@ -38,22 +39,20 @@ return {
},
},
},

{
'echasnovski/mini.comment',
version = '*',
opts = {},
},

{
'echasnovski/mini-git',
version = '*',
main = 'mini.git',
opts = {},
},
{
'echasnovski/mini.diff',
version = '*',
opts = {},
},

{
'echasnovski/mini.icons',
opts = {},
Expand Down
114 changes: 24 additions & 90 deletions nvim/lua/julia/plugins/treesitter.lua
Original file line number Diff line number Diff line change
@@ -1,95 +1,5 @@
return {
{
'nvim-treesitter/nvim-treesitter-textobjects',
event = 'VeryLazy',
dependencies = { 'nvim-treesitter/nvim-treesitter' },
config = function(one, two)
require('nvim-treesitter.configs').setup {
textobjects = {
swap = {
enable = true,
swap_next = {
['<leader>na'] = '@parameter.inner',
['<leader>nm'] = '@function.outer',
},
swap_previous = {
['<leader>pa'] = '@parameter.inner',
['<leader>pm'] = '@function.outer',
},
},
select = {
enable = true,
lookahead = true,
keymaps = {
['a='] = { query = '@assignment.outer', desc = 'Select outer part of an assignment' },
['i='] = { query = '@assignment.inner', desc = 'Select inner part of an assignment' },
['l='] = { query = '@assignment.lhs', desc = 'Select left hand side of an assignment' },
['r='] = { query = '@assignment.rhs', desc = 'Select right hand side of an assignment' },

['aa'] = { query = '@parameter.outer', desc = 'Select outer part of a parameter/argument' },
['ia'] = { query = '@parameter.inner', desc = 'Select inner part of a parameter/argument' },

['ai'] = { query = '@conditional.outer', desc = 'Select outer part of a conditional' },
['ii'] = { query = '@conditional.inner', desc = 'Select inner part of a conditional' },

['al'] = { query = '@loop.outer', desc = 'Select outer part of a loop' },
['il'] = { query = '@loop.inner', desc = 'Select inner part of a loop' },

['af'] = { query = '@call.outer', desc = 'Select outer part of a function call' },
['if'] = { query = '@call.inner', desc = 'Select inner part of a function call' },

['am'] = {
query = '@function.outer',
desc = 'Select outer part of a method/function definition',
},
['im'] = {
query = '@function.inner',
desc = 'Select inner part of a method/function definition',
},

['ac'] = { query = '@class.outer', desc = 'Select outer part of a class' },
['ic'] = { query = '@class.inner', desc = 'Select inner part of a class' },
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
[']f'] = { query = '@call.outer', desc = 'Next function call start' },
[']m'] = { query = '@function.outer', desc = 'Next method/function def start' },
[']c'] = { query = '@class.outer', desc = 'Next class start' },
[']i'] = { query = '@conditional.outer', desc = 'Next conditional start' },
[']l'] = { query = '@loop.outer', desc = 'Next loop start' },

[']s'] = { query = '@scope', query_group = 'locals', desc = 'Next scope' },
[']z'] = { query = '@fold', query_group = 'folds', desc = 'Next fold' },
},
goto_next_end = {
[']F'] = { query = '@call.outer', desc = 'Next function call end' },
[']M'] = { query = '@function.outer', desc = 'Next method/function def end' },
[']C'] = { query = '@class.outer', desc = 'Next class end' },
[']I'] = { query = '@conditional.outer', desc = 'Next conditional end' },
[']L'] = { query = '@loop.outer', desc = 'Next loop end' },
},
goto_previous_start = {
['[f'] = { query = '@call.outer', desc = 'Prev function call start' },
['[m'] = { query = '@function.outer', desc = 'Prev method/function def start' },
['[c'] = { query = '@class.outer', desc = 'Prev class start' },
['[i'] = { query = '@conditional.outer', desc = 'Prev conditional start' },
['[l'] = { query = '@loop.outer', desc = 'Prev loop start' },
},
goto_previous_end = {
['[F'] = { query = '@call.outer', desc = 'Prev function call end' },
['[M'] = { query = '@function.outer', desc = 'Prev method/function def end' },
['[C'] = { query = '@class.outer', desc = 'Prev class end' },
['[I'] = { query = '@conditional.outer', desc = 'Prev conditional end' },
['[L'] = { query = '@loop.outer', desc = 'Prev loop end' },
},
},
},
}
end,
},
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
Expand Down Expand Up @@ -123,6 +33,30 @@ return {
}
end,
},

{
'nvim-treesitter/nvim-treesitter-textobjects',
event = 'VeryLazy',
dependencies = { 'nvim-treesitter/nvim-treesitter' },
config = function(one, two)
require('nvim-treesitter.configs').setup {
textobjects = {
swap = {
enable = true,
swap_next = {
['<leader>na'] = '@parameter.inner',
['<leader>nm'] = '@function.outer',
},
swap_previous = {
['<leader>pa'] = '@parameter.inner',
['<leader>pm'] = '@function.outer',
},
},
},
}
end,
},

{
'windwp/nvim-ts-autotag',
event = 'BufRead',
Expand Down
4 changes: 2 additions & 2 deletions nvim/lua/julia/plugins/undotree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ return {
'jiaoshijie/undotree',
dependencies = 'nvim-lua/plenary.nvim',

keys = {
{ '<leader>ut', ':UndoTreeToggle<CR>', desc = 'Toggle undotree pane' },
keys = {
{ '<leader>ut', ':UndoTreeToggle<CR>', desc = 'Toggle undotree pane' },
},

opts = {
Expand Down
10 changes: 5 additions & 5 deletions nvim/lua/julia/set.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ end

-- Disable line numbers in embedded terminals
vim.api.nvim_create_autocmd('TermOpen', {
group = vim.api.nvim_create_augroup('termopen', { clear = true }),
callback = function ()
vim.opt.number = false
vim.opt.relativenumber = false
end
group = vim.api.nvim_create_augroup('termopen', { clear = true }),
callback = function()
vim.opt.number = false
vim.opt.relativenumber = false
end,
})

0 comments on commit 5109778

Please sign in to comment.