all repos

init.lua @ 50d015e

my nvim config

init.lua/lua/plugins/navigation.lua(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---@type LazySpec
return {
  {
    "mbbill/undotree",
    cmd = "UndotreeToggle",
    keys = { { "<leader>u", vim.cmd.UndotreeToggle } },
    init = function()
      vim.g.undotree_DiffAutoOpen = 0
    end,
  },

  {
    "ThePrimeagen/harpoon",
    branch = "harpoon2",
    keys = function()
      -- stylua: ignore
      return {
        { "<leader>a", function() require("harpoon"):list():add() end },
        { "<C-f>", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end },
        { "<A-f>", function() require("harpoon"):list():select(1) end },
        { "<A-d>", function() require("harpoon"):list():select(2) end },
        { "<A-s>", function() require("harpoon"):list():select(3) end },
        { "<A-a>", function() require("harpoon"):list():select(4) end },
      }
    end,
    ---@type HarpoonPartialConfig
    opts = {
      settings = {
        save_on_toggle = true,
        sync_on_close = true,
      },
    },
    config = function(_, opts)
      require("harpoon"):setup(opts)
    end,
  },

  {
    "stevearc/oil.nvim",
    event = "VeryLazy",
    cmd = "Oil",
    keys = { { "<leader>e", vim.cmd.Oil } },
    ---@module "oil"
    ---@type oil.setupOpts
    opts = {
      columns = { "icon" },
      delete_to_trash = true,
      skip_confirm_for_simple_edits = true,
      lsp_file_methods = { autosave_changes = true },
      use_default_keymaps = false,
      keymaps = {
        ["."] = "actions.toggle_hidden",
        ["<CR>"] = "actions.select",
        ["<tab>"] = "actions.select",
        ["<C-p>"] = "actions.preview",
        ["<C-r>"] = "actions.refresh",
        ["-"] = "actions.open_cwd",
        [";"] = "actions.parent",
        ["\\"] = "actions.cd",
      },
      view_options = {
        show_hidden = false,
        is_always_hidden = function(name, _)
          if
            ({
              [".."] = {}, -- annoying as hell
              [".git"] = {},
              [".docker"] = {},
              ["build"] = {},
              ["dist"] = {},
              ["node_modules"] = {},
              ["__pycache__"] = {},
              ["target"] = {},
            })[name]
          then
            return true
          end
          return false
        end,
        is_hidden_file = function(name, _)
          if
            ({
              ["vendor"] = {},
              [".vscode"] = {},
              [".bin"] = {},
              ["tmp"] = {},
            })[name]
          then
            return true
          end
          return vim.startswith(name, ".")
        end,
      },
    },
  },
}