@@ -378,152 +378,6 @@ require('lazy').setup({
378
378
--
379
379
-- Use the `dependencies` key to specify the dependencies of a particular plugin
380
380
381
- { -- Fuzzy Finder (files, lsp, etc)
382
- ' nvim-telescope/telescope.nvim' ,
383
- event = ' VimEnter' ,
384
- dependencies = {
385
- ' nvim-lua/plenary.nvim' ,
386
- { -- If encountering errors, see telescope-fzf-native README for installation instructions
387
- ' nvim-telescope/telescope-fzf-native.nvim' ,
388
-
389
- -- `build` is used to run some command when the plugin is installed/updated.
390
- -- This is only run then, not every time Neovim starts up.
391
- build = ' make' ,
392
-
393
- -- `cond` is a condition used to determine whether this plugin should be
394
- -- installed and loaded.
395
- cond = function ()
396
- return vim .fn .executable ' make' == 1
397
- end ,
398
- },
399
- { ' nvim-telescope/telescope-ui-select.nvim' },
400
- {
401
- ' nvim-telescope/telescope-live-grep-args.nvim' ,
402
- -- This will not install any breaking changes.
403
- -- For major updates, this must be adjusted manually.
404
- version = ' ^1.0.0' ,
405
- },
406
-
407
- -- Useful for getting pretty icons, but requires a Nerd Font.
408
- { ' nvim-tree/nvim-web-devicons' , enabled = vim .g .have_nerd_font },
409
- },
410
- config = function ()
411
- -- Telescope is a fuzzy finder that comes with a lot of different things that
412
- -- it can fuzzy find! It's more than just a "file finder", it can search
413
- -- many different aspects of Neovim, your workspace, LSP, and more!
414
- --
415
- -- The easiest way to use Telescope, is to start by doing something like:
416
- -- :Telescope help_tags
417
- --
418
- -- After running this command, a window will open up and you're able to
419
- -- type in the prompt window. You'll see a list of `help_tags` options and
420
- -- a corresponding preview of the help.
421
- --
422
- -- Two important keymaps to use while in Telescope are:
423
- -- - Insert mode: <c-/>
424
- -- - Normal mode: ?
425
- --
426
- -- This opens a window that shows you all of the keymaps for the current
427
- -- Telescope picker. This is really useful to discover what Telescope can
428
- -- do as well as how to actually do it!
429
-
430
- local lga_actions = require ' telescope-live-grep-args.actions'
431
-
432
- -- [[ Configure Telescope ]]
433
- -- See `:help telescope` and `:help telescope.setup()`
434
- require (' telescope' ).setup {
435
- -- You can put your default mappings / updates / etc. in here
436
- -- All the info you're looking for is in `:help telescope.setup()`
437
- --
438
- defaults = {
439
- mappings = {
440
- i = {
441
- [' <C-q>' ] = require (' telescope.actions' ).smart_send_to_qflist + require (' telescope.actions' ).open_qflist ,
442
- [' <CR>' ] = require (' telescope.actions' ).select_default + require (' telescope.actions' ).center ,
443
- [' <C-n>' ] = require (' telescope.actions' ).cycle_history_next ,
444
- [' <C-p>' ] = require (' telescope.actions' ).cycle_history_prev ,
445
- },
446
- },
447
- },
448
- pickers = {
449
- find_files = {
450
- file_ignore_patterns = { ' node_modules' , ' .git' },
451
- hidden = true ,
452
- theme = ' ivy' ,
453
- },
454
- -- live_grep = {
455
- -- file_ignore_patterns = { 'node_modules', '.git' },
456
- -- additional_args = { '--hidden' },
457
- -- },
458
- marks = {
459
- theme = ' ivy' ,
460
- },
461
- },
462
- extensions = {
463
- [' ui-select' ] = {
464
- require (' telescope.themes' ).get_dropdown (),
465
- },
466
- live_grep_args = {
467
- auto_quoting = true , -- enable/disable auto-quoting
468
- -- define mappings, e.g.
469
- mappings = { -- extend mappings
470
- i = {
471
- [' <C-k>' ] = lga_actions .quote_prompt (),
472
- [' <C-i>' ] = lga_actions .quote_prompt { postfix = ' --iglob ' },
473
- -- freeze the current list and start a fuzzy search in the frozen list
474
- [' <C-space>' ] = lga_actions .to_fuzzy_refine ,
475
- },
476
- },
477
- theme = ' ivy' ,
478
- },
479
- },
480
- }
481
-
482
- -- Enable Telescope extensions if they are installed
483
- pcall (require (' telescope' ).load_extension , ' fzf' )
484
- pcall (require (' telescope' ).load_extension , ' ui-select' )
485
- pcall (require (' telescope' ).load_extension , ' live_grep_args' )
486
-
487
- -- See `:help telescope.builtin`
488
- local builtin = require ' telescope.builtin'
489
- vim .keymap .set (' n' , ' <leader>sh' , builtin .help_tags , { desc = ' [S]earch [H]elp' })
490
- vim .keymap .set (' n' , ' <leader>sk' , builtin .keymaps , { desc = ' [S]earch [K]eymaps' })
491
- vim .keymap .set (' n' , ' <leader>sf' , builtin .find_files , { desc = ' [S]earch [F]iles' })
492
- vim .keymap .set (' n' , ' <leader>ss' , builtin .builtin , { desc = ' [S]earch [S]elect Telescope' })
493
- vim .keymap .set (' n' , ' <leader>sw' , builtin .grep_string , { desc = ' [S]earch current [W]ord' })
494
- -- vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
495
- vim .keymap .set (' n' , ' <leader>sg' , " :lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>" , { desc = ' [S]earch by [G]rep' })
496
- vim .keymap .set (' n' , ' <leader>sm' , builtin .marks , { desc = ' [S]earch [M]arks' })
497
- vim .keymap .set (' n' , ' <leader>sd' , builtin .diagnostics , { desc = ' [S]earch [D]iagnostics' })
498
- vim .keymap .set (' n' , ' <leader>sr' , builtin .resume , { desc = ' [S]earch [R]esume' })
499
- vim .keymap .set (' n' , ' <leader>s.' , builtin .oldfiles , { desc = ' [S]earch Recent Files ("." for repeat)' })
500
- vim .keymap .set (' n' , ' <leader><leader>' , builtin .buffers , { desc = ' [ ] Find existing buffers' })
501
-
502
- -- Slightly advanced example of overriding default behavior and theme
503
- vim .keymap .set (' n' , ' <leader>/' , function ()
504
- -- You can pass additional configuration to Telescope to change the theme, layout, etc.
505
- builtin .current_buffer_fuzzy_find (require (' telescope.themes' ).get_dropdown {
506
- winblend = 10 ,
507
- previewer = false ,
508
- })
509
- end , { desc = ' [/] Fuzzily search in current buffer' })
510
-
511
- -- It's also possible to pass additional configuration options.
512
- -- See `:help telescope.builtin.live_grep()` for information about particular keys
513
- vim .keymap .set (' n' , ' <leader>s/' , function ()
514
- builtin .live_grep {
515
- grep_open_files = true ,
516
- prompt_title = ' Live Grep in Open Files' ,
517
- }
518
- end , { desc = ' [S]earch [/] in Open Files' })
519
-
520
- -- Shortcut for searching your Neovim configuration files
521
- vim .keymap .set (' n' , ' <leader>sn' , function ()
522
- builtin .find_files { cwd = vim .fn .stdpath ' config' }
523
- end , { desc = ' [S]earch [N]eovim files' })
524
- end ,
525
- },
526
-
527
381
-- LSP Plugins
528
382
{
529
383
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
@@ -534,6 +388,7 @@ require('lazy').setup({
534
388
library = {
535
389
-- Load luvit types when the `vim.uv` word is found
536
390
{ path = ' ${3rd}/luv/library' , words = { ' vim%.uv' } },
391
+ { path = ' snacks.nvim' , words = { ' Snacks' } },
537
392
},
538
393
},
539
394
},
@@ -597,35 +452,26 @@ require('lazy').setup({
597
452
vim .keymap .set (mode , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
598
453
end
599
454
600
- -- NOTE:
601
- -- With Neovim v0.11 `gr` is a prefix for a bunch of code actions
602
- -- https://github.com/nvim-lua/kickstart.nvim/pull/1427
603
- -- Commented out the old mapping, let's see how it evolves..
604
-
605
455
-- Jump to the definition of the word under your cursor.
606
456
-- This is where a variable was first declared, or where a function is defined, etc.
607
457
-- To jump back, press <C-t>.
608
- map (' gd' , require (' telescope.builtin ' ) .lsp_definitions , ' [G]oto [D]efinition' )
609
- map (' grd' , require (' telescope.builtin ' ) .lsp_definitions , ' [G]oto [D]efinition' )
458
+ map (' gd' , require (' snacks ' ). picker .lsp_definitions , ' [G]oto [D]efinition' )
459
+ map (' grd' , require (' snacks ' ). picker .lsp_definitions , ' [G]oto [D]efinition' )
610
460
611
461
-- Rename the variable under your cursor.
612
462
-- Most Language Servers support renaming across files, etc.
613
- -- map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
614
463
map (' grn' , vim .lsp .buf .rename , ' [R]e[n]ame' )
615
464
616
465
-- Execute a code action, usually your cursor needs to be on top of an error
617
466
-- or a suggestion from your LSP for this to activate.
618
- -- map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
619
467
map (' gra' , vim .lsp .buf .code_action , ' [G]oto Code [A]ction' , { ' n' , ' x' })
620
468
621
469
-- Find references for the word under your cursor.
622
- -- map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
623
- map (' grr' , require (' telescope.builtin' ).lsp_references , ' [G]oto [R]eferences' )
470
+ map (' grr' , require (' snacks' ).picker .lsp_references , ' [G]oto [R]eferences' )
624
471
625
472
-- Jump to the implementation of the word under your cursor.
626
473
-- Useful when your language has ways of declaring types without an actual implementation.
627
- -- map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
628
- map (' gri' , require (' telescope.builtin' ).lsp_implementations , ' [G]oto [I]mplementation' )
474
+ map (' gri' , require (' snacks' ).picker .lsp_implementations , ' [G]oto [I]mplementation' )
629
475
630
476
-- WARN: This is not Goto Definition, this is Goto Declaration.
631
477
-- For example, in C this would take you to the header.
@@ -635,18 +481,15 @@ require('lazy').setup({
635
481
-- Jump to the type of the word under your cursor.
636
482
-- Useful when you're not sure what type a variable is and you want to see
637
483
-- the definition of its *type*, not where it was *defined*.
638
- -- map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
639
- map (' grt' , require (' telescope.builtin' ).lsp_type_definitions , ' [G]oto [T]ype Definition' )
484
+ map (' grt' , require (' snacks' ).picker .lsp_type_definitions , ' [G]oto [T]ype Definition' )
640
485
641
486
-- Fuzzy find all the symbols in your current document.
642
487
-- Symbols are things like variables, functions, types, etc.
643
- -- map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
644
- map (' gO' , require (' telescope.builtin' ).lsp_document_symbols , ' Open Document Symbols' )
488
+ map (' gO' , require (' snacks' ).picker .lsp_symbols , ' Open Document Symbols' )
645
489
646
490
-- Fuzzy find all the symbols in your current workspace.
647
491
-- Similar to document symbols, except searches over your entire project.
648
- -- map('<leader>Ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
649
- map (' gW' , require (' telescope.builtin' ).lsp_dynamic_workspace_symbols , ' Open Workspace Symbols' )
492
+ map (' gW' , require (' snacks' ).picker .lsp_workspace_symbols , ' Open Workspace Symbols' )
650
493
651
494
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
652
495
--- @param client vim.lsp.Client
@@ -977,7 +820,7 @@ require('lazy').setup({
977
820
-- Change the name of the colorscheme plugin below, and then
978
821
-- change the command in the config to whatever the name of that colorscheme is.
979
822
--
980
- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme `.
823
+ -- If you want to see what colorschemes are already installed, you can use `:lua Snacks.picker.colorschemes() `.
981
824
' catppuccin/nvim' ,
982
825
name = ' catppuccin' ,
983
826
priority = 1000 , -- Make sure to load this before all the other start plugins.
@@ -1078,9 +921,9 @@ require('lazy').setup({
1078
921
{ import = ' custom.plugins' },
1079
922
--
1080
923
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
1081
- -- Or use telescope !
924
+ -- Or use hte "help" snacks-picker !
1082
925
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
1083
- -- you can continue same window with `<space>sr` which resumes last telescope search
926
+ -- you can continue same window with `<space>sr` which resumes last snacks-picker search
1084
927
}, {
1085
928
ui = {
1086
929
-- If you are using a Nerd Font: set icons to an empty table which will use the
0 commit comments