From 1512c6fe944a54bf2113c5f444525be888e5fdb0 Mon Sep 17 00:00:00 2001 From: hwu Date: Tue, 2 Sep 2025 00:43:14 -0400 Subject: [PATCH] switching telescope to folke snacks nvim --- README.md | 80 ++-- init.lua | 144 -------- lua/custom/plugins/bufremove.lua | 39 -- lua/custom/plugins/git.lua | 6 - lua/custom/plugins/lspconfig.lua | 25 -- lua/custom/plugins/nvimtree.lua | 19 - lua/custom/plugins/snacks.lua | 569 +++++++++++++++++++++++++++++ lua/kickstart/plugins/neo-tree.lua | 25 -- 8 files changed, 607 insertions(+), 300 deletions(-) delete mode 100644 lua/custom/plugins/bufremove.lua delete mode 100644 lua/custom/plugins/git.lua delete mode 100644 lua/custom/plugins/nvimtree.lua create mode 100644 lua/custom/plugins/snacks.lua delete mode 100644 lua/kickstart/plugins/neo-tree.lua diff --git a/README.md b/README.md index 800ca990..95fec7f7 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ A starting point for Neovim that is: -* Small -* Single-file -* Completely Documented +- Small +- Single-file +- Completely Documented **NOT** a Neovim distribution, but instead a starting point for your configuration. @@ -14,7 +14,7 @@ A starting point for Neovim that is: ### Install Neovim -Kickstart.nvim targets *only* the latest +Kickstart.nvim targets _only_ the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions. @@ -22,6 +22,7 @@ If you are experiencing issues, please make sure you have the latest versions. ### Install External Dependencies External Requirements: + - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) - Clipboard tool (xclip/xsel/win32yank or other depending on platform) @@ -38,16 +39,15 @@ External Requirements: ### Install Kickstart -> **NOTE** -> [Backup](#FAQ) your previous configuration (if any exists) +> **NOTE** > [Backup](#FAQ) your previous configuration (if any exists) Neovim's configurations are located under the following paths, depending on your OS: -| OS | PATH | -| :- | :--- | -| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| Windows (cmd)| `%localappdata%\nvim\` | -| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` | +| OS | PATH | +| :------------------- | :---------------------------------------- | +| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | +| Windows (cmd) | `%localappdata%\nvim\` | +| Windows (powershell) | `$env:LOCALAPPDATA\nvim\` | #### Recommended Step @@ -64,6 +64,7 @@ too - it's ignored in the kickstart repo to make maintenance easier, but it's [recommmended to track it in version control](https://lazy.folke.io/usage/lockfile). #### Clone kickstart.nvim + > **NOTE** > If following the recommended step above (i.e., forking the repo), replace > `nvim-lua` with `` in the commands below @@ -107,19 +108,18 @@ Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim. That also includes examples of adding popularly requested plugins. - ### Getting Started [The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) ### FAQ -* What should I do if I already have a pre-existing neovim configuration? - * You should back it up and then delete all associated files. - * This includes your existing init.lua and the neovim files in `~/.local` +- What should I do if I already have a pre-existing neovim configuration? + - You should back it up and then delete all associated files. + - This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` -* Can I keep my existing configuration in parallel to kickstart? - * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` +- Can I keep my existing configuration in parallel to kickstart? + - Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example, you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias: ``` @@ -129,18 +129,18 @@ examples of adding popularly requested plugins. config directory and the matching local directory `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. -* What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information -* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? - * The main purpose of kickstart is to serve as a teaching tool and a reference +- What if I want to "uninstall" this configuration: + - See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information +- Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? + - The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily use to `git clone` as a basis for their own. As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. A fork of kickstart that does this while maintaining the + into smaller parts. A fork of kickstart that does this while maintaining the same functionality is available here: - * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) - * Discussions on this topic can be found here: - * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) - * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) + - [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) + - Discussions on this topic can be found here: + - [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) + - [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) ### Install Recipes @@ -150,35 +150,26 @@ After installing all the dependencies continue with the [Install Kickstart](#Ins #### Windows Installation -
Windows with Microsoft C++ Build Tools and CMake -Installation may require installing build tools and updating the run command for `telescope-fzf-native` - -See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) - -This requires: - -- Install CMake and the Microsoft C++ Build Tools on Windows - -```lua -{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } -```
Windows with gcc/make using chocolatey Alternatively, one can install gcc and make which don't require changing the config, the easiest way is to use choco: 1. install [chocolatey](https://chocolatey.org/install) -either follow the instructions on the page or use winget, -run in cmd as **admin**: + either follow the instructions on the page or use winget, + run in cmd as **admin**: + ``` winget install --accept-source-agreements chocolatey.chocolatey ``` 2. install all requirements using choco, exit previous cmd and -open a new one so that choco path is set, and run in cmd as **admin**: + open a new one so that choco path is set, and run in cmd as **admin**: + ``` choco install -y neovim git ripgrep wget fd unzip gzip mingw make ``` +
WSL (Windows Subsystem for Linux) @@ -189,9 +180,11 @@ sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo apt update sudo apt install make gcc ripgrep unzip git xclip neovim ``` +
#### Linux Install +
Ubuntu Install Steps ``` @@ -199,6 +192,7 @@ sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo apt update sudo apt install make gcc ripgrep unzip git xclip neovim ``` +
Debian Install Steps @@ -216,12 +210,14 @@ sudo tar -C /opt -xzf nvim-linux64.tar.gz # make it available in /usr/local/bin, distro installs to /usr/bin sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/ ``` +
Fedora Install Steps ``` sudo dnf install -y gcc make git ripgrep fd-find unzip neovim ``` +
Arch Install Steps @@ -229,5 +225,5 @@ sudo dnf install -y gcc make git ripgrep fd-find unzip neovim ``` sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim ``` -
+ diff --git a/init.lua b/init.lua index 3c77ec8a..2c81f7eb 100644 --- a/init.lua +++ b/init.lua @@ -332,150 +332,6 @@ require('lazy').setup({ }, }, }, - - -- NOTE: Plugins can specify dependencies. - -- - -- The dependencies are proper plugin specifications as well - anything - -- you do for a plugin at the top level, you can do for a dependency. - -- - -- Use the `dependencies` key to specify the dependencies of a particular plugin - - { -- Fuzzy Finder (files, lsp, etc) - 'nvim-telescope/telescope.nvim', - event = 'VimEnter', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - { -- If encountering errors, see telescope-fzf-native README for installation instructions - 'nvim-telescope/telescope-fzf-native.nvim', - - -- `build` is used to run some command when the plugin is installed/updated. - -- This is only run then, not every time Neovim starts up. - build = 'make', - - -- `cond` is a condition used to determine whether this plugin should be - -- installed and loaded. - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - - -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, - }, - config = function() - -- Telescope is a fuzzy finder that comes with a lot of different things that - -- it can fuzzy find! It's more than just a "file finder", it can search - -- many different aspects of Neovim, your workspace, LSP, and more! - -- - -- The easiest way to use Telescope, is to start by doing something like: - -- :Telescope help_tags - -- - -- After running this command, a window will open up and you're able to - -- type in the prompt window. You'll see a list of `help_tags` options and - -- a corresponding preview of the help. - -- - -- Two important keymaps to use while in Telescope are: - -- - Insert mode: - -- - Normal mode: ? - -- - -- This opens a window that shows you all of the keymaps for the current - -- Telescope picker. This is really useful to discover what Telescope can - -- do as well as how to actually do it! - - -- [[ Configure Telescope ]] - -- See `:help telescope` and `:help telescope.setup()` - local actions = require 'telescope.actions' - require('telescope').setup { - -- You can put your default mappings / updates / etc. in here - -- All the info you're looking for is in `:help telescope.setup()` - -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} - require('telescope').setup { - pickers = { - find_files = { - follow = true, - cache_picker = false, - }, - buffers = { - cache_picker = false, - }, - }, - defaults = { - cache_picker = { - num_pickers = 8, - }, - mappings = { - i = { - [''] = actions.close, - }, - }, - layout_strategy = 'horizontal', - layout_config = { - horizontal = { - prompt_position = 'top', - }, - }, - sorting_strategy = 'ascending', - }, - }, - extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown(), - }, - }, - } - - -- Enable Telescope extensions if they are installed - pcall(require('telescope').load_extension, 'fzf') - pcall(require('telescope').load_extension, 'ui-select') - - -- See `:help telescope.builtin` - local builtin = require 'telescope.builtin' - vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) - vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) - vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - vim.keymap.set('n', '', builtin.find_files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - vim.keymap.set('n', '', builtin.resume, { desc = '[S]earch [R]esume' }) - - -- Slightly advanced example of overriding default behavior and theme - vim.keymap.set('n', '/', function() - -- You can pass additional configuration po Telescope to change the theme, layout, etc. - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) - end, { desc = '[/] Fuzzily search in current buffer' }) - - -- It's also possible to pass additional configuration options. - -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set('n', 's/', function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, { desc = '[S]earch [/] in Open Files' }) - - -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) - end, - }, - -- LSP Plugins { -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins diff --git a/lua/custom/plugins/bufremove.lua b/lua/custom/plugins/bufremove.lua deleted file mode 100644 index 7f0b5831..00000000 --- a/lua/custom/plugins/bufremove.lua +++ /dev/null @@ -1,39 +0,0 @@ -local function miniDeleteBuffer() - local bd = require('mini.bufremove').delete - if vim.bo.modified then - local choice = vim.fn.confirm(('Save changes to %q?'):format(vim.fn.bufname()), '&Yes\n&No\n&Cancel') - if choice == 1 then -- Yes - vim.cmd.write() - bd(0) - elseif choice == 2 then -- No - bd(0, true) - end - else - bd(0) - end -end - -return { - { - 'echasnovski/mini.bufremove', - keys = { - { - 'bd', - miniDeleteBuffer, - desc = 'Delete Buffer', - }, - { - 'œ', - miniDeleteBuffer, - desc = 'Delete Buffer', - }, - { - '', - miniDeleteBuffer, - desc = 'Delete Buffer', - }, - -- stylua: ignore - { "bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" }, - }, - }, -} diff --git a/lua/custom/plugins/git.lua b/lua/custom/plugins/git.lua deleted file mode 100644 index 449b0406..00000000 --- a/lua/custom/plugins/git.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - 'FabijanZulj/blame.nvim', - config = function() - require('blame').setup() - end, -} diff --git a/lua/custom/plugins/lspconfig.lua b/lua/custom/plugins/lspconfig.lua index b661bdea..42e0beb4 100644 --- a/lua/custom/plugins/lspconfig.lua +++ b/lua/custom/plugins/lspconfig.lua @@ -57,31 +57,6 @@ return { vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - - -- Find references for the word under your cursor. - map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - map('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - -- Rename the variable under your cursor. -- Most Language Servers support renaming across files, etc. map('rn', vim.lsp.buf.rename, '[R]e[n]ame') diff --git a/lua/custom/plugins/nvimtree.lua b/lua/custom/plugins/nvimtree.lua deleted file mode 100644 index f72be33e..00000000 --- a/lua/custom/plugins/nvimtree.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - 'nvim-neo-tree/neo-tree.nvim', - branch = 'v3.x', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information - }, - opts = { - window = { - width = 34, - mappings = { - [''] = 'open_vsplit', - [''] = 'open_split', - }, - }, - }, -} diff --git a/lua/custom/plugins/snacks.lua b/lua/custom/plugins/snacks.lua new file mode 100644 index 00000000..0c3bad73 --- /dev/null +++ b/lua/custom/plugins/snacks.lua @@ -0,0 +1,569 @@ +return { + 'folke/snacks.nvim', + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + bigfile = { enabled = true }, + dashboard = { enabled = false }, + explorer = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + notifier = { + enabled = true, + timeout = 3000, + }, + picker = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = false }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + styles = { + notification = { + -- wo = { wrap = true } -- Wrap notifications + }, + }, + }, + keys = { + -- Top Pickers & Explorer + { + '', + function() + Snacks.picker.smart() + end, + desc = 'Smart Find Files', + }, + { + '', + function() + Snacks.picker.smart() + end, + desc = 'Smart Find Files', + }, + { + '/', + function() + Snacks.picker.grep() + end, + desc = 'Grep', + }, + { + 's:', + function() + Snacks.picker.command_history() + end, + desc = 'Command History', + }, + { + 'n', + function() + Snacks.picker.notifications() + end, + desc = 'Notification History', + }, + { + 'ue', + function() + Snacks.explorer() + end, + desc = 'File Explorer', + }, + { + ',n', + function() + Snacks.explorer() + end, + desc = 'File Explorer', + }, + -- find + { + 'fb', + function() + Snacks.picker.buffers() + end, + desc = 'Buffers', + }, + { + '', + function() + Snacks.picker.buffers() + end, + desc = 'Buffers', + }, + { + 'fc', + function() + Snacks.picker.files { cwd = vim.fn.stdpath 'config' } + end, + desc = 'Find Config File', + }, + { + 'ff', + function() + Snacks.picker.files() + end, + desc = 'Find Files', + }, + -- { + -- '', + -- function() + -- Snacks.picker.files() + -- end, + -- desc = 'Find Files', + -- }, + { + 'fg', + function() + Snacks.picker.git_files() + end, + desc = 'Find Git Files', + }, + { + 'fp', + function() + Snacks.picker.projects() + end, + desc = 'Projects', + }, + { + 'fr', + function() + Snacks.picker.recent() + end, + desc = 'Recent', + }, + -- git + { + 'gb', + function() + Snacks.picker.git_branches() + end, + desc = 'Git Branches', + }, + { + 'gl', + function() + Snacks.picker.git_log() + end, + desc = 'Git Log', + }, + { + 'gL', + function() + Snacks.picker.git_log_line() + end, + desc = 'Git Log Line', + }, + { + 'gs', + function() + Snacks.picker.git_status() + end, + desc = 'Git Status', + }, + { + 'gS', + function() + Snacks.picker.git_stash() + end, + desc = 'Git Stash', + }, + { + 'gd', + function() + Snacks.picker.git_diff() + end, + desc = 'Git Diff (Hunks)', + }, + { + 'gf', + function() + Snacks.picker.git_log_file() + end, + desc = 'Git Log File', + }, + -- Grep + { + 'sb', + function() + Snacks.picker.lines() + end, + desc = 'Buffer Lines', + }, + { + 'sB', + function() + Snacks.picker.grep_buffers() + end, + desc = 'Grep Open Buffers', + }, + { + 'sg', + function() + Snacks.picker.grep() + end, + desc = 'Grep', + }, + { + 'sw', + function() + Snacks.picker.grep_word() + end, + desc = 'Visual selection or word', + mode = { 'n', 'x' }, + }, + -- search + { + 's"', + function() + Snacks.picker.registers() + end, + desc = 'Registers', + }, + { + 's/', + function() + Snacks.picker.search_history() + end, + desc = 'Search History', + }, + { + 'sa', + function() + Snacks.picker.autocmds() + end, + desc = 'Autocmds', + }, + { + 'sb', + function() + Snacks.picker.lines() + end, + desc = 'Buffer Lines', + }, + { + 'sc', + function() + Snacks.picker.command_history() + end, + desc = 'Command History', + }, + { + 'sC', + function() + Snacks.picker.commands() + end, + desc = 'Commands', + }, + { + 'sd', + function() + Snacks.picker.diagnostics() + end, + desc = 'Diagnostics', + }, + { + 'sD', + function() + Snacks.picker.diagnostics_buffer() + end, + desc = 'Buffer Diagnostics', + }, + { + 'sh', + function() + Snacks.picker.help() + end, + desc = 'Help Pages', + }, + { + 'sH', + function() + Snacks.picker.highlights() + end, + desc = 'Highlights', + }, + { + 'si', + function() + Snacks.picker.icons() + end, + desc = 'Icons', + }, + { + 'sj', + function() + Snacks.picker.jumps() + end, + desc = 'Jumps', + }, + { + 'sk', + function() + Snacks.picker.keymaps() + end, + desc = 'Keymaps', + }, + { + 'sl', + function() + Snacks.picker.loclist() + end, + desc = 'Location List', + }, + { + 'sm', + function() + Snacks.picker.marks() + end, + desc = 'Marks', + }, + { + 'sM', + function() + Snacks.picker.man() + end, + desc = 'Man Pages', + }, + { + 'sp', + function() + Snacks.picker.lazy() + end, + desc = 'Search for Plugin Spec', + }, + { + 'sq', + function() + Snacks.picker.qflist() + end, + desc = 'Quickfix List', + }, + { + 'sR', + function() + Snacks.picker.resume() + end, + desc = 'Resume', + }, + { + '', + function() + Snacks.picker.resume() + end, + desc = 'Resume', + }, + { + 'su', + function() + Snacks.picker.undo() + end, + desc = 'Undo History', + }, + { + 'uC', + function() + Snacks.picker.colorschemes() + end, + desc = 'Colorschemes', + }, + -- LSP + { + 'gd', + function() + Snacks.picker.lsp_definitions() + end, + desc = 'Goto Definition', + }, + { + 'gD', + function() + Snacks.picker.lsp_declarations() + end, + desc = 'Goto Declaration', + }, + { + 'gr', + function() + Snacks.picker.lsp_references() + end, + nowait = true, + desc = 'References', + }, + { + 'gI', + function() + Snacks.picker.lsp_implementations() + end, + desc = 'Goto Implementation', + }, + { + 'gy', + function() + Snacks.picker.lsp_type_definitions() + end, + desc = 'Goto T[y]pe Definition', + }, + { + 'ss', + function() + Snacks.picker.lsp_symbols() + end, + desc = 'LSP Symbols', + }, + { + 'sS', + function() + Snacks.picker.lsp_workspace_symbols() + end, + desc = 'LSP Workspace Symbols', + }, + -- Other + { + 'tz', + function() + Snacks.zen() + end, + desc = 'Toggle Zen Mode', + }, + { + 'tZ', + function() + Snacks.zen.zoom() + end, + desc = 'Toggle Zoom', + }, + { + ',S', + function() + Snacks.scratch() + end, + desc = 'Toggle Scratch Buffer', + }, + { + ',s', + function() + Snacks.scratch.select() + end, + desc = 'Select Scratch Buffer', + }, + { + 'n', + function() + Snacks.notifier.show_history() + end, + desc = 'Notification History', + }, + { + 'bd', + function() + Snacks.bufdelete() + end, + desc = 'Delete Buffer', + }, + { + 'œ', + function() + Snacks.bufdelete() + end, + desc = 'Delete Buffer', + }, + { + '', + function() + Snacks.bufdelete() + end, + desc = 'Delete Buffer', + }, + { + 'cR', + function() + Snacks.rename.rename_file() + end, + desc = 'Rename File', + }, + { + 'gB', + function() + Snacks.gitbrowse() + end, + desc = 'Git Browse', + mode = { 'n', 'v' }, + }, + { + 'gg', + function() + Snacks.lazygit() + end, + desc = 'Lazygit', + }, + { + 'un', + function() + Snacks.notifier.hide() + end, + desc = 'Dismiss All Notifications', + }, + { + ']]', + function() + Snacks.words.jump(vim.v.count1) + end, + desc = 'Next Reference', + mode = { 'n', 't' }, + }, + { + '[[', + function() + Snacks.words.jump(-vim.v.count1) + end, + desc = 'Prev Reference', + mode = { 'n', 't' }, + }, + { + 'uN', + desc = 'Neovim News', + function() + Snacks.win { + file = vim.api.nvim_get_runtime_file('doc/news.txt', false)[1], + width = 0.6, + height = 0.6, + wo = { + spell = false, + wrap = false, + signcolumn = 'yes', + statuscolumn = ' ', + conceallevel = 3, + }, + } + end, + }, + }, + init = function() + vim.api.nvim_create_autocmd('User', { + pattern = 'VeryLazy', + callback = function() + -- Setup some globals for debugging (lazy-loaded) + -- _G.dd = function(...) + -- Snacks.debug.inspect(...) + -- end + -- _G.bt = function() + -- Snacks.debug.backtrace() + -- end + -- vim.print = _G.dd -- Override print to use snacks for `:=` command + + -- Create some toggle mappings + Snacks.toggle.option('spell', { name = 'Spelling' }):map 'ts' + Snacks.toggle.option('wrap', { name = 'Wrap' }):map 'tW' + Snacks.toggle.diagnostics():map 'ud' + Snacks.toggle.option('conceallevel', { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map 'uc' + Snacks.toggle.treesitter():map 'uT' + Snacks.toggle.option('background', { off = 'light', on = 'dark', name = 'Dark Background' }):map 'ub' + Snacks.toggle.inlay_hints():map 'uh' + Snacks.toggle.indent():map 'ug' + Snacks.toggle.dim():map 'uD' + end, + }) + end, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua deleted file mode 100644 index bd442269..00000000 --- a/lua/kickstart/plugins/neo-tree.lua +++ /dev/null @@ -1,25 +0,0 @@ --- Neo-tree is a Neovim plugin to browse the file system --- https://github.com/nvim-neo-tree/neo-tree.nvim - -return { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - }, - cmd = 'Neotree', - keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, - }, - opts = { - filesystem = { - window = { - mappings = { - ['\\'] = 'close_window', - }, - }, - }, - }, -}