summaryrefslogtreecommitdiff
path: root/lua/bee/init.lua
blob: a4c4a63b3b5c905fb18e84c8aec772e4312990c2 (plain)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
local MP = ...
do
    local ok
    ok, _G.nixInfo = pcall(require, vim.g.nix_info_plugin_name)
    if not ok then
        package.loaded[vim.g.nix_info_plugin_name] = setmetatable({}, {
            __call = function(_, default)
                return default
            end,
        })
        _G.nixInfo = require(vim.g.nix_info_plugin_name)
    end
    nixInfo.isNix = vim.g.nix_info_plugin_name ~= nil
    nixInfo.utils = require(MP:relpath("utils"))
    nixInfo.lze = setmetatable(require("lze"), getmetatable(require("lzextras")))
    function nixInfo.get_nix_plugin_path(name)
        return nixInfo(nil, "plugins", "lazy", name) or nixInfo(nil, "plugins", "start", name)
    end
end

nixInfo.lze.register_handlers({
    nixInfo.utils.auto_enable_handler,
    nixInfo.utils.for_cat_handler,
    nixInfo.lze.lsp,
})
nixInfo.lze.h.lsp.set_ft_fallback(nixInfo.utils.lsp_ft_fallback)
nixInfo.lze.load({
    { import = MP:relpath("plugins") },
    { import = MP:relpath("format") },
    { import = MP:relpath("lint") },
    { import = MP:relpath("LSPs") },
    {
        "vim-startuptime",
        auto_enable = true,
        cmd = { "StartupTime" },
        before = function(_)
            vim.g.startuptime_event_width = 0
            vim.g.startuptime_tries = 10
            vim.g.startuptime_exe_path = nixInfo(vim.v.progpath, "progpath")
        end,
    },
    {
        "tokyonight.nvim",
        auto_enable = true,
        colorscheme = { "tokyonight", "tokyonight-day", "tokyonight-moon", "tokyonight-storm", "tokyonight-night" },
    },
    {

        "kanagawa.nvim",
        auto_enable = true,
        colorscheme = { "kanagawa", "kanagawa-dragon", "kanagawa-lotus" },
        after = function(_)
            require("kanagawa").setup({
                compile = false, -- idk why but it loads faster with it disabled
                theme = "dragon",
                background = {
                    dark = "dragon",
                    light = "lotus",
                },
            })
        end,
    },
    {
        "kanagawa-paper.nvim",
        auto_enable = true,
        colorscheme = { "kanagawa-paper", "kanagawa-paper-ink", "kanagawa-paper-canvas" },
        after = function(_)
            require("kanagawa-paper").setup({
                cache = true,
                gutter = true,
                styles = {
                    comment = { italic = true },
                    functions = { italic = false },
                    keyword = { italic = true, bold = false },
                    statement = { italic = true, bold = false },
                    type = { italic = false },
                },
            })
        end,
    },
    {
        "nvim-surround",
        auto_enable = true,
        event = "DeferredUIEnter",
        before = function(_)
            vim.g.nvim_surround_no_mappings = true
        end,
        after = function(_)
            require("nvim-surround").setup({
                keymaps = false,
            })
            vim.keymap.set("i", "<C-g>s", "<Plug>(nvim-surround-insert)", {
                desc = "Add a surrounding pair around the cursor (insert mode)",
            })
            vim.keymap.set("i", "<C-g>S", "<Plug>(nvim-surround-insert-line)", {
                desc = "Add a surrounding pair around the cursor, on new lines (insert mode)",
            })
            vim.keymap.set("n", "sa", "<Plug>(nvim-surround-normal)", {
                desc = "Add a surrounding pair around a motion (normal mode)",
            })
            vim.keymap.set("n", "saa", "<Plug>(nvim-surround-normal-cur)", {
                desc = "Add a surrounding pair around the current line (normal mode)",
            })
            vim.keymap.set("n", "sA", "<Plug>(nvim-surround-normal-line)", {
                desc = "Add a surrounding pair around a motion, on new lines (normal mode)",
            })
            vim.keymap.set("n", "sAA", "<Plug>(nvim-surround-normal-cur-line)", {
                desc = "Add a surrounding pair around the current line, on new lines (normal mode)",
            })
            vim.keymap.set("x", "S", "<Plug>(nvim-surround-visual)", {
                desc = "Add a surrounding pair around a visual selection",
            })
            vim.keymap.set("x", "gS", "<Plug>(nvim-surround-visual-line)", {
                desc = "Add a surrounding pair around a visual selection, on new lines",
            })
            vim.keymap.set("n", "sd", "<Plug>(nvim-surround-delete)", {
                desc = "Delete a surrounding pair",
            })
            vim.keymap.set("n", "cs", "<Plug>(nvim-surround-change)", {
                desc = "Change a surrounding pair",
            })
            vim.keymap.set("n", "cS", "<Plug>(nvim-surround-change-line)", {
                desc = "Change a surrounding pair, putting replacements on new lines",
            })
        end,
    },
})