my dotfiles for arch
at main 540 lines 8.3 kB view raw
1return { 2 "folke/snacks.nvim", 3 priority = 1000, 4 lazy = false, 5 opts = { 6 -- your configuration comes here 7 -- or leave it empty to use the default settings 8 -- refer to the configuration section below 9 bigfile = { enabled = true }, 10 notifier = { enabled = true }, 11 quickfile = { enabled = true }, 12 statuscolumn = { enabled = true }, 13 words = { enabled = true }, 14 picker = {}, 15 explorer = {}, 16 }, 17 keys = { 18 { 19 "<leader>.", 20 function() 21 Snacks.scratch() 22 end, 23 desc = "Toggle Scratch Buffer", 24 }, 25 { 26 "<leader>S", 27 function() 28 Snacks.scratch.select() 29 end, 30 desc = "Select Scratch Buffer", 31 }, 32 { 33 "<leader>n", 34 function() 35 Snacks.notifier.show_history() 36 end, 37 desc = "Notification History", 38 }, 39 40 { 41 "<leader>gB", 42 function() 43 Snacks.gitbrowse() 44 end, 45 desc = "Git Browse", 46 }, 47 -- { 48 -- "<leader>gb", 49 -- function() 50 -- Snacks.git.blame_line() 51 -- end, 52 -- desc = "Git Blame Line", 53 -- }, 54 { 55 "<leader>gf", 56 function() 57 Snacks.lazygit.log_file() 58 end, 59 desc = "Lazygit Current File History", 60 }, 61 { 62 "<leader>lg", 63 function() 64 Snacks.lazygit() 65 end, 66 desc = "Lazygit", 67 }, 68 { 69 "<leader>gl", 70 function() 71 Snacks.lazygit.log() 72 end, 73 desc = "Lazygit Log (cwd)", 74 }, 75 { 76 "<leader>dn", 77 function() 78 Snacks.notifier.hide() 79 end, 80 desc = "Dismiss All Notifications", 81 }, 82 { 83 "<c-/>", 84 function() 85 Snacks.terminal() 86 end, 87 desc = "Toggle Terminal", 88 }, 89 { 90 "<c-_>", 91 function() 92 Snacks.terminal() 93 end, 94 desc = "which_key_ignore", 95 }, 96 { 97 "]]", 98 function() 99 Snacks.words.jump(vim.v.count1) 100 end, 101 desc = "Next Reference", 102 mode = { "n", "t" }, 103 }, 104 { 105 "[[", 106 function() 107 Snacks.words.jump(-vim.v.count1) 108 end, 109 desc = "Prev Reference", 110 mode = { "n", "t" }, 111 }, 112 { 113 "<leader>N", 114 desc = "Neovim News", 115 function() 116 Snacks.win({ 117 file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1], 118 width = 0.6, 119 height = 0.6, 120 wo = { 121 spell = false, 122 wrap = false, 123 signcolumn = "yes", 124 statuscolumn = " ", 125 conceallevel = 3, 126 }, 127 }) 128 end, 129 }, 130 -- Snacks Picker 131 -- Top Pickers & Explorer 132 { 133 "<leader><space>", 134 function() 135 Snacks.picker.smart() 136 end, 137 desc = "Smart Find Files", 138 }, 139 { 140 "<leader>,", 141 function() 142 Snacks.picker.buffers() 143 end, 144 desc = "Buffers", 145 }, 146 { 147 "<leader>/", 148 function() 149 Snacks.picker.grep() 150 end, 151 desc = "Grep", 152 }, 153 { 154 "<leader>:", 155 function() 156 Snacks.picker.command_history() 157 end, 158 desc = "Command History", 159 }, 160 { 161 "<leader>n", 162 function() 163 Snacks.picker.notifications() 164 end, 165 desc = "Notification History", 166 }, 167 { 168 "<leader>e", 169 function() 170 Snacks.explorer() 171 end, 172 desc = "File Explorer", 173 }, 174 -- find 175 { 176 "<leader>fb", 177 function() 178 Snacks.picker.buffers() 179 end, 180 desc = "Buffers", 181 }, 182 { 183 "<leader>fc", 184 function() 185 Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) 186 end, 187 desc = "Find Config File", 188 }, 189 { 190 "<leader>ff", 191 function() 192 Snacks.picker.files() 193 end, 194 desc = "Find Files", 195 }, 196 { 197 "<leader>fg", 198 function() 199 Snacks.picker.git_files() 200 end, 201 desc = "Find Git Files", 202 }, 203 { 204 "<leader>fp", 205 function() 206 Snacks.picker.projects() 207 end, 208 desc = "Projects", 209 }, 210 { 211 "<leader>fr", 212 function() 213 Snacks.picker.recent() 214 end, 215 desc = "Recent", 216 }, 217 -- git 218 { 219 "<leader>gb", 220 function() 221 Snacks.picker.git_branches() 222 end, 223 desc = "Git Branches", 224 }, 225 { 226 "<leader>gl", 227 function() 228 Snacks.picker.git_log() 229 end, 230 desc = "Git Log", 231 }, 232 { 233 "<leader>gL", 234 function() 235 Snacks.picker.git_log_line() 236 end, 237 desc = "Git Log Line", 238 }, 239 { 240 "<leader>gs", 241 function() 242 Snacks.picker.git_status() 243 end, 244 desc = "Git Status", 245 }, 246 { 247 "<leader>gS", 248 function() 249 Snacks.picker.git_stash() 250 end, 251 desc = "Git Stash", 252 }, 253 { 254 "<leader>gd", 255 function() 256 Snacks.picker.git_diff() 257 end, 258 desc = "Git Diff (Hunks)", 259 }, 260 { 261 "<leader>gf", 262 function() 263 Snacks.picker.git_log_file() 264 end, 265 desc = "Git Log File", 266 }, 267 -- gh 268 { 269 "<leader>gi", 270 function() 271 Snacks.picker.gh_issue() 272 end, 273 desc = "GitHub Issues (open)", 274 }, 275 { 276 "<leader>gI", 277 function() 278 Snacks.picker.gh_issue({ state = "all" }) 279 end, 280 desc = "GitHub Issues (all)", 281 }, 282 { 283 "<leader>gp", 284 function() 285 Snacks.picker.gh_pr() 286 end, 287 desc = "GitHub Pull Requests (open)", 288 }, 289 { 290 "<leader>gP", 291 function() 292 Snacks.picker.gh_pr({ state = "all" }) 293 end, 294 desc = "GitHub Pull Requests (all)", 295 }, 296 -- Grep 297 { 298 "<leader>sb", 299 function() 300 Snacks.picker.lines() 301 end, 302 desc = "Buffer Lines", 303 }, 304 { 305 "<leader>sB", 306 function() 307 Snacks.picker.grep_buffers() 308 end, 309 desc = "Grep Open Buffers", 310 }, 311 { 312 "<leader>sg", 313 function() 314 Snacks.picker.grep() 315 end, 316 desc = "Grep", 317 }, 318 { 319 "<leader>sw", 320 function() 321 Snacks.picker.grep_word() 322 end, 323 desc = "Visual selection or word", 324 mode = { "n", "x" }, 325 }, 326 -- search 327 { 328 '<leader>s"', 329 function() 330 Snacks.picker.registers() 331 end, 332 desc = "Registers", 333 }, 334 { 335 "<leader>s/", 336 function() 337 Snacks.picker.search_history() 338 end, 339 desc = "Search History", 340 }, 341 { 342 "<leader>sa", 343 function() 344 Snacks.picker.autocmds() 345 end, 346 desc = "Autocmds", 347 }, 348 { 349 "<leader>sb", 350 function() 351 Snacks.picker.lines() 352 end, 353 desc = "Buffer Lines", 354 }, 355 { 356 "<leader>sc", 357 function() 358 Snacks.picker.command_history() 359 end, 360 desc = "Command History", 361 }, 362 { 363 "<leader>sC", 364 function() 365 Snacks.picker.commands() 366 end, 367 desc = "Commands", 368 }, 369 { 370 "<leader>sd", 371 function() 372 Snacks.picker.diagnostics() 373 end, 374 desc = "Diagnostics", 375 }, 376 { 377 "<leader>sD", 378 function() 379 Snacks.picker.diagnostics_buffer() 380 end, 381 desc = "Buffer Diagnostics", 382 }, 383 { 384 "<leader>sh", 385 function() 386 Snacks.picker.help() 387 end, 388 desc = "Help Pages", 389 }, 390 { 391 "<leader>sH", 392 function() 393 Snacks.picker.highlights() 394 end, 395 desc = "Highlights", 396 }, 397 { 398 "<leader>si", 399 function() 400 Snacks.picker.icons() 401 end, 402 desc = "Icons", 403 }, 404 { 405 "<leader>sj", 406 function() 407 Snacks.picker.jumps() 408 end, 409 desc = "Jumps", 410 }, 411 { 412 "<leader>sk", 413 function() 414 Snacks.picker.keymaps() 415 end, 416 desc = "Keymaps", 417 }, 418 { 419 "<leader>sl", 420 function() 421 Snacks.picker.loclist() 422 end, 423 desc = "Location List", 424 }, 425 { 426 "<leader>sm", 427 function() 428 Snacks.picker.marks() 429 end, 430 desc = "Marks", 431 }, 432 { 433 "<leader>sM", 434 function() 435 Snacks.picker.man() 436 end, 437 desc = "Man Pages", 438 }, 439 { 440 "<leader>sp", 441 function() 442 Snacks.picker.lazy() 443 end, 444 desc = "Search for Plugin Spec", 445 }, 446 { 447 "<leader>sq", 448 function() 449 Snacks.picker.qflist() 450 end, 451 desc = "Quickfix List", 452 }, 453 { 454 "<leader>sr", 455 function() 456 Snacks.picker.resume() 457 end, 458 desc = "Resume", 459 }, 460 { 461 "<leader>su", 462 function() 463 Snacks.picker.undo() 464 end, 465 desc = "Undo History", 466 }, 467 { 468 "<leader>uC", 469 function() 470 Snacks.picker.colorschemes() 471 end, 472 desc = "Colorschemes", 473 }, 474 -- LSP 475 { 476 "gd", 477 function() 478 Snacks.picker.lsp_definitions() 479 end, 480 desc = "Goto Definition", 481 }, 482 { 483 "gD", 484 function() 485 Snacks.picker.lsp_declarations() 486 end, 487 desc = "Goto Declaration", 488 }, 489 { 490 "gref", 491 function() 492 Snacks.picker.lsp_references() 493 end, 494 nowait = true, 495 desc = "References", 496 }, 497 { 498 "gI", 499 function() 500 Snacks.picker.lsp_implementations() 501 end, 502 desc = "Goto Implementation", 503 }, 504 { 505 "gy", 506 function() 507 Snacks.picker.lsp_type_definitions() 508 end, 509 desc = "Goto T[y]pe Definition", 510 }, 511 { 512 "gai", 513 function() 514 Snacks.picker.lsp_incoming_calls() 515 end, 516 desc = "C[a]lls Incoming", 517 }, 518 { 519 "gao", 520 function() 521 Snacks.picker.lsp_outgoing_calls() 522 end, 523 desc = "C[a]lls Outgoing", 524 }, 525 { 526 "<leader>ss", 527 function() 528 Snacks.picker.lsp_symbols() 529 end, 530 desc = "LSP Symbols", 531 }, 532 { 533 "<leader>sS", 534 function() 535 Snacks.picker.lsp_workspace_symbols() 536 end, 537 desc = "LSP Workspace Symbols", 538 }, 539 }, 540}