Skip to content

Commit 431cf2e

Browse files
committed
Fix formating of plugins
1 parent d132bd3 commit 431cf2e

File tree

3 files changed

+109
-111
lines changed

3 files changed

+109
-111
lines changed

lua/kickstart/plugins/gitsigns.lua

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,54 @@
55
---@module 'lazy'
66
---@type LazySpec
77
return {
8-
{
9-
'lewis6991/gitsigns.nvim',
10-
---@module 'gitsigns'
11-
---@type Gitsigns.Config
12-
---@diagnostic disable-next-line: missing-fields
13-
opts = {
14-
on_attach = function(bufnr)
15-
local gitsigns = require 'gitsigns'
8+
'lewis6991/gitsigns.nvim',
9+
---@module 'gitsigns'
10+
---@type Gitsigns.Config
11+
---@diagnostic disable-next-line: missing-fields
12+
opts = {
13+
on_attach = function(bufnr)
14+
local gitsigns = require 'gitsigns'
1615

17-
local function map(mode, l, r, opts)
18-
opts = opts or {}
19-
opts.buffer = bufnr
20-
vim.keymap.set(mode, l, r, opts)
21-
end
16+
local function map(mode, l, r, opts)
17+
opts = opts or {}
18+
opts.buffer = bufnr
19+
vim.keymap.set(mode, l, r, opts)
20+
end
2221

23-
-- Navigation
24-
map('n', ']c', function()
25-
if vim.wo.diff then
26-
vim.cmd.normal { ']c', bang = true }
27-
else
28-
gitsigns.nav_hunk 'next'
29-
end
30-
end, { desc = 'Jump to next git [c]hange' })
22+
-- Navigation
23+
map('n', ']c', function()
24+
if vim.wo.diff then
25+
vim.cmd.normal { ']c', bang = true }
26+
else
27+
gitsigns.nav_hunk 'next'
28+
end
29+
end, { desc = 'Jump to next git [c]hange' })
3130

32-
map('n', '[c', function()
33-
if vim.wo.diff then
34-
vim.cmd.normal { '[c', bang = true }
35-
else
36-
gitsigns.nav_hunk 'prev'
37-
end
38-
end, { desc = 'Jump to previous git [c]hange' })
31+
map('n', '[c', function()
32+
if vim.wo.diff then
33+
vim.cmd.normal { '[c', bang = true }
34+
else
35+
gitsigns.nav_hunk 'prev'
36+
end
37+
end, { desc = 'Jump to previous git [c]hange' })
3938

40-
-- Actions
41-
-- visual mode
42-
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
43-
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
44-
-- normal mode
45-
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
46-
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
47-
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
48-
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
49-
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
50-
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
51-
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
52-
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
53-
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
54-
-- Toggles
55-
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
56-
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
57-
end,
58-
},
39+
-- Actions
40+
-- visual mode
41+
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
42+
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
43+
-- normal mode
44+
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
45+
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
46+
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
47+
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
48+
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
49+
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
50+
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
51+
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
52+
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
53+
-- Toggles
54+
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
55+
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
56+
end,
5957
},
6058
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
-- Add indentation guides even on blank lines
2+
13
---@module 'lazy'
24
---@type LazySpec
35
return {
4-
{ -- Add indentation guides even on blank lines
5-
'lukas-reineke/indent-blankline.nvim',
6-
-- Enable `lukas-reineke/indent-blankline.nvim`
7-
-- See `:help ibl`
8-
main = 'ibl',
9-
---@module 'ibl'
10-
---@type ibl.config
11-
opts = {},
12-
},
6+
'lukas-reineke/indent-blankline.nvim',
7+
-- Enable `lukas-reineke/indent-blankline.nvim`
8+
-- See `:help ibl`
9+
main = 'ibl',
10+
---@module 'ibl'
11+
---@type ibl.config
12+
opts = {},
1313
}

lua/kickstart/plugins/lint.lua

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1+
-- Linting
2+
13
---@module 'lazy'
24
---@type LazySpec
3-
return {
4-
5-
{ -- Linting
6-
'mfussenegger/nvim-lint',
7-
event = { 'BufReadPre', 'BufNewFile' },
8-
config = function()
9-
local lint = require 'lint'
10-
lint.linters_by_ft = {
11-
markdown = { 'markdownlint' },
12-
}
5+
return
6+
{
7+
'mfussenegger/nvim-lint',
8+
event = { 'BufReadPre', 'BufNewFile' },
9+
config = function()
10+
local lint = require 'lint'
11+
lint.linters_by_ft = {
12+
markdown = { 'markdownlint' },
13+
}
1314

14-
-- To allow other plugins to add linters to require('lint').linters_by_ft,
15-
-- instead set linters_by_ft like this:
16-
-- lint.linters_by_ft = lint.linters_by_ft or {}
17-
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
18-
--
19-
-- However, note that this will enable a set of default linters,
20-
-- which will cause errors unless these tools are available:
21-
-- {
22-
-- clojure = { "clj-kondo" },
23-
-- dockerfile = { "hadolint" },
24-
-- inko = { "inko" },
25-
-- janet = { "janet" },
26-
-- json = { "jsonlint" },
27-
-- markdown = { "vale" },
28-
-- rst = { "vale" },
29-
-- ruby = { "ruby" },
30-
-- terraform = { "tflint" },
31-
-- text = { "vale" }
32-
-- }
33-
--
34-
-- You can disable the default linters by setting their filetypes to nil:
35-
-- lint.linters_by_ft['clojure'] = nil
36-
-- lint.linters_by_ft['dockerfile'] = nil
37-
-- lint.linters_by_ft['inko'] = nil
38-
-- lint.linters_by_ft['janet'] = nil
39-
-- lint.linters_by_ft['json'] = nil
40-
-- lint.linters_by_ft['markdown'] = nil
41-
-- lint.linters_by_ft['rst'] = nil
42-
-- lint.linters_by_ft['ruby'] = nil
43-
-- lint.linters_by_ft['terraform'] = nil
44-
-- lint.linters_by_ft['text'] = nil
15+
-- To allow other plugins to add linters to require('lint').linters_by_ft,
16+
-- instead set linters_by_ft like this:
17+
-- lint.linters_by_ft = lint.linters_by_ft or {}
18+
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
19+
--
20+
-- However, note that this will enable a set of default linters,
21+
-- which will cause errors unless these tools are available:
22+
-- {
23+
-- clojure = { "clj-kondo" },
24+
-- dockerfile = { "hadolint" },
25+
-- inko = { "inko" },
26+
-- janet = { "janet" },
27+
-- json = { "jsonlint" },
28+
-- markdown = { "vale" },
29+
-- rst = { "vale" },
30+
-- ruby = { "ruby" },
31+
-- terraform = { "tflint" },
32+
-- text = { "vale" }
33+
-- }
34+
--
35+
-- You can disable the default linters by setting their filetypes to nil:
36+
-- lint.linters_by_ft['clojure'] = nil
37+
-- lint.linters_by_ft['dockerfile'] = nil
38+
-- lint.linters_by_ft['inko'] = nil
39+
-- lint.linters_by_ft['janet'] = nil
40+
-- lint.linters_by_ft['json'] = nil
41+
-- lint.linters_by_ft['markdown'] = nil
42+
-- lint.linters_by_ft['rst'] = nil
43+
-- lint.linters_by_ft['ruby'] = nil
44+
-- lint.linters_by_ft['terraform'] = nil
45+
-- lint.linters_by_ft['text'] = nil
4546

46-
-- Create autocommand which carries out the actual linting
47-
-- on the specified events.
48-
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
49-
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
50-
group = lint_augroup,
51-
callback = function()
52-
-- Only run the linter in buffers that you can modify in order to
53-
-- avoid superfluous noise, notably within the handy LSP pop-ups that
54-
-- describe the hovered symbol using Markdown.
55-
if vim.bo.modifiable then lint.try_lint() end
56-
end,
57-
})
58-
end,
59-
},
47+
-- Create autocommand which carries out the actual linting
48+
-- on the specified events.
49+
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
50+
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
51+
group = lint_augroup,
52+
callback = function()
53+
-- Only run the linter in buffers that you can modify in order to
54+
-- avoid superfluous noise, notably within the handy LSP pop-ups that
55+
-- describe the hovered symbol using Markdown.
56+
if vim.bo.modifiable then lint.try_lint() end
57+
end,
58+
})
59+
end,
6060
}

0 commit comments

Comments
 (0)