mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-12-28 09:13:59 +00:00
Compare commits
4 Commits
cb7049dfca
...
d3ff7eb296
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3ff7eb296 | ||
|
|
aa93f4d7d1 | ||
|
|
a788d7f29d | ||
|
|
4111f9eec5 |
4
.github/workflows/stylua.yml
vendored
4
.github/workflows/stylua.yml
vendored
@ -9,11 +9,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Stylua Check
|
||||
uses: JohnnyMorganz/stylua-action@v3
|
||||
uses: JohnnyMorganz/stylua-action@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: latest
|
||||
|
||||
@ -4,3 +4,4 @@ indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
call_parentheses = "None"
|
||||
collapse_simple_statement = "FunctionOnly"
|
||||
|
||||
126
init.lua
126
init.lua
@ -114,9 +114,7 @@ vim.opt.showmode = false
|
||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- See `:help 'clipboard'`
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
vim.schedule(function() vim.opt.clipboard = 'unnamedplus' end)
|
||||
|
||||
-- Enable break indent
|
||||
vim.opt.breakindent = true
|
||||
@ -209,9 +207,7 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
callback = function() vim.highlight.on_yank() end,
|
||||
})
|
||||
|
||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||
@ -382,99 +378,20 @@ require('lazy').setup({
|
||||
|
||||
-- See `:help snacks-pickers-sources`
|
||||
keys = {
|
||||
{
|
||||
'<leader>sh',
|
||||
function()
|
||||
Snacks.picker.help()
|
||||
end,
|
||||
desc = '[S]earch [H]elp',
|
||||
},
|
||||
{
|
||||
'<leader>sk',
|
||||
function()
|
||||
Snacks.picker.keymaps()
|
||||
end,
|
||||
desc = '[S]earch [K]eymaps',
|
||||
},
|
||||
{
|
||||
'<leader>sf',
|
||||
function()
|
||||
Snacks.picker.smart()
|
||||
end,
|
||||
desc = '[S]earch [F]iles',
|
||||
},
|
||||
{
|
||||
'<leader>ss',
|
||||
function()
|
||||
Snacks.picker.pickers()
|
||||
end,
|
||||
desc = '[S]earch [S]elect Snacks',
|
||||
},
|
||||
{
|
||||
'<leader>sw',
|
||||
function()
|
||||
Snacks.picker.grep_word()
|
||||
end,
|
||||
desc = '[S]earch current [W]ord',
|
||||
mode = { 'n', 'x' },
|
||||
},
|
||||
{
|
||||
'<leader>sg',
|
||||
function()
|
||||
Snacks.picker.grep()
|
||||
end,
|
||||
desc = '[S]earch by [G]rep',
|
||||
},
|
||||
{
|
||||
'<leader>sd',
|
||||
function()
|
||||
Snacks.picker.diagnostics()
|
||||
end,
|
||||
desc = '[S]earch [D]iagnostics',
|
||||
},
|
||||
{
|
||||
'<leader>sr',
|
||||
function()
|
||||
Snacks.picker.resume()
|
||||
end,
|
||||
desc = '[S]earch [R]esume',
|
||||
},
|
||||
{
|
||||
'<leader>s.',
|
||||
function()
|
||||
Snacks.picker.recent()
|
||||
end,
|
||||
desc = '[S]earch Recent Files ("." for repeat)',
|
||||
},
|
||||
{
|
||||
'<leader><leader>',
|
||||
function()
|
||||
Snacks.picker.buffers()
|
||||
end,
|
||||
desc = '[ ] Find existing buffers',
|
||||
},
|
||||
{
|
||||
'<leader>/',
|
||||
function()
|
||||
Snacks.picker.lines {}
|
||||
end,
|
||||
desc = '[/] Fuzzily search in current buffer',
|
||||
},
|
||||
{
|
||||
'<leader>s/',
|
||||
function()
|
||||
Snacks.picker.grep_buffers()
|
||||
end,
|
||||
desc = '[S]earch [/] in Open Files',
|
||||
},
|
||||
{ '<leader>sh', function() Snacks.picker.help() end, desc = '[S]earch [H]elp' },
|
||||
{ '<leader>sk', function() Snacks.picker.keymaps() end, desc = '[S]earch [K]eymaps' },
|
||||
{ '<leader>sf', function() Snacks.picker.smart() end, desc = '[S]earch [F]iles' },
|
||||
{ '<leader>ss', function() Snacks.picker.pickers() end, desc = '[S]earch [S]elect Snacks' },
|
||||
{ '<leader>sw', function() Snacks.picker.grep_word() end, desc = '[S]earch current [W]ord', mode = { 'n', 'x' } },
|
||||
{ '<leader>sg', function() Snacks.picker.grep() end, desc = '[S]earch by [G]rep' },
|
||||
{ '<leader>sd', function() Snacks.picker.diagnostics() end, desc = '[S]earch [D]iagnostics' },
|
||||
{ '<leader>sr', function() Snacks.picker.resume() end, desc = '[S]earch [R]esume' },
|
||||
{ '<leader>s.', function() Snacks.picker.recent() end, desc = '[S]earch Recent Files ("." for repeat)' },
|
||||
{ '<leader><leader>', function() Snacks.picker.buffers() end, desc = '[ ] Find existing buffers' },
|
||||
{ '<leader>/', function() Snacks.picker.lines {} end, desc = '[/] Fuzzily search in current buffer' },
|
||||
{ '<leader>s/', function() Snacks.picker.grep_buffers() end, desc = '[S]earch [/] in Open Files' },
|
||||
-- Shortcut for searching your Neovim configuration files
|
||||
{
|
||||
'<leader>sn',
|
||||
function()
|
||||
Snacks.picker.files { cwd = vim.fn.stdpath 'config' }
|
||||
end,
|
||||
desc = '[S]earch [N]eovim files',
|
||||
},
|
||||
{ '<leader>sn', function() Snacks.picker.files { cwd = vim.fn.stdpath 'config' } end, desc = '[S]earch [N]eovim files' },
|
||||
},
|
||||
},
|
||||
|
||||
@ -488,7 +405,6 @@ require('lazy').setup({
|
||||
library = {
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
|
||||
{ path = 'snacks.nvim', words = { 'Snacks' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -635,9 +551,7 @@ require('lazy').setup({
|
||||
--
|
||||
-- This may be unwanted, since they displace some of your code
|
||||
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
||||
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')
|
||||
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')
|
||||
end
|
||||
end,
|
||||
})
|
||||
@ -759,9 +673,7 @@ require('lazy').setup({
|
||||
keys = {
|
||||
{
|
||||
'<leader>f',
|
||||
function()
|
||||
require('conform').format { async = true, lsp_format = 'fallback' }
|
||||
end,
|
||||
function() require('conform').format { async = true, lsp_format = 'fallback' } end,
|
||||
mode = '',
|
||||
desc = '[F]ormat buffer',
|
||||
},
|
||||
@ -946,9 +858,7 @@ require('lazy').setup({
|
||||
-- default behavior. For example, here we set the section for
|
||||
-- cursor location to LINE:COLUMN
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
statusline.section_location = function()
|
||||
return '%2l:%-2v'
|
||||
end
|
||||
statusline.section_location = function() return '%2l:%-2v' end
|
||||
|
||||
-- ... and there is more!
|
||||
-- Check out: https://github.com/echasnovski/mini.nvim
|
||||
|
||||
@ -28,52 +28,38 @@ return {
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
{
|
||||
'<F5>',
|
||||
function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
function() require('dap').continue() end,
|
||||
desc = 'Debug: Start/Continue',
|
||||
},
|
||||
{
|
||||
'<F1>',
|
||||
function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
function() require('dap').step_into() end,
|
||||
desc = 'Debug: Step Into',
|
||||
},
|
||||
{
|
||||
'<F2>',
|
||||
function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
function() require('dap').step_over() end,
|
||||
desc = 'Debug: Step Over',
|
||||
},
|
||||
{
|
||||
'<F3>',
|
||||
function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
function() require('dap').step_out() end,
|
||||
desc = 'Debug: Step Out',
|
||||
},
|
||||
{
|
||||
'<leader>b',
|
||||
function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end,
|
||||
function() require('dap').toggle_breakpoint() end,
|
||||
desc = 'Debug: Toggle Breakpoint',
|
||||
},
|
||||
{
|
||||
'<leader>B',
|
||||
function()
|
||||
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end,
|
||||
function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end,
|
||||
desc = 'Debug: Set Breakpoint',
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
{
|
||||
'<F7>',
|
||||
function()
|
||||
require('dapui').toggle()
|
||||
end,
|
||||
function() require('dapui').toggle() end,
|
||||
desc = 'Debug: See last session result.',
|
||||
},
|
||||
},
|
||||
|
||||
@ -34,12 +34,8 @@ return {
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>hs', function()
|
||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'git [s]tage hunk' })
|
||||
map('v', '<leader>hr', function()
|
||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'git [r]eset hunk' })
|
||||
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
|
||||
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
|
||||
-- normal mode
|
||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
||||
@ -49,9 +45,7 @@ return {
|
||||
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
||||
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
||||
map('n', '<leader>hD', function()
|
||||
gitsigns.diffthis '@'
|
||||
end, { desc = 'git [D]iff against last commit' })
|
||||
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
|
||||
-- Toggles
|
||||
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user