all repos

init.lua @ 41aaa7b

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
97
98
99
100
101
102
local map = require("core.utils").smap
return {
  {
    "mbbill/undotree",
    cmd = "UndotreeToggle",
    keys = { { "<leader>u", vim.cmd.UndotreeToggle } },
    init = function()
      vim.g.undotree_DiffAutoOpen = 0
    end,
  },

  {
    "ThePrimeagen/harpoon",
    branch = "harpoon2",
    -- selene: allow(multiple_statements)
    -- stylua: ignore start
    keys = { 
      { "<leader>a", function() require"harpoon":list():append() 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 },
    },
    -- style: ignore end
    config = function()
      require"harpoon":setup { settings = {
        save_on_toggle = true,
        sync_on_close = true,
      } }
    end,
  },

  {
    "stevearc/oil.nvim",
    event = "VeryLazy",
    keys = { { "<leader>e", map("oil", "open") } },
    opts = {
      columns = { "icon" },
      delete_to_trash = true,
      skip_confirm_for_simple_edits = true,
      lsp_rename_autosave = true,
      use_default_keymaps = false,
      keymaps = {
        ["?"] = "actions.show_help",
        ["."] = "actions.toggle_hidden",

        ["<CR>"] = "actions.select",
        ["<tab>"] = "actions.select",

        ["<C-v>"] = "actions.select_vsplit",
        ["<C-x>"] = "actions.select_split",
        ["<A-p>"] = "actions.preview",
        ["<C-r>"] = "actions.refresh",
        ["<C-c>"] = "actions.close",
        ["<C-[>"] = "actions.close",

        ["-"] = "actions.parent",
        ["_"] = "actions.open_cwd",
        [","] = "actions.parent",

        ["\\"] = "actions.cd",
        ["C-\\"] = "actions.tcd",
        ["`"] = "actions.cd",
        ["~"] = "actions.tcd",
      },
      view_options = {
        show_hidden = false,
        is_always_hidden = function(name, _)
          if
            ({
              [".."] = {}, -- annoying as hell
              [".git"] = {},
              [".docker"] = {},
              ["tmp"] = {},
              ["build"] = {},
              ["dist"] = {},
              ["node_modules"] = {},
              ["__pycache__"] = {},
              ["target"] = {},
            })[name]
          then
            return true
          end
          return false
        end,
        is_hidden_file = function(name, _)
          if
            ({
              ["vendor"] = {},
              [".vscode"] = {},
              [".bin"] = {},
            })[name]
          then
            return true
          end
          return vim.startswith(name, ".")
        end,
      },
    },
  },
}