feat: use more of snack's features and remove other plugins
This commit is contained in:
@@ -3,13 +3,21 @@ This repository contains my NeoVim configs, including some of my snippets.
|
||||
|
||||
It uses Lazy.nvim as the plugin manager, lspconfig for the language server configuration, none-ls for formatting, telescope, tree-sitter and many other plugins. Partially documented and fairly well organized
|
||||
|
||||
|
||||
## Update
|
||||
A new version of these configs is in the works, removing many plugins that are now all consolidated in Snacks
|
||||
Lazy.nvim might be replaced with NeoVim's native 0.12+ package manager
|
||||
|
||||
|
||||
## Linter configs
|
||||
You may find the linter configs and setup-scripts for some linters that require some extra setup [here](https://git.janishutz.com/janishutz/dotfiles/)
|
||||
|
||||
|
||||
# Lua notes
|
||||
To get your luarocks packages to be picked up by the language server, it is currently configured to only look at the `cwd` that nvim is open in.
|
||||
I may expand that in the future to do a proper search for all open buffers, but that would require a language server restart to apply on every buffer add
|
||||
|
||||
|
||||
# Issues with jdtls
|
||||
Ensure you have jdk21-opnejdk or newer installed. On Arch (and derivatives) you can switch the preferred java version using `archlinux-java set <version name>`
|
||||
|
||||
|
||||
@@ -124,8 +124,6 @@ keymap.set({ "n", "v" }, "<leader>P", '"+P', opts("PASTE from system clipboard")
|
||||
keymap.set({ "n", "v" }, "<leader><leader>d", '"+d', opts("yank to system clipboard and delete"))
|
||||
keymap.set({ "n", "v" }, "<leader><leader>D", '"+D', opts("YANK to system clipboard and DELETE"))
|
||||
|
||||
keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))
|
||||
|
||||
-- Toggle relative line numbers
|
||||
keymap.set(
|
||||
"n",
|
||||
|
||||
@@ -1,333 +0,0 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>e", "<Cmd>Neotree<CR>", desc = "Open Neotree" },
|
||||
{
|
||||
"<leader><leader>gg",
|
||||
"<Cmd>Neotree source=git_status position=float<CR>",
|
||||
desc = "Open git view",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
use_default_mappings = false,
|
||||
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
|
||||
open_files_using_relative_paths = false,
|
||||
sort_case_insensitive = false, -- used when sorting files and directories in the tree
|
||||
-- sort_function = nil, -- use a custom function for sorting files and directories in the tree
|
||||
sort_function = function(a, b) -- natural sort
|
||||
if a.type == b.type then
|
||||
local ap = a.path:lower()
|
||||
local bp = b.path:lower()
|
||||
|
||||
if ap == bp then
|
||||
return false
|
||||
end
|
||||
|
||||
for i = 1, math.max(string.len(ap), string.len(bp)), 1 do
|
||||
local l = string.sub(ap, i, -1)
|
||||
local r = string.sub(bp, i, -1)
|
||||
|
||||
if
|
||||
type(tonumber(string.sub(l, 1, 1))) == "number"
|
||||
and type(tonumber(string.sub(r, 1, 1))) == "number"
|
||||
then
|
||||
local l_number = tonumber(string.match(l, "^[0-9]+"))
|
||||
local r_number = tonumber(string.match(r, "^[0-9]+"))
|
||||
|
||||
if l_number ~= r_number then
|
||||
return l_number < r_number
|
||||
end
|
||||
elseif string.sub(l, 1, 1) ~= string.sub(r, 1, 1) then
|
||||
return l < r
|
||||
end
|
||||
end
|
||||
else
|
||||
return a.type < b.type
|
||||
end
|
||||
end,
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true,
|
||||
},
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
padding = 1, -- extra padding on left hand side
|
||||
-- indent guides
|
||||
with_markers = true,
|
||||
indent_marker = "│",
|
||||
last_indent_marker = "└",
|
||||
highlight = "NeoTreeIndentMarker",
|
||||
-- expander config, needed for nesting files
|
||||
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
icon = {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "",
|
||||
provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available
|
||||
if node.type == "file" or node.type == "terminal" then
|
||||
local success, web_devicons = pcall(require, "nvim-web-devicons")
|
||||
local name = node.type == "terminal" and "terminal" or node.name
|
||||
if success then
|
||||
local devicon, hl = web_devicons.get_icon(name)
|
||||
icon.text = devicon or icon.text
|
||||
icon.highlight = hl or icon.highlight
|
||||
end
|
||||
end
|
||||
end,
|
||||
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
|
||||
-- then these will never be used.
|
||||
default = "*",
|
||||
highlight = "NeoTreeFileIcon",
|
||||
},
|
||||
modified = {
|
||||
symbol = "[+]",
|
||||
highlight = "NeoTreeModified",
|
||||
},
|
||||
name = {
|
||||
trailing_slash = true,
|
||||
use_git_status_colors = true,
|
||||
highlight = "NeoTreeFileName",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "+", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
||||
deleted = "✖", -- this can only be used in the git_status source
|
||||
renamed = "", -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
|
||||
file_size = {
|
||||
enabled = true,
|
||||
width = 12, -- width of the column
|
||||
required_width = 64, -- min width of window required to show this column
|
||||
},
|
||||
type = {
|
||||
enabled = true,
|
||||
width = 10, -- width of the column
|
||||
required_width = 122, -- min width of window required to show this column
|
||||
},
|
||||
last_modified = {
|
||||
enabled = true,
|
||||
width = 20, -- width of the column
|
||||
required_width = 88, -- min width of window required to show this column
|
||||
},
|
||||
created = {
|
||||
enabled = true,
|
||||
width = 20, -- width of the column
|
||||
required_width = 110, -- min width of window required to show this column
|
||||
},
|
||||
symlink_target = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
-- A list of functions, each representing a global custom command
|
||||
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
|
||||
-- see `:h neo-tree-custom-commands-global`
|
||||
commands = {},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 40,
|
||||
mapping_options = {
|
||||
noremap = true,
|
||||
nowait = true,
|
||||
},
|
||||
mappings = {
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["<cr>"] = "open",
|
||||
["o"] = "open",
|
||||
["<esc>"] = "cancel", -- close preview or floating neo-tree window
|
||||
["P"] = { "toggle_preview", config = { use_float = true, use_image_nvim = true } },
|
||||
-- Read `# Preview Mode` for more information
|
||||
["l"] = "focus_preview",
|
||||
["S"] = "open_split",
|
||||
["v"] = "open_vsplit",
|
||||
["t"] = "open_tabnew",
|
||||
["w"] = "open_with_window_picker",
|
||||
["C"] = "close_node",
|
||||
-- ['C'] = 'close_all_subnodes',
|
||||
["z"] = "close_all_nodes",
|
||||
--["Z"] = "expand_all_nodes",
|
||||
["q"] = "close_window",
|
||||
["R"] = "refresh",
|
||||
["?"] = "show_help",
|
||||
["<"] = "prev_source",
|
||||
[">"] = "next_source",
|
||||
["i"] = "show_file_details",
|
||||
},
|
||||
},
|
||||
nesting_rules = {},
|
||||
filesystem = {
|
||||
scan_mode = "deep",
|
||||
filtered_items = {
|
||||
visible = false, -- when true, they will just be displayed differently than normal items
|
||||
hide_dotfiles = true,
|
||||
hide_gitignored = true,
|
||||
hide_ignored = true,
|
||||
hide_hidden = true, -- only works on Windows for hidden files/directories
|
||||
hide_by_name = {
|
||||
--"node_modules"
|
||||
},
|
||||
hide_by_pattern = { -- uses glob style patterns
|
||||
--"*.meta",
|
||||
--"*/src/*/tsconfig.json",
|
||||
},
|
||||
always_show = { -- remains visible even if other settings would normally hide it
|
||||
--".gitignored",
|
||||
},
|
||||
always_show_by_pattern = { -- uses glob style patterns
|
||||
--".env*",
|
||||
},
|
||||
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
|
||||
--".DS_Store",
|
||||
--"thumbs.db"
|
||||
},
|
||||
never_show_by_pattern = { -- uses glob style patterns
|
||||
--".null-ls_*",
|
||||
},
|
||||
},
|
||||
follow_current_file = {
|
||||
enabled = true, -- This will find and focus the file in the active buffer every time
|
||||
-- -- the current file is changed while the tree is open.
|
||||
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
||||
},
|
||||
group_empty_dirs = true, -- when true, empty folders will be grouped together
|
||||
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
|
||||
-- in whatever position is specified in window.position
|
||||
-- "open_current", -- netrw disabled, opening a directory opens within the
|
||||
-- window like netrw would, regardless of window.position
|
||||
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
|
||||
use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
|
||||
-- instead of relying on nvim autocmd events.
|
||||
window = {
|
||||
mappings = {
|
||||
["a"] = {
|
||||
"add",
|
||||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
|
||||
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
||||
config = {
|
||||
show_path = "none", -- "none", "relative", "absolute"
|
||||
},
|
||||
},
|
||||
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
|
||||
["d"] = "delete",
|
||||
["r"] = "rename",
|
||||
["b"] = "rename_basename",
|
||||
["y"] = "copy_to_clipboard",
|
||||
["x"] = "cut_to_clipboard",
|
||||
["p"] = "paste_from_clipboard",
|
||||
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
|
||||
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
|
||||
["<bs>"] = "navigate_up",
|
||||
["."] = "set_root",
|
||||
["H"] = "toggle_hidden",
|
||||
["/"] = "fuzzy_finder",
|
||||
["D"] = "fuzzy_finder_directory",
|
||||
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
|
||||
-- ["D"] = "fuzzy_sorter_directory",
|
||||
["f"] = "filter_on_submit",
|
||||
["<c-x>"] = "clear_filter",
|
||||
["[g"] = "prev_git_modified",
|
||||
["]g"] = "next_git_modified",
|
||||
["s"] = {
|
||||
"show_help",
|
||||
nowait = false,
|
||||
config = { title = "Order by", prefix_key = "s" },
|
||||
},
|
||||
["sc"] = { "order_by_created", nowait = false },
|
||||
["sd"] = { "order_by_diagnostics", nowait = false },
|
||||
["sg"] = { "order_by_git_status", nowait = false },
|
||||
["sm"] = { "order_by_modified", nowait = false },
|
||||
["sn"] = { "order_by_name", nowait = false },
|
||||
["ss"] = { "order_by_size", nowait = false },
|
||||
["st"] = { "order_by_type", nowait = false },
|
||||
-- ['<key>'] = function(state) ... end,
|
||||
},
|
||||
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
|
||||
["<down>"] = "move_cursor_down",
|
||||
["<C-n>"] = "move_cursor_down",
|
||||
["<up>"] = "move_cursor_up",
|
||||
["<C-p>"] = "move_cursor_up",
|
||||
["<esc>"] = "close",
|
||||
-- ['<key>'] = function(state, scroll_padding) ... end,
|
||||
},
|
||||
},
|
||||
|
||||
commands = {}, -- Add a custom command or override a global one using the same function name
|
||||
},
|
||||
buffers = {
|
||||
follow_current_file = {
|
||||
enabled = true, -- This will find and focus the file in the active buffer every time
|
||||
-- -- the current file is changed while the tree is open.
|
||||
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
||||
},
|
||||
group_empty_dirs = true, -- when true, empty folders will be grouped together
|
||||
show_unloaded = true,
|
||||
window = {
|
||||
mappings = {
|
||||
["d"] = "buffer_delete",
|
||||
["bd"] = "buffer_delete",
|
||||
["<bs>"] = "navigate_up",
|
||||
["."] = "set_root",
|
||||
["s"] = {
|
||||
"show_help",
|
||||
nowait = false,
|
||||
config = { title = "Order by", prefix_key = "s" },
|
||||
},
|
||||
["sc"] = { "order_by_created", nowait = false },
|
||||
["sd"] = { "order_by_diagnostics", nowait = false },
|
||||
["sm"] = { "order_by_modified", nowait = false },
|
||||
["sn"] = { "order_by_name", nowait = false },
|
||||
["ss"] = { "order_by_size", nowait = false },
|
||||
["st"] = { "order_by_type", nowait = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
git_status = {
|
||||
window = {
|
||||
position = "float",
|
||||
mappings = {
|
||||
["A"] = "git_add_all",
|
||||
["u"] = "git_unstage_file",
|
||||
["a"] = "git_add_file",
|
||||
["r"] = "git_revert_file",
|
||||
["c"] = "git_commit",
|
||||
["p"] = "git_push",
|
||||
["g"] = "git_commit_and_push",
|
||||
["s"] = {
|
||||
"show_help",
|
||||
nowait = false,
|
||||
config = { title = "Order by", prefix_key = "s" },
|
||||
},
|
||||
["sc"] = { "order_by_created", nowait = false },
|
||||
["sd"] = { "order_by_diagnostics", nowait = false },
|
||||
["sm"] = { "order_by_modified", nowait = false },
|
||||
["sn"] = { "order_by_name", nowait = false },
|
||||
["ss"] = { "order_by_size", nowait = false },
|
||||
["st"] = { "order_by_type", nowait = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
return {
|
||||
-- fuzzy finder
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
"nvim-telescope/telescope-live-grep-args.nvim",
|
||||
-- This will not install any breaking changes.
|
||||
-- For major updates, this must be adjusted manually.
|
||||
version = "^1.0.0",
|
||||
},
|
||||
},
|
||||
event = { "LspAttach" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ff",
|
||||
function()
|
||||
require("telescope.builtin").find_files()
|
||||
end,
|
||||
desc = "Telescope find files",
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>fu",
|
||||
function()
|
||||
require("telescope.builtin").lsp_references()
|
||||
end,
|
||||
desc = "Telescope Usage (references)",
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>flg",
|
||||
function()
|
||||
require("telescope.builtin").live_grep()
|
||||
end,
|
||||
desc = "Telescope live grep",
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>fg",
|
||||
function()
|
||||
require("telescope").extensions.live_grep_args.live_grep_args()
|
||||
end,
|
||||
desc = "Telescope live grep args",
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>fb",
|
||||
function()
|
||||
require("telescope.builtin").buffers()
|
||||
end,
|
||||
desc = "Telescope buffers",
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>fh",
|
||||
function()
|
||||
require("telescope.builtin").help_tags()
|
||||
end,
|
||||
desc = "Telescope nvim functions",
|
||||
},
|
||||
|
||||
{ "<leader>ft", ":TodoTelescope<CR>", desc = "Telescope TODOs" },
|
||||
|
||||
-- Git
|
||||
{
|
||||
"<leader>fld",
|
||||
function()
|
||||
require("telescope.builtin").git_status()
|
||||
end,
|
||||
desc = "Telescope git diff",
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>flc",
|
||||
function()
|
||||
require("telescope.builtin").git_commits()
|
||||
end,
|
||||
desc = "Telescope git commits",
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>flf",
|
||||
function()
|
||||
require("telescope.builtin").git_files()
|
||||
end,
|
||||
desc = "Telescope git files",
|
||||
},
|
||||
|
||||
-- Recent Commands
|
||||
{ "<leader>foc", ":Telescope command_history<CR>", desc = "Telescope recent commands" },
|
||||
|
||||
-- Recent Searches
|
||||
{ "<leader>fos", ":Telescope search_history<CR>", desc = "Telescope recent searches" },
|
||||
|
||||
-- Old Files
|
||||
{
|
||||
"<leader>fr",
|
||||
function()
|
||||
require("telescope.builtin").oldfiles()
|
||||
end,
|
||||
desc = "Telescope recent files",
|
||||
},
|
||||
|
||||
-- Quickfix Items
|
||||
{ "<leader>fq", ":Telescope quickfix<CR>", desc = "Telescope quickfix items" },
|
||||
|
||||
-- Spell Suggestions
|
||||
{ "<leader>fs", ":Telescope spell_suggest<CR>", desc = "Telescope spellsuggestions" },
|
||||
|
||||
-- Diagnostics
|
||||
{ "<leader>fd", ":Telescope diagnostics<CR>", desc = "Telescope Diagnostics" },
|
||||
|
||||
-- Notifications
|
||||
{ "<leader>fn", ":Telescope notify<CR>", desc = "Telescope Notifications" },
|
||||
|
||||
-- Implementations
|
||||
{ "<leader>fi", ":Telescope lsp_implementations<CR>", desc = "Telescope lsp implementations" },
|
||||
|
||||
-- References
|
||||
{
|
||||
"<leader>fu",
|
||||
function()
|
||||
require("telescope.builtin").lsp_references()
|
||||
end,
|
||||
desc = "Telescope Usage (references)",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
local telescope = require("telescope")
|
||||
local lga_actions = require("telescope-live-grep-args.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-q>"] = actions.smart_add_to_qflist,
|
||||
["<C-A-q>"] = actions.smart_send_to_qflist,
|
||||
["<C-Space>"] = lga_actions.quote_prompt(),
|
||||
},
|
||||
},
|
||||
path_display = { "truncate" },
|
||||
},
|
||||
extensions = {
|
||||
frecency = {
|
||||
db_safe_mode = false,
|
||||
matcher = "fuzzy",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("live_grep_args")
|
||||
end,
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
return {
|
||||
-- literally the name, quick term toggle
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
opts = {
|
||||
insert_mappings = false,
|
||||
terminal_mappings = false,
|
||||
open_mapping = "<leader>t",
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<S-Esc>", "<CMD>ToggleTerm<CR>", desc = "Close Terminal", mode = "t" }, -- close terminal wih esc
|
||||
{ "<leader>t", "<CMD>ToggleTerm<CR>", desc = "Open Terminal" }, -- close terminal wih esc
|
||||
},
|
||||
}
|
||||
@@ -6,5 +6,17 @@ return {
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
opts = {},
|
||||
opts = {
|
||||
preset = "modern"
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Start Which-Key",
|
||||
mode = "n"
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
animate = { enabled = true },
|
||||
bigfile = { enabled = true },
|
||||
bufdelete = { enabled = true },
|
||||
dashboard = require("plugins.snacks.modules.dashboard"),
|
||||
indent = {
|
||||
enabled = true,
|
||||
indent = {
|
||||
enabled = true,
|
||||
priority = 1,
|
||||
char = "▎",
|
||||
},
|
||||
animate = {
|
||||
enabled = false,
|
||||
},
|
||||
scope = {
|
||||
char = "▎",
|
||||
},
|
||||
},
|
||||
lazygit = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
},
|
||||
keys = require("plugins.snacks.keys"),
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
return {
|
||||
-- Git
|
||||
{
|
||||
"<leader><leader>gl",
|
||||
function()
|
||||
Snacks.lazygit()
|
||||
end,
|
||||
desc = "Open LazyGit",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader><leader>gb",
|
||||
function()
|
||||
Snacks.git.blame_line()
|
||||
end,
|
||||
desc = "Open Git Blame for this line",
|
||||
mode = "n",
|
||||
},
|
||||
-- Colours
|
||||
{
|
||||
"<leader>fcs",
|
||||
function()
|
||||
Snacks.picker.highlights({ pattern = "hl_group:^Snacks" })
|
||||
end,
|
||||
desc = "Show Snacks highlights",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fca",
|
||||
function()
|
||||
Snacks.picker.highlights()
|
||||
end,
|
||||
desc = "Show highlight groups",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fci",
|
||||
function()
|
||||
Snacks.picker.icons()
|
||||
end,
|
||||
desc = "Show icons",
|
||||
mode = "n"
|
||||
},
|
||||
-- Terminal
|
||||
{
|
||||
"<leader>t",
|
||||
function()
|
||||
Snacks.terminal()
|
||||
end,
|
||||
desc = "Open terminal",
|
||||
},
|
||||
-- Tree
|
||||
{
|
||||
"<leader>e",
|
||||
function()
|
||||
Snacks.explorer()
|
||||
end,
|
||||
desc = "Open File Tree",
|
||||
mode = "n"
|
||||
},
|
||||
-- Pickers
|
||||
{
|
||||
"<leader>ff",
|
||||
function()
|
||||
Snacks.picker.files()
|
||||
end,
|
||||
desc = "Find file",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fg",
|
||||
function()
|
||||
Snacks.picker.grep()
|
||||
end,
|
||||
desc = "Find file content using grep",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fb",
|
||||
function()
|
||||
Snacks.picker.buffers()
|
||||
end,
|
||||
desc = "Show all buffers",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fch",
|
||||
function()
|
||||
Snacks.picker.command_history()
|
||||
end,
|
||||
desc = "Show command history",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fd",
|
||||
function()
|
||||
Snacks.picker.diagnostics()
|
||||
end,
|
||||
desc = "Show diagnostics",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fm",
|
||||
function()
|
||||
Snacks.picker.git_diff()
|
||||
end,
|
||||
desc = "Show uncommitted diffs",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fh",
|
||||
function()
|
||||
Snacks.picker.help()
|
||||
end,
|
||||
desc = "Show nvim help pages",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fj",
|
||||
function()
|
||||
Snacks.picker.jumps()
|
||||
end,
|
||||
desc = "Show available jumps",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fk",
|
||||
function()
|
||||
Snacks.picker.keymaps()
|
||||
end,
|
||||
desc = "Show keymaps",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>flc",
|
||||
function()
|
||||
Snacks.picker.lsp_config()
|
||||
end,
|
||||
desc = "Show LSP configs",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fld",
|
||||
function()
|
||||
Snacks.picker.lsp_definitions()
|
||||
end,
|
||||
desc = "Show LSP definitions (alias for gd)",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fli",
|
||||
function()
|
||||
Snacks.picker.lsp_implementations()
|
||||
end,
|
||||
desc = "Show LSP implementations (alias for gi)",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>flr",
|
||||
function()
|
||||
Snacks.picker.lsp_references()
|
||||
end,
|
||||
desc = "Show LSP references (alias for gR)",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fls",
|
||||
function()
|
||||
Snacks.picker.lsp_symbols()
|
||||
end,
|
||||
desc = "Show LSP symbols",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>flt",
|
||||
function()
|
||||
Snacks.picker.lsp_type_definitions()
|
||||
end,
|
||||
desc = "Show LSP type definitions",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fn",
|
||||
function()
|
||||
Snacks.picker.notifications()
|
||||
end,
|
||||
desc = "Show notifications",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fp",
|
||||
function()
|
||||
Snacks.picker.projects()
|
||||
end,
|
||||
desc = "Show recent projects",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fr",
|
||||
function()
|
||||
Snacks.picker.recent()
|
||||
end,
|
||||
desc = "Show recent files",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fs",
|
||||
function()
|
||||
Snacks.picker.spelling()
|
||||
end,
|
||||
desc = "Show spelling suggestions",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>fo",
|
||||
function()
|
||||
Snacks.picker.treesitter()
|
||||
end,
|
||||
desc = "Show treesitter details",
|
||||
mode = "n"
|
||||
},
|
||||
-- Close buffer
|
||||
{
|
||||
"<C-x>",
|
||||
function()
|
||||
Snacks.bufdelete()
|
||||
end,
|
||||
desc = "Close buffer",
|
||||
mode = "n",
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
return {
|
||||
enabled = true,
|
||||
sections = {
|
||||
{ section = "header", hl = "SnacksDashboardHeader" },
|
||||
{
|
||||
pane = 2,
|
||||
section = "terminal",
|
||||
cmd = "colorscript -e square",
|
||||
height = 5,
|
||||
padding = 1,
|
||||
},
|
||||
{ section = "keys", hl = "SnacksDashboardPrimary", gap = 1, padding = 1 },
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Recent Files (in project)",
|
||||
section = "recent_files",
|
||||
indent = 2,
|
||||
limit = 5,
|
||||
padding = 1,
|
||||
cwd = true,
|
||||
},
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Projects",
|
||||
section = "projects",
|
||||
indent = 2,
|
||||
padding = 1,
|
||||
limit = 4,
|
||||
},
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Git Status",
|
||||
section = "terminal",
|
||||
enabled = function()
|
||||
return Snacks.git.get_root() ~= nil
|
||||
end,
|
||||
cmd = "git status --short --branch --renames",
|
||||
height = 5,
|
||||
padding = 1,
|
||||
ttl = 5 * 60,
|
||||
indent = 3,
|
||||
},
|
||||
{ section = "startup" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
sources = {
|
||||
explorer = {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
win = {
|
||||
style = "terminal",
|
||||
position = "float",
|
||||
border = "rounded",
|
||||
},
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
-- similar to sticky scroll in vscode
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = "BufRead",
|
||||
opts = {
|
||||
max_lines = 4
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
return {
|
||||
-- Diffview
|
||||
"sindrets/diffview.nvim",
|
||||
keys = {
|
||||
{ "<leader><leader>gd", ":DiffviewOpen<CR>", desc = "Open diffview" },
|
||||
{ "<leader><leader>gf", ":DiffviewFileHistory<CR>", desc = "View file history" },
|
||||
{ "<leader><leader>gc", ":DiffviewClose<CR>", desc = "Close diffview" },
|
||||
{ "<leader><leader>gr", ":DiffviewRefresh<CR>", desc = "Refresh diffview" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
-- Diffview
|
||||
"sindrets/diffview.nvim",
|
||||
keys = {
|
||||
{ "<leader><leader>gdd", ":DiffviewOpen<CR>", desc = "Open diffview" },
|
||||
{ "<leader><leader>gdh", ":DiffviewFileHistory<CR>", desc = "View file history" },
|
||||
{ "<leader><leader>gdc", ":DiffviewClose<CR>", desc = "Close diffview" },
|
||||
{ "<leader><leader>gdr", ":DiffviewRefresh<CR>", desc = "Refresh diffview" },
|
||||
},
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
local utils = require("utils")
|
||||
return {
|
||||
"smoka7/multicursors.nvim",
|
||||
dependencies = {
|
||||
"nvimtools/hydra.nvim",
|
||||
},
|
||||
opts = {},
|
||||
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
|
||||
keys = {
|
||||
{
|
||||
mode = { "v", "n" },
|
||||
"<leader><leader>c",
|
||||
utils.run_vim_cmd("MCstart"),
|
||||
desc = "Create a selection for selected text or word under the cursor",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
animate = { enabled = true },
|
||||
bigfile = { enabled = true },
|
||||
bufdelete = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
sections = {
|
||||
{ section = "header", hl = "SnacksDashboardHeader" },
|
||||
{
|
||||
pane = 2,
|
||||
section = "terminal",
|
||||
cmd = "colorscript -e square",
|
||||
height = 5,
|
||||
padding = 1,
|
||||
},
|
||||
{ section = "keys", hl = "SnacksDashboardPrimary", gap = 1, padding = 1 },
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Recent Files (in project)",
|
||||
section = "recent_files",
|
||||
indent = 2,
|
||||
limit = 5,
|
||||
padding = 1,
|
||||
cwd = true,
|
||||
},
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Projects",
|
||||
section = "projects",
|
||||
indent = 2,
|
||||
padding = 1,
|
||||
limit = 4,
|
||||
},
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Git Status",
|
||||
section = "terminal",
|
||||
enabled = function()
|
||||
return Snacks.git.get_root() ~= nil
|
||||
end,
|
||||
cmd = "git status --short --branch --renames",
|
||||
height = 5,
|
||||
padding = 1,
|
||||
ttl = 5 * 60,
|
||||
indent = 3,
|
||||
},
|
||||
{ section = "startup" },
|
||||
},
|
||||
},
|
||||
indent = {
|
||||
enabled = true,
|
||||
indent = {
|
||||
enabled = true,
|
||||
priority = 1,
|
||||
char = "▎",
|
||||
},
|
||||
animate = {
|
||||
enabled = false,
|
||||
},
|
||||
scope = {
|
||||
char = "▎",
|
||||
},
|
||||
},
|
||||
lazygit = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader><leader>gl",
|
||||
function()
|
||||
Snacks.lazygit()
|
||||
end,
|
||||
desc = "Open LazyGit",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fcs",
|
||||
function()
|
||||
Snacks.picker.highlights({ pattern = "hl_group:^Snacks" })
|
||||
end,
|
||||
desc = "Show Snacks highlights",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fca",
|
||||
function()
|
||||
Snacks.picker.highlights()
|
||||
end,
|
||||
desc = "Show highlight groups",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<C-x>",
|
||||
function()
|
||||
Snacks.bufdelete()
|
||||
end,
|
||||
desc = "Close buffer",
|
||||
mode = "n",
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user