Skip to content

Commit 7ded665

Browse files
authored
Try Snacks.nvim (#31)
* Install and setup snacks.nvim plugin * Fix autopairs error when opening snacks.nvim pickers * Replace telescope pickers with snacks * Remove telescope plugin * Remove obsidian.nvim plugin (Unused, depended on Plenary) * Refactor KastenTelescopeOpen->KastenOpen * Override vim.ui.input with Snacks input * Revert "Refactor KastenTelescopeOpen->KastenOpen" This reverts commit 6ee93f6. * Revert "Remove obsidian.nvim plugin (Unused, depended on Plenary)" This reverts commit f0c7bee. * Revert "Remove telescope plugin" This reverts commit 9515db9. * Uinstall plugin telescope-luasnip * fmt lua
1 parent fde22a2 commit 7ded665

5 files changed

Lines changed: 41 additions & 6 deletions

File tree

after/plugin/auto-pairs.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
" NOTE: Had to unset this because the plugin was raising errors when trying to
2+
" hok into _Snacks.nvim_ buffers. This fixes it.
3+
"
4+
" TODO: Disable _Auto-Pairs_ for those buffers.
5+
let g:AutoPairsMapCR = 0

after/plugin/snacks.lua

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
local snacks = require("snacks")
2+
3+
snacks.setup({
4+
picker = {
5+
ui_select = true,
6+
},
7+
notifier = {},
8+
input = {},
9+
})
10+
11+
vim.api.nvim_set_keymap("n", "<leader>bb", "", {
12+
callback = snacks.picker.buffers,
13+
desc = "Find Buffers",
14+
})
15+
16+
vim.api.nvim_set_keymap("n", "<leader>ff", "", {
17+
callback = snacks.picker.files,
18+
desc = "Find files",
19+
})
20+
21+
vim.api.nvim_set_keymap("n", "<leader>fg", "", {
22+
callback = snacks.picker.git_files,
23+
desc = "Find Git files",
24+
})
25+
26+
vim.api.nvim_set_keymap("n", "<leader>fr", "", {
27+
callback = snacks.picker.grep,
28+
desc = "Grep",
29+
})
30+
31+
vim.api.nvim_set_keymap("n", "<leader><leader>", "", {
32+
callback = snacks.picker.commands,
33+
desc = "Commands",
34+
})

after/plugin/telescope-luasnip.lua

Lines changed: 0 additions & 1 deletion
This file was deleted.

after/plugin/vim-which-key.vim

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ let g:which_key_map["b"] = { 'name' : '+buffers' }
1414
let g:which_key_map['b']['n'] = [ ':bn', 'Next Buffer' ]
1515
let g:which_key_map['b']['p'] = [ ':bp', 'Prev Buffer' ]
1616
let g:which_key_map['b']['d'] = [ ':bp|bd#', 'Delete Buffer' ] " See (1)
17-
let g:which_key_map['b']['b'] = [ ':Telescope buffers', 'Search buffers' ]
1817

1918
" (1) I'm using this command instead of `:bd` to prevent the current window
2019
" from being closed. There is a known bug for `:bp|bd#` in which it will close
@@ -27,9 +26,6 @@ let g:which_key_map['b']['b'] = [ ':Telescope buffers', 'Search buffers' ]
2726

2827
let g:which_key_map['f'] = { 'name' : '+filesystem' }
2928
let g:which_key_map['f']['t'] = [ ':NERDTreeToggle', 'NerdTree' ]
30-
let g:which_key_map['f']['f'] = [ ':Telescope find_files', 'Search files' ]
31-
let g:which_key_map['f']['g'] = [ ':Telescope git_files', 'Search git files' ]
32-
let g:which_key_map['f']['r'] = [ ':Telescope live_grep', 'Ripgrep' ]
3329

3430
" ------------------------------------------------------------------------------
3531
" [l] LSP mappings:

init.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ Plug 'junegunn/vim-easy-align'
146146

147147
Plug 'L3MON4D3/LuaSnip', {'tag': 'v2.*', 'do': 'make install_jsregexp'}
148148
Plug 'rafamadriz/friendly-snippets' " snippet collection.
149-
Plug 'benfowler/telescope-luasnip.nvim' " List snippets with Telescope.
150149

151150
Plug 'neovim/nvim-lspconfig', NeoVimButNoNoVSCode()
152151
Plug 'hrsh7th/nvim-cmp', NeoVimButNoNoVSCode()
@@ -194,6 +193,8 @@ Plug 'chriskempson/base16-vim'
194193

195194
" Navigation
196195

196+
Plug 'folke/snacks.nvim', has('nvim') ? { 'tag': 'stable' } : { 'on': [] }
197+
197198
Plug 'nvim-lua/plenary.nvim', NeoVimButNoNoVSCode(), " Telescope dependency.
198199
Plug 'nvim-telescope/telescope-fzy-native.nvim', NeoVimButNoNoVSCode() " `fzy` based sorter for Telescope.
199200
Plug 'nvim-telescope/telescope.nvim', NeoVimButNoNoVSCode({ 'branch': '0.1.x' })

0 commit comments

Comments
 (0)