Skip to content

Commit 166d8b3

Browse files
authored
Merge pull request #8 from oriori1703/feature/collapse-functions
Feature/collapse functions
2 parents 67c23b3 + 48e36d1 commit 166d8b3

File tree

5 files changed

+31
-87
lines changed

5 files changed

+31
-87
lines changed

.github/workflows/stylua.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout Code
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
with:
1414
ref: ${{ github.event.pull_request.head.sha }}
1515
- name: Stylua Check
16-
uses: JohnnyMorganz/stylua-action@v3
16+
uses: JohnnyMorganz/stylua-action@v4
1717
with:
1818
token: ${{ secrets.GITHUB_TOKEN }}
1919
version: latest

.stylua.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ indent_type = "Spaces"
44
indent_width = 2
55
quote_style = "AutoPreferSingle"
66
call_parentheses = "None"
7+
collapse_simple_statement = "FunctionOnly"

init.lua

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ vim.o.showmode = false
114114
-- Schedule the setting after `UiEnter` because it can increase startup-time.
115115
-- Remove this option if you want your OS clipboard to remain independent.
116116
-- See `:help 'clipboard'`
117-
vim.schedule(function()
118-
vim.o.clipboard = 'unnamedplus'
119-
end)
117+
vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
120118

121119
-- Enable break indent
122120
vim.o.breakindent = true
@@ -214,9 +212,7 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
214212
vim.api.nvim_create_autocmd('TextYankPost', {
215213
desc = 'Highlight when yanking (copying) text',
216214
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
217-
callback = function()
218-
vim.hl.on_yank()
219-
end,
215+
callback = function() vim.hl.on_yank() end,
220216
})
221217

222218
-- [[ Install `lazy.nvim` plugin manager ]]
@@ -378,9 +374,7 @@ require('lazy').setup({
378374

379375
-- `cond` is a condition used to determine whether this plugin should be
380376
-- installed and loaded.
381-
cond = function()
382-
return vim.fn.executable 'make' == 1
383-
end,
377+
cond = function() return vim.fn.executable 'make' == 1 end,
384378
},
385379
{ 'nvim-telescope/telescope-ui-select.nvim' },
386380

@@ -454,17 +448,20 @@ require('lazy').setup({
454448

455449
-- It's also possible to pass additional configuration options.
456450
-- See `:help telescope.builtin.live_grep()` for information about particular keys
457-
vim.keymap.set('n', '<leader>s/', function()
458-
builtin.live_grep {
459-
grep_open_files = true,
460-
prompt_title = 'Live Grep in Open Files',
461-
}
462-
end, { desc = '[S]earch [/] in Open Files' })
451+
vim.keymap.set(
452+
'n',
453+
'<leader>s/',
454+
function()
455+
builtin.live_grep {
456+
grep_open_files = true,
457+
prompt_title = 'Live Grep in Open Files',
458+
}
459+
end,
460+
{ desc = '[S]earch [/] in Open Files' }
461+
)
463462

464463
-- Shortcut for searching your Neovim configuration files
465-
vim.keymap.set('n', '<leader>sn', function()
466-
builtin.find_files { cwd = vim.fn.stdpath 'config' }
467-
end, { desc = '[S]earch [N]eovim files' })
464+
vim.keymap.set('n', '<leader>sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' })
468465
end,
469466
},
470467

@@ -639,9 +636,7 @@ require('lazy').setup({
639636
--
640637
-- This may be unwanted, since they displace some of your code
641638
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
642-
map('<leader>th', function()
643-
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
644-
end, '[T]oggle Inlay [H]ints')
639+
map('<leader>th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints')
645640
end
646641
end,
647642
})
@@ -782,9 +777,7 @@ require('lazy').setup({
782777
keys = {
783778
{
784779
'<leader>f',
785-
function()
786-
require('conform').format { async = true, lsp_format = 'fallback' }
787-
end,
780+
function() require('conform').format { async = true, lsp_format = 'fallback' } end,
788781
mode = '',
789782
desc = '[F]ormat buffer',
790783
},
@@ -979,9 +972,7 @@ require('lazy').setup({
979972
-- default behavior. For example, here we set the section for
980973
-- cursor location to LINE:COLUMN
981974
---@diagnostic disable-next-line: duplicate-set-field
982-
statusline.section_location = function()
983-
return '%2l:%-2v'
984-
end
975+
statusline.section_location = function() return '%2l:%-2v' end
985976

986977
-- ... and there is more!
987978
-- Check out: https://github.com/echasnovski/mini.nvim

lua/kickstart/plugins/debug.lua

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -28,56 +28,14 @@ return {
2828
},
2929
keys = {
3030
-- Basic debugging keymaps, feel free to change to your liking!
31-
{
32-
'<F5>',
33-
function()
34-
require('dap').continue()
35-
end,
36-
desc = 'Debug: Start/Continue',
37-
},
38-
{
39-
'<F1>',
40-
function()
41-
require('dap').step_into()
42-
end,
43-
desc = 'Debug: Step Into',
44-
},
45-
{
46-
'<F2>',
47-
function()
48-
require('dap').step_over()
49-
end,
50-
desc = 'Debug: Step Over',
51-
},
52-
{
53-
'<F3>',
54-
function()
55-
require('dap').step_out()
56-
end,
57-
desc = 'Debug: Step Out',
58-
},
59-
{
60-
'<leader>b',
61-
function()
62-
require('dap').toggle_breakpoint()
63-
end,
64-
desc = 'Debug: Toggle Breakpoint',
65-
},
66-
{
67-
'<leader>B',
68-
function()
69-
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
70-
end,
71-
desc = 'Debug: Set Breakpoint',
72-
},
31+
{ '<F5>', function() require('dap').continue() end, desc = 'Debug: Start/Continue' },
32+
{ '<F1>', function() require('dap').step_into() end, desc = 'Debug: Step Into' },
33+
{ '<F2>', function() require('dap').step_over() end, desc = 'Debug: Step Over' },
34+
{ '<F3>', function() require('dap').step_out() end, desc = 'Debug: Step Out' },
35+
{ '<leader>b', function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint' },
36+
{ '<leader>B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, desc = 'Debug: Set Breakpoint' },
7337
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
74-
{
75-
'<F7>',
76-
function()
77-
require('dapui').toggle()
78-
end,
79-
desc = 'Debug: See last session result.',
80-
},
38+
{ '<F7>', function() require('dapui').toggle() end, desc = 'Debug: See last session result.' },
8139
},
8240
config = function()
8341
local dap = require 'dap'

lua/kickstart/plugins/gitsigns.lua

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ return {
3939

4040
-- Actions
4141
-- visual mode
42-
map('v', '<leader>hs', function()
43-
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
44-
end, { desc = 'git [s]tage hunk' })
45-
map('v', '<leader>hr', function()
46-
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
47-
end, { desc = 'git [r]eset hunk' })
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' })
4844
-- normal mode
4945
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
5046
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
@@ -54,9 +50,7 @@ return {
5450
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
5551
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
5652
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
57-
map('n', '<leader>hD', function()
58-
gitsigns.diffthis '@'
59-
end, { desc = 'git [D]iff against last commit' })
53+
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
6054
-- Toggles
6155
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
6256
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })

0 commit comments

Comments
 (0)