Skip to content

01. Modules (PlugIns)

Biser Stoilov edited this page Oct 29, 2021 · 7 revisions

Modules (Plug-ins)

1. Default Modules (Plug-ins)

1.1. UI

Lvim colorscheme

lvim-tech/lvim-colorscheme


Init

-- lua/modules/global/init.lua

modules["lvim-tech/lvim-colorscheme"] = {
    event = {
        "VimEnter",
        "BufRead",
        "BufNewFile"
    },
    config = ui_config.lvim_colorscheme
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.lvim_colorscheme()
    vim.cmd("colorscheme lvim")
end
Dashboard nvim

glepnir/dashboard-nvim


Init

-- lua/modules/global/init.lua

modules["glepnir/dashboard-nvim"] = {
    event = "VimEnter",
    config = ui_config.dashboard_nvim
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.dashboard_nvim()
    vim.g.dashboard_custom_header = {
        "       888     Y88b      / 888      e    e             ",
        "       888      Y88b    /  888     d8b  d8b            ",
        "       888       Y88b  /   888    d888bdY88b           ",
        "       888        Y888/    888   / Y88Y Y888b          ",
        "       888         Y8/     888  /   YY   Y888b         ",
        "       888____      Y      888 /          Y888b        "
    }
    vim.g.dashboard_preview_file_height = 12
    vim.g.dashboard_preview_file_width = 80
    vim.g.dashboard_custom_section = {
        a = {
            description = {"     Projects                 "},
            command = "CtrlSpace b"
        },
        b = {
            description = {"     File explorer            "},
            command = "Telescope file_browser"
        },
        c = {
            description = {"     Search file              "},
            command = "Telescope find_files"
        },
        d = {
            description = {"     Search in files          "},
            command = "Telescope live_grep"
        },
        e = {
            description = {"     Help                     "},
            command = ":LvimHelper"
        },
        f = {
            description = {"     Settings                 "},
            command = ":e ~/.config/nvim/lua/configs/global/lvim.lua"
        },
        g = {
            description = {"     Readme                   "},
            command = ":e ~/.config/nvim/README.md"
        }
    }
end
Nvim tree

kyazdani42/nvim-tree.lua (requires kyazdani42/nvim-web-devicons)


Init

-- lua/modules/global/init.lua

modules["kyazdani42/nvim-tree.lua"] = {
    requires = "kyazdani42/nvim-web-devicons",
    cmd = "NvimTreeToggle",
    config = ui_config.nvim_tree
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.nvim_tree()
    vim.g.nvim_tree_show_icons = {
        git = 1,
        folders = 1,
        files = 1,
        folder_arrows = 0
    }
    vim.g.nvim_tree_icons = {
        default = "",
        symlink = "",
        git = {
            unstaged = "",
            staged = "",
            unmerged = "",
            renamed = "",
            untracked = "",
            ignored = ""
        },
        folder = {
            default = "",
            open = "",
            empty = "",
            empty_open = "",
            symlink = ""
        }
    }
    require("nvim-tree").setup {
        disable_netrw = true,
        hijack_netrw = true,
        open_on_setup = false,
        ignore_ft_on_setup = {},
        auto_close = false,
        open_on_tab = false,
        hijack_cursor = false,
        update_cwd = false,
        diagnostics = {
            enable = true,
            icons = {
                error = "",
                warning = "",
                hint = "",
                info = ""
            }
        },
        update_focused_file = {
            enable = true,
            update_cwd = false,
            ignore_list = {}
        },
        system_open = {
            cmd = nil,
            args = {}
        },
        view = {
            width = 30,
            side = "left",
            auto_resize = true,
            mappings = {
                custom_only = false,
                list = {}
            }
        }
    }
end
Nvim whichkey setup

folke/which-key.nvim


Init

-- lua/modules/global/init.lua

modules["folke/which-key.nvim"] = {
    event = "BufWinEnter",
    config = ui_config.which_key
}

Config

function config.which_key()
    local options = {
        plugins = {
            marks = true,
            registers = true,
            presets = {
                operators = false,
                motions = false,
                text_objects = false,
                windows = false,
                nav = false,
                z = false,
                g = false
            },
            spelling = {
                enabled = true,
                suggestions = 20
            }
        },
        icons = {
            breadcrumb = "»",
            separator = "",
            group = "+"
        },
        window = {
            border = "single",
            position = "bottom",
            margin = {
                0,
                0,
                0,
                0
            },
            padding = {
                2,
                2,
                2,
                2
            }
        },
        layout = {
            height = {
                min = 4,
                max = 25
            },
            width = {
                min = 20,
                max = 50
            },
            spacing = 10
        },
        hidden = {"<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ "},
        show_help = true
    }
    local nopts = {
        mode = "n",
        prefix = "<leader>",
        buffer = nil,
        silent = true,
        noremap = true,
        nowait = true
    }
    local vopts = {
        mode = "v",
        prefix = "<leader>",
        buffer = nil,
        silent = true,
        noremap = true,
        nowait = true
    }
    local nmappings = {
        b = {
            name = "Buffers",
            n = {"<Cmd>bnext<CR>", "Next buffer"},
            p = {"<Cmd>bprevious<CR>", "Prev buffer"},
            l = {"<Cmd>Telescope buffers<CR>", "List buffers"}
        },
        d = {
            name = "Database",
            u = {"<Cmd>DBUIToggle<CR>", "DB UI toggle"},
            f = {"<Cmd>DBUIFindBuffer<CR>", "DB find buffer"},
            r = {"<Cmd>DBUIRenameBuffer<CR>", "DB rename buffer"},
            l = {"<Cmd>DBUILastQueryInfo<CR>", "DB last query"}
        },
        p = {
            name = "Packer",
            c = {"<cmd>PackerCompile<CR>", "Compile"},
            i = {"<cmd>PackerInstall<CR>", "Install"},
            s = {"<cmd>PackerSync<CR>", "Sync"},
            S = {"<cmd>PackerStatus<CR>", "Status"},
            u = {"<cmd>PackerUpdate<CR>", "Update"}
        },
        P = {
            name = "Path",
            g = {"<Cmd>SetGlobalPath<CR>", "Set global path"},
            w = {"<Cmd>SetWindowPath<CR>", "Set window path"}
        },
        l = {
            name = "LSP",
            n = {"<Cmd>LspGoToNext<CR>", "Go to next"},
            p = {"<Cmd>LspGoToPrev<CR>", "Go to prev"},
            r = {"<Cmd>LspRename<CR>", "Rename"},
            h = {"<Cmd>LspHover<CR>", "Hover"},
            d = {"<Cmd>LspDefinition<CR>", "Definition"},
            t = {"<Cmd>LspTypeDefinition<CR>", "Type definition"},
            R = {"<Cmd>LspReferences<CR>", "References"},
            a = {"<Cmd>LspCodeAction<CR>", "Code action"},
            f = {"<Cmd>LspFormatting<CR>", "Formatting"},
            s = {"<Cmd>LspFormattingSync<CR>", "Sync formatting"},
            S = {
                name = "Symbol",
                d = {"<Cmd>LspDocumentSymbol<CR>", "Document symbol"},
                w = {"<Cmd>LspWorkspaceSymbol<CR>", "Workspace symbol"}
            },
            w = {
                "<Cmd>LspAddToWorkspaceFolder<CR>",
                "Add to workspace folder"
            },
            v = {
                name = "Virtualtext",
                s = {"<Cmd>LspVirtualTextShow<CR>", "Virtual text show"},
                h = {"<Cmd>LspVirtualTextHide<CR>", "Virtual text hide"}
            }
        },
        g = {
            name = "GIT",
            b = {"<Cmd>GitSignsBlameLine<CR>", "Blame"},
            B = {"<Cmd>GBrowse<CR>", "Browse"},
            d = {"<Cmd>Git diff<CR>", "Diff"},
            n = {"<Cmd>GitSignsNextHunk<CR>", "Next hunk"},
            p = {"<Cmd>GitSignsPrevHunk<CR>", "Prev hunk"},
            l = {"<Cmd>Git log<CR>", "Log"},
            P = {"<Cmd>GitSignsPreviewHunk<CR>", "Preview hunk"},
            r = {"<Cmd>GitSignsResetHunk<CR>", "Reset stage hunk"},
            s = {"<Cmd>GitSignsStageHunk<CR>", "Stage hunk"},
            u = {"<Cmd>GitSignsUndoStageHunk<CR>", "Undo stage hunk"},
            R = {"<Cmd>GitSignsResetBuffer<CR>", "Reset buffer"},
            S = {"<Cmd>Gstatus<CR>", "Status"},
            N = {"<Cmd>Neogit<CR>", "Neogit"}
        },
        m = {
            name = "Bookmark",
            t = {"<Cmd>BookmarkToggle<CR>", "toggle bookmark"},
            n = {"<Cmd>BookmarkNext<CR>", "next bookmark"},
            p = {"<Cmd>BookmarkPrev<CR>", "prev bookmark"}
        },
        f = {
            name = "Fold",
            m = {"<Cmd>:set foldmethod=manual<CR>", "manual (default)"},
            i = {"<Cmd>:set foldmethod=indent<CR>", "indent"},
            e = {"<Cmd>:set foldmethod=expr<CR>", "expr"},
            d = {"<Cmd>:set foldmethod=diff<CR>", "diff"},
            M = {"<Cmd>:set foldmethod=marker<CR>", "marker"}
        },
        s = {
            name = "Spectre",
            d = {
                '<Cmd>lua require("spectre").delete()<CR>',
                "toggle current item"
            },
            g = {
                '<Cmd>lua require("spectre.actions").select_entry()<CR>',
                "goto current file"
            },
            q = {
                '<Cmd>lua require("spectre.actions").send_to_qf()<CR>',
                "send all item to quickfix"
            },
            m = {
                '<Cmd>lua require("spectre.actions").replace_cmd()<CR>',
                "input replace vim command"
            },
            o = {
                '<Cmd>lua require("spectre").show_options()<CR>',
                "show option"
            },
            R = {
                '<Cmd>lua require("spectre.actions").run_replace()<CR>',
                "replace all"
            },
            v = {
                '<Cmd>lua require("spectre").change_view()<CR>',
                "change result view mode"
            },
            c = {
                '<Cmd>lua require("spectre").change_options("ignore-case")<CR>',
                "toggle ignore case"
            },
            h = {
                '<Cmd>lua require("spectre").change_options("hidden")<CR>',
                "toggle search hidden"
            }
        },
        t = {
            name = "Terminal",
            o = {"<Cmd>FloatermShow<CR>", "git"},
            g = {"<Cmd>FloatermNew lazygit<CR>", "git"},
            d = {"<Cmd>FloatermNew lazydocker<CR>", "docker"},
            n = {"<Cmd>FloatermNew lazynpm<CR>", "npm"}
        }
    }
    local vmappings = {
        ["/"] = {":CommentToggle<CR>", "Comment"},
        f = {"<Cmd>LspRangeFormatting<CR>", "Range formatting"}
    }
    local which_key = require "which-key"
    which_key.setup(options)
    which_key.register(nmappings, nopts)
    which_key.register(vmappings, vopts)
end
Galaxyline

NTBBloodbath/galaxyline.nvim (requires kyazdani42/nvim-web-devicons)


Init

-- lua/modules/global/init.lua

modules["NTBBloodbath/galaxyline.nvim"] = {
    requires = "kyazdani42/nvim-web-devicons",
    event = {
        "VimEnter",
        "BufRead",
        "BufNewFile"
    },
    config = ui_config.galaxyline
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.galaxyline()
    local gl = require("galaxyline")
    gl.exclude_filetypes = {"ctrlspace"}
    local colors = {
        bg = "#252A34",
        fg = "#D9DA9E",
        color_0 = "#00839F",
        color_1 = "#1C9898",
        color_2 = "#25B8A5",
        color_3 = "#56adb7",
        color_4 = "#F2994B",
        color_5 = "#E6B673",
        color_6 = "#F05F4E",
        color_7 = "#98c379"
    }
    local condition = require("galaxyline.condition")
    local buffer_not_empty = function()
        if vim.fn.empty(vim.fn.expand("%:t")) ~= 1 then
            return true
        end
        return false
    end
    local gls = gl.section
    gl.short_line_list = {
        "NvimTree",
        "LvimHelper",
        "dashboard",
        "vista",
        "dbui",
        "packer",
        "dapui_scopes",
        "dapui_breakpoints",
        "dapui_stacks",
        "dapui_watches"
    }
    gls.left[1] = {
        ViMode = {
            provider = function()
                local alias = {
                    n = "NORMAL",
                    v = "VISUAL",
                    V = "V-LINE",
                    [""] = "V-BLOCK",
                    s = "SELECT",
                    S = "S-LINE",
                    [""] = "S-BLOCK",
                    i = "INSERT",
                    R = "REPLACE",
                    c = "COMMAND",
                    r = "PROMPT",
                    ["!"] = "EXTERNAL",
                    t = "TERMINAL"
                }
                local mode_color = {
                    n = colors.color_1,
                    v = colors.color_5,
                    V = colors.color_5,
                    [""] = colors.color_5,
                    s = colors.color_5,
                    S = colors.color_5,
                    [""] = colors.color_5,
                    i = colors.color_6,
                    R = colors.color_6,
                    c = colors.color_0,
                    r = colors.color_0,
                    ["!"] = colors.color_0,
                    t = colors.color_0
                }
                local vim_mode = vim.fn.mode()
                vim.api.nvim_command("hi GalaxyViMode guifg=" .. mode_color[vim_mode])
                return alias[vim_mode] .. ""
            end,
            highlight = {
                colors.color_3,
                colors.bg,
                "bold"
            }
        }
    }
    gls.left[2] = {
        FileIcon = {
            provider = "FileIcon",
            condition = buffer_not_empty,
            highlight = {
                colors.fg,
                colors.bg
            }
        }
    }
    gls.left[3] = {
        FileName = {
            provider = "FileName",
            condition = buffer_not_empty,
            separator = " ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.fg,
                colors.bg
            }
        }
    }
    gls.left[4] = {
        GitIcon = {
            provider = function()
                return ""
            end,
            condition = condition.check_git_workspace,
            -- separator = " ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.color_5,
                colors.bg
            }
        }
    }
    gls.left[5] = {
        GitBranch = {
            provider = "GitBranch",
            condition = condition.check_git_workspace,
            separator = " ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.color_5,
                colors.bg
            }
        }
    }
    gls.left[6] = {
        DiffAdd = {
            provider = "DiffAdd",
            condition = condition.hide_in_width,
            icon = "",
            highlight = {
                colors.color_7,
                colors.bg
            }
        }
    }
    gls.left[7] = {
        DiffModified = {
            provider = "DiffModified",
            condition = condition.hide_in_width,
            icon = "",
            highlight = {
                colors.color_4,
                colors.bg
            }
        }
    }
    gls.left[8] = {
        DiffRemove = {
            provider = "DiffRemove",
            condition = condition.hide_in_width,
            icon = "",
            highlight = {
                colors.color_6,
                colors.bg
            }
        }
    }
    gls.right[1] = {
        DiagnosticError = {
            provider = "DiagnosticError",
            icon = "",
            highlight = {
                colors.color_6,
                colors.bg
            }
        }
    }
    gls.right[2] = {
        DiagnosticWarn = {
            provider = "DiagnosticWarn",
            icon = "",
            highlight = {
                colors.color_4,
                colors.bg
            }
        }
    }
    gls.right[3] = {
        DiagnosticHint = {
            provider = "DiagnosticHint",
            icon = "",
            highlight = {
                colors.color_3,
                colors.bg
            }
        }
    }
    gls.right[4] = {
        DiagnosticInfo = {
            provider = "DiagnosticInfo",
            icon = "",
            highlight = {
                colors.color_3,
                colors.bg
            }
        }
    }
    gls.right[5] = {
        ShowLspClient = {
            provider = "GetLspClient",
            condition = function()
                local tbl = {["dashboard"] = true, [" "] = true}
                if tbl[vim.bo.filetype] then
                    return false
                end
                return true
            end,
            icon = "",
            highlight = {
                colors.color_0,
                colors.bg
            }
        }
    }
    gls.right[6] = {
        LineInfo = {
            provider = "LineColumn",
            separator = "  ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.color_7,
                colors.bg
            }
        }
    }
    gls.right[7] = {
        PerCent = {
            provider = "LinePercent",
            separator = " ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.color_7,
                colors.bg
            }
        }
    }
    gls.right[8] = {
        Tabstop = {
            provider = function()
                return "Spaces: " .. vim.api.nvim_buf_get_option(0, "tabstop") .. " "
            end,
            condition = condition.hide_in_width,
            separator = " ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.color_7,
                colors.bg
            }
        }
    }
    gls.right[9] = {
        BufferType = {
            provider = "FileTypeName",
            condition = condition.hide_in_width,
            separator = " ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.color_7,
                colors.bg
            }
        }
    }
    gls.right[10] = {
        FileEncode = {
            provider = "FileEncode",
            condition = condition.hide_in_width,
            separator = " ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.color_7,
                colors.bg
            }
        }
    }
    gls.right[11] = {
        Space = {
            provider = function()
                return " "
            end,
            separator = " ",
            separator_highlight = {
                "NONE",
                colors.bg
            },
            highlight = {
                colors.color_7,
                colors.bg
            }
        }
    }
    gls.short_line_left[1] = {
        SFileName = {
            provider = "SFileName",
            condition = condition.buffer_not_empty,
            highlight = {
                colors.fg,
                colors.bg
            }
        }
    }
    gls.short_line_right[1] = {
        BufferIcon = {
            provider = "BufferIcon",
            highlight = {
                colors.fg,
                colors.bg
            }
        }
    }
end
Vim floaterm

voldikss/vim-floaterm


Init

-- lua/modules/global/init.lua

modules["voldikss/vim-floaterm"] = {
    config = ui_config.vim_floaterm
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.vim_floaterm()
    vim.g.floaterm_keymap_toggle = "<F1>"
    vim.g.floaterm_keymap_next = "<F2>"
    vim.g.floaterm_keymap_prev = "<F3>"
    vim.g.floaterm_keymap_new = "<F4>"
    vim.g.floaterm_keymap_kill = "<F12>"
    vim.g.floaterm_title = "Floaterm ($1/$2)"
    vim.g.floaterm_shell = vim.o.shell
    vim.g.floaterm_autoinsert = 1
    vim.g.floaterm_width = 0.8
    vim.g.floaterm_height = 0.8
    vim.g.floaterm_wintitle = 0
    vim.g.floaterm_autoclose = 1
end
Twilight

folke/twilight.nvim


Init

-- lua/modules/global/init.lua

modules["folke/twilight.nvim"] = {
    cmd = "Twilight",
    config = ui_config.twilight
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.twilight()
    require("twilight").setup {}
end
Indent blankline

lukas-reineke/indent-blankline.nvim


Init

-- lua/modules/global/init.lua

modules["lukas-reineke/indent-blankline.nvim"] = {
    event = {
        "VimEnter",
        "BufRead",
        "BufNewFile"
    },
    config = ui_config.indent_blankline
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.indent_blankline()
    require("indent_blankline").setup {
        char = "",
        show_first_indent_level = true,
        show_trailing_blankline_indent = true,
        show_current_context = true,
        context_patterns = {
            "class",
            "function",
            "method",
            "block",
            "list_literal",
            "selector",
            "^if",
            "^table",
            "if_statement",
            "while",
            "for"
        },
        filetype_exclude = {
            "startify",
            "dashboard",
            "dotooagenda",
            "log",
            "fugitive",
            "gitcommit",
            "packer",
            "vimwiki",
            "markdown",
            "json",
            "txt",
            "vista",
            "help",
            "todoist",
            "NvimTree",
            "peekaboo",
            "git",
            "TelescopePrompt",
            "undotree",
            "flutterToolsOutline"
        },
        buftype_exclude = {
            "terminal",
            "nofile"
        }
    }
end
Lvim focus

lvim-tech/lvim-focus


Init

-- lua/modules/global/init.lua

modules["lvim-tech/lvim-focus"] = {
    event = {
        "VimEnter",
        "BufRead",
        "BufNewFile"
    },
    config = ui_config.lvim_focus
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.lvim_focus()
    require("lvim-focus").setup()
end
Lvim helper

lvim-tech/lvim-helper


Init

-- lua/modules/global/init.lua

modules["lvim-tech/lvim-helper"] = {
    cmd = "LvimHelper",
    config = ui_config.lvim_helper
}

Config

-- lua/modules/global/configs/ui/init.lua

function config.lvim_helper()
    local global = require("core.global")
    require("lvim-helper").setup(
        {
            files = {
                global.home .. "/.config/nvim/help/lvim_commands.md",
                global.home .. "/.config/nvim/help/lvim_bindings_normal_mode.md",
                global.home .. "/.config/nvim/help/lvim_bindings_visual_mode.md",
                global.home .. "/.config/nvim/help/lvim_bindings_debug_dap.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_global.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_cursor_movement.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_visual_mode.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_visual_commands.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_insert_mode.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_editing.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_registers.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_marks_and_positions.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_macros.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_cut_and_paste.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_indent_text.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_exiting.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_search_and_replace.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_search_in_multiple_files.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_tabs.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_working_with_multiple_files.md",
                global.home .. "/.config/nvim/help/vim_cheat_sheet_diff.md"
            }
        }
    )
end

1.2. Editor

Vim-CtrlSpace

vim-ctrlspace/vim-ctrlspace


Init

-- lua/modules/global/init.lua

modules["vim-ctrlspace/vim-ctrlspace"] = {
    cmd = "CtrlSpace"
}

Config

-- lua/configs/global/init.lua

configs["ctrlspace_pre_config_global"] = function()
    vim.g.ctrlspace_use_tablineend = 1
    vim.g.CtrlSpaceLoadLastWorkspaceOnStart = 1
    vim.g.CtrlSpaceSaveWorkspaceOnSwitch = 1
    vim.g.CtrlSpaceSaveWorkspaceOnExit = 1
    vim.g.CtrlSpaceGlobCommand = "rg --files --follow --hidden -g '!{.git/*,node_modules/*,target/*,vendor/*}'"
    vim.g.CtrlSpaceIgnoredFiles = "\v(tmp|temp)[\\/]"
    vim.api.nvim_exec(
        [[
        let g:CtrlSpaceSymbols = { "CS": " ", "Sin": "", "All": "", "Vis": "★", "File": "", "Tabs": "ﱡ", "CTab": "ﱢ", "NTM": "⁺", "WLoad": "ﰬ", "WSave": "ﰵ", "Zoom": "", "SLeft": "", "SRight": "", "BM": "", "Help": "", "IV": "", "IA": "", "IM": " ", "Dots": "ﳁ"}
        ]],
        true
    )
end

IMPORTANT: Defined in lua/configs/global/init.lua

Telescope

nvim-telescope/telescope.nvim (requires nvim-telescope/telescope-fzf-native.nvim | nvim-telescope/telescope-media-files.nvim)


Init

-- lua/modules/global/init.lua

modules["nvim-telescope/telescope.nvim"] = {
    requires = {
        {
            "nvim-telescope/telescope-fzf-native.nvim",
            after = "telescope.nvim",
            run = "make"
        },
        {
            "nvim-telescope/telescope-media-files.nvim",
            after = "telescope.nvim"
        }
    },
    cmd = "Telescope",
    config = editor_config.telescope
}

Config

-- lua/modules/global/configs/editor/init.lua

function config.telescope()
    local present, telescope = pcall(require, "telescope")
    if not present then
        return
    end
    telescope.setup {
        defaults = {
            prompt_prefix = "",
            selection_caret = "",
            entry_prefix = "  ",
            initial_mode = "insert",
            selection_strategy = "reset",
            sorting_strategy = "descending",
            layout_strategy = "horizontal",
            layout_config = {
                width = 0.85,
                preview_cutoff = 120,
                horizontal = {
                    mirror = false
                },
                vertical = {
                    mirror = false
                }
            },
            vimgrep_arguments = {
                "rg",
                "--color=never",
                "--no-heading",
                "--with-filename",
                "--line-number",
                "--column",
                "--smart-case",
                "--hidden"
            },
            file_sorter = require("telescope.sorters").get_fuzzy_file,
            file_ignore_patterns = {
                "node_modules",
                ".git",
                "target",
                "vendor"
            },
            generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
            path_display = {shorten = 5},
            winblend = 0,
            border = {},
            borderchars = {"", "", "", "", "", "", "", ""},
            color_devicons = true,
            set_env = {["COLORTERM"] = "truecolor"},
            file_previewer = require("telescope.previewers").vim_buffer_cat.new,
            grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
            qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
            buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker
        },
        pickers = {
            file_browser = {
                hidden = true
            },
            find_files = {
                hidden = true
            },
            live_grep = {
                hidden = true,
                only_sort_text = true
            }
        },
        extensions = {
            fzf = {
                fuzzy = true,
                override_generic_sorter = false,
                override_file_sorter = true,
                case_mode = "smart_case"
            },
            media_files = {
                filetypes = {"png", "webp", "jpg", "jpeg"},
                find_cmd = "rg"
            }
        }
    }
    local extensions = {"fzf"}
    local packer_repos = [["extensions", "telescope-fzf-native.nvim"]]
    if vim.fn.executable "ueberzug" == 1 then
        table.insert(extensions, "media_files")
        packer_repos = packer_repos .. ', "telescope-media-files.nvim"'
    end
    pcall(
        function()
            for _, ext in ipairs(extensions) do
                telescope.load_extension(ext)
            end
        end
    )
end
Nvim spectre

windwp/nvim-spectre (requires nvim-lua/popup.nvim | nvim-lua/plenary.nvim)


Init

-- lua/modules/global/init.lua

modules["windwp/nvim-spectre"] = {
    requires = {
        {
            "nvim-lua/popup.nvim"
        },
        {
            "nvim-lua/plenary.nvim"
        }
    },
    cmd = "Spectre",
    config = editor_config.nvim_spectre
}

Config

-- lua/modules/global/configs/editor/init.lua

function config.nvim_spectre()
    require("spectre").setup(
        {
            color_devicons = true,
            line_sep_start = "-----------------------------------------",
            result_padding = "|  ",
            line_sep = "-----------------------------------------",
            highlight = {
                ui = "String",
                search = "DiffChange",
                replace = "DiffDelete"
            },
            mapping = {
                ["delete_line"] = nil,
                ["enter_file"] = nil,
                ["send_to_qf"] = nil,
                ["replace_cmd"] = nil,
                ["show_option_menu"] = nil,
                ["run_replace"] = nil,
                ["change_view_mode"] = nil,
                ["toggle_ignore_case"] = nil,
                ["toggle_ignore_hidden"] = nil
            },
            find_engine = {
                ["rg"] = {
                    cmd = "rg",
                    args = {
                        "--color=never",
                        "--no-heading",
                        "--with-filename",
                        "--line-number",
                        "--column"
                    },
                    options = {
                        ["ignore-case"] = {
                            value = "--ignore-case",
                            icon = "[I]",
                            desc = "ignore case"
                        },
                        ["hidden"] = {
                            value = "--hidden",
                            desc = "hidden file",
                            icon = "[H]"
                        }
                    }
                },
                ["ag"] = {
                    cmd = "ag",
                    args = {"--vimgrep", "-s"},
                    options = {
                        ["ignore-case"] = {
                            value = "-i",
                            icon = "[I]",
                            desc = "ignore case"
                        },
                        ["hidden"] = {
                            value = "--hidden",
                            desc = "hidden file",
                            icon = "[H]"
                        }
                    }
                }
            },
            replace_engine = {
                ["sed"] = {
                    cmd = "sed",
                    args = nil
                },
                options = {
                    ["ignore-case"] = {
                        value = "--ignore-case",
                        icon = "[I]",
                        desc = "ignore case"
                    }
                }
            },
            default = {
                find = {
                    cmd = "rg",
                    options = {"ignore-case"}
                },
                replace = {
                    cmd = "sed"
                }
            },
            replace_vim_cmd = "cfdo",
            is_open_target_win = true,
            is_insert_mode = false
        }
    )
    function init_spectre()
        if not packer_plugins["nvim-spectre"].loaded then
            vim.cmd [[packadd nvim-spectre]]
            vim.cmd [[packadd popup.nvim]]
        end
        require("spectre").open()
    end
    vim.cmd("command! Spectre lua init_spectre()")
end
Nvim comment

terrortylor/nvim-comment


Init

-- lua/modules/global/init.lua

modules["terrortylor/nvim-comment"] = {
    cmd = "CommentToggle",
    config = editor_config.nvim_comment
}

Config

-- lua/modules/global/configs/editor/init.lua

function config.nvim_comment()
    require("nvim_comment").setup()
end
Vim bookmarks

MattesGroeger/vim-bookmarks


Init

-- lua/modules/global/init.lua

modules["MattesGroeger/vim-bookmarks"] = {
    cmd = "BookmarkToggle",
    config = editor_config.vim_bookmarks
}

Config

-- lua/modules/global/configs/editor/init.lua

function config.vim_bookmarks()
    vim.g.bookmark_no_default_key_mappings = 1
    vim.g.bookmark_sign = ""
end
Vim doge

kkoomen/vim-doge


Init

-- lua/modules/global/init.lua

modules["kkoomen/vim-doge"] = {
    cmd = {
        "DogeGenerate",
        "DogeCreateDocStandard"
    },
    run = ":call doge#install()",
    config = editor_config.vim_doge
}

Config

-- lua/modules/global/configs/editor/init.lua

function config.vim_doge()
    vim.g.doge_mapping = "<Leader>*"
end
Nvim autopairs

windwp/nvim-autopairs


Init

-- lua/modules/global/init.lua

modules["windwp/nvim-autopairs"] = {
    after = {
        "nvim-treesitter",
        "nvim-cmp"
    },
    config = editor_config.nvim_autopairs
}

Config

-- lua/modules/global/configs/editor/init.lua

function config.nvim_autopairs()
    local autopairs = require "nvim-autopairs"
    local Rule = require "nvim-autopairs.rule"
    local cond = require "nvim-autopairs.conds"
    autopairs.setup {
        check_ts = true,
        ts_config = {
            lua = {
                "string"
            },
            javascript = {
                "template_string"
            },
            java = false
        }
    }
    autopairs.add_rule(Rule("$$", "$$", "tex"))
    autopairs.add_rules {
        Rule("$", "$", {"tex", "latex"}):with_pair(cond.not_after_regex_check "%%"):with_pair(
            cond.not_before_regex_check("xxx", 3)
        ):with_move(cond.none()):with_del(cond.not_after_regex_check "xx"):with_cr(cond.none())
    }
    autopairs.add_rules {
        Rule("$$", "$$", "tex"):with_pair(
            function(opts)
                print(vim.inspect(opts))
                if opts.line == "aa $$" then
                    return false
                end
            end
        )
    }
    require("nvim-autopairs.completion.cmp").setup {
        map_cr = false,
        map_complete = true,
        map_char = {
            all = "(",
            tex = "{"
        },
        vim.api.nvim_set_keymap(
            "i",
            "<CR>",
            "v:lua.MPairs.autopairs_cr()",
            {
                expr = true,
                noremap = true
            }
        )
    }
    local ts_conds = require "nvim-autopairs.ts-conds"
    autopairs.add_rules {
        Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node {"string", "comment"}),
        Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node {"function"})
    }
end
Nvim colorizer

norcalli/nvim-colorizer.lua


Init

-- lua/modules/global/init.lua

modules["norcalli/nvim-colorizer.lua"] = {
    event = {
        "BufRead",
        "BufNewFile"
    },
    config = editor_config.nvim_colorize
}

Config

-- lua/modules/global/configs/editor/init.lua

function config.nvim_colorize()
    require("colorizer").setup(
        {
            "*"
        },
        {
            RGB = true,
            RRGGBB = true,
            RRGGBBAA = true,
            rgb_fn = true,
            hsl_fn = true,
            css = true,
            css_fn = true
        }
    )
end
Suda

lambdalisue/suda.vim


Init

-- lua/modules/global/init.lua

modules["lambdalisue/suda.vim"] = {
    event = {
        "BufRead",
        "BufNewFile"
    },
    config = editor_config.suda
}

Config

-- lua/modules/global/configs/editor/init.lua

function config.suda()
    vim.g.suda_smart_edit = 1
end
Vim arsync

kenn7/vim-arsync


Init

-- lua/modules/global/init.lua

modules["kenn7/vim-arsync"] = {
    event = {
        "BufRead",
        "BufNewFile"
    }
}

Config

-- Default configuration

1.3. Version control

Neogit

TimUntersberger/neogit (requires nvim-lua/plenary.nvim)


Init

-- lua/modules/global/init.lua

modules["TimUntersberger/neogit"] = {
    requires = "nvim-lua/plenary.nvim",
    cmd = "Neogit",
    config = version_control_config.neogit
}

Config

-- lua/modules/global/configs/version_control/init.lua

function config.neogit()
    require("neogit").setup {
        disable_signs = false,
        disable_context_highlighting = false,
        disable_commit_confirmation = false,
        signs = {
            section = {
                "",
                ""
            },
            item = {
                "",
                ""
            },
            hunk = {
                "",
                ""
            }
        },
        integrations = {
            diffview = true
        }
    }
end
Vim fugitive

tpope/vim-fugitive


Init

-- lua/modules/global/init.lua

modules["tpope/vim-fugitive"] = {
    event = {
        "BufRead",
        "BufNewFile"
    }
}

Config

-- Default configuration
Gitsigns

lewis6991/gitsigns.nvim (requires nvim-lua/plenary.nvim)


Init

-- lua/modules/global/init.lua

modules["lewis6991/gitsigns.nvim"] = {
    requires = "nvim-lua/plenary.nvim",
    event = {
        "BufRead",
        "BufNewFile"
    },
    config = version_control_config.gitsigns
}

Config

-- lua/modules/global/configs/version_control/init.lua

function config.gitsigns()
    require("gitsigns").setup {
        signs = {
            add = {
                hl = "GitSignsAdd",
                text = "",
                numhl = "GitSignsAddNr",
                linehl = "GitSignsAddLn"
            },
            change = {
                hl = "GitSignsChange",
                text = "",
                numhl = "GitSignsChangeNr",
                linehl = "GitSignsChangeLn"
            },
            delete = {
                hl = "GitSignsDelete",
                text = "",
                numhl = "GitSignsDeleteNr",
                linehl = "GitSignsDeleteLn"
            },
            topdelete = {
                hl = "GitSignsDelete",
                text = "",
                numhl = "GitSignsDeleteNr",
                linehl = "GitSignsDeleteLn"
            },
            changedelete = {
                hl = "GitSignsChange",
                text = "",
                numhl = "GitSignsChangeNr",
                linehl = "GitSignsChangeLn"
            }
        },
        numhl = false,
        linehl = false,
        keymaps = {
            noremap = true,
            buffer = true
        },
        watch_index = {interval = 1000, follow_files = true},
        current_line_blame = false,
        current_line_blame_delay = 1000,
        current_line_blame_position = "eol",
        sign_priority = 6,
        update_debounce = 100,
        status_formatter = nil,
        word_diff = false,
        use_decoration_api = true,
        use_internal_diff = true
    }
    vim.cmd("command! GitSignsPreviewHunk lua require('gitsigns').preview_hunk()")
    vim.cmd("command! GitSignsNextHunk lua require('gitsigns').next_hunk()")
    vim.cmd("command! GitSignsPrevHunk lua require('gitsigns').prev_hunk()")
    vim.cmd("command! GitSignsStageHunk lua require('gitsigns').stage_hunk()")
    vim.cmd("command! GitSignsUndoStageHunk lua require('gitsigns').undo_stage_hunk()")
    vim.cmd("command! GitSignsResetHunk lua require('gitsigns').reset_hunk()")
    vim.cmd("command! GitSignsResetBuffer lua require('gitsigns').reset_buffer()")
    vim.cmd("command! GitSignsBlameLine lua require('gitsigns').blame_line()")
end
Git blame

f-person/git-blame.nvim


Init

-- lua/modules/global/init.lua

modules["f-person/git-blame.nvim"] = {
    config = version_control_config.git_blame
}

Config

-- lua/modules/global/configs/version_control/init.lua

function config.git_blame()
    vim.g.gitblame_enabled = 0
end
Diffview

sindrets/diffview.nvim


Init

-- lua/modules/global/init.lua

modules["sindrets/diffview.nvim"] = {
    cmd = {
        "DiffviewOpen",
        "DiffviewClose",
        "DiffviewToggleFiles",
        "DiffviewFocusFiles",
        "DiffviewRefresh"
    },
    config = version_control_config.diffview
}

Config

-- lua/modules/global/configs/version_control/init.lua

function config.diffview()
    local cb = require("diffview.config").diffview_callback
    require("diffview").setup {
        diff_binaries = false,
        file_panel = {width = 35, use_icons = true},
        key_bindings = {
            disable_defaults = false,
            view = {
                ["<tab>"] = cb("select_next_entry"),
                ["<s-tab>"] = cb("select_prev_entry"),
                ["<leader>e"] = cb("focus_files"),
                ["<leader>b"] = cb("toggle_files")
            },
            file_panel = {
                ["j"] = cb("next_entry"),
                ["<down>"] = cb("next_entry"),
                ["k"] = cb("prev_entry"),
                ["<up>"] = cb("prev_entry"),
                ["<cr>"] = cb("select_entry"),
                ["o"] = cb("select_entry"),
                ["<2-LeftMouse>"] = cb("select_entry"),
                ["-"] = cb("toggle_stage_entry"),
                ["S"] = cb("stage_all"),
                ["U"] = cb("unstage_all"),
                ["R"] = cb("refresh_files"),
                ["<tab>"] = cb("select_next_entry"),
                ["<s-tab>"] = cb("select_prev_entry"),
                ["<leader>e"] = cb("focus_files"),
                ["<leader>b"] = cb("toggle_files")
            }
        }
    }
end
Undotree

mbbill/undotree


Init

-- lua/modules/global/init.lua

modules["mbbill/undotree"] = {
    event = {
        "BufRead",
        "BufNewFile"
    },
    cmd = "UndotreeToggle"
}

Config

-- Default configuration

1.4. Languages

Nvim lspconfig

neovim/nvim-lspconfig


Init

-- lua/modules/global/init.lua

modules["neovim/nvim-lspconfig"] = {
    event = {
        "VimEnter",
        "BufWinEnter",
        "BufRead",
        "BufNewFile"
    },
    config = languages_config.nvim_lspconfig
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.nvim_lspconfig()
    require("languages.global.utils").setup_diagnostic()
    require("languages.global.diagnostics").init_diagnosticls()
    -- LSP buf
    vim.cmd("command! LspAddToWorkspaceFolder lua vim.lsp.buf.add_workspace_folder()")
    vim.cmd("command! LspListWorkspaceFolders lua vim.lsp.buf.list_workspace_folders()")
    vim.cmd("command! LspRemoveWorkspaceFolder lua vim.lsp.buf.remove_workspace_folder()")
    vim.cmd("command! LspWorkspaceSymbol lua vim.lsp.buf.workspace_symbol()")
    vim.cmd("command! LspDocumentSymbol lua vim.lsp.buf.document_symbol()")
    vim.cmd("command! LspReferences lua vim.lsp.buf.references()")
    vim.cmd("command! LspClearReferences lua vim.lsp.buf.clear_references()")
    vim.cmd("command! LspCodeAction lua vim.lsp.buf.code_action()")
    vim.cmd("command! LspRangeCodeAction lua vim.lsp.buf.range_code_action()")
    vim.cmd("command! LspDeclaration lua vim.lsp.buf.declaration()")
    vim.cmd("command! LspDefinition lua vim.lsp.buf.definition()")
    vim.cmd("command! LspTypeDefinition lua vim.lsp.buf.type_definition()")
    vim.cmd("command! LspDocumentHighlight lua vim.lsp.buf.document_highlight()")
    vim.cmd("command! LspImplementation lua vim.lsp.buf.implementation()")
    vim.cmd("command! LspIncomingCalls lua vim.lsp.buf.incoming_calls()")
    vim.cmd("command! LspOutgoingCalls lua vim.lsp.buf.outgoing_calls()")
    vim.cmd("command! LspFormatting lua vim.lsp.buf.formatting()")
    vim.cmd("command! LspRangeFormatting lua vim.lsp.buf.range_formatting()")
    vim.cmd("command! LspFormattingSync lua vim.lsp.buf.formatting_sync()")
    vim.cmd("command! LspHover lua vim.lsp.buf.hover()")
    vim.cmd("command! LspRename lua vim.lsp.buf.rename()")
    vim.cmd("command! LspSignatureHelp lua vim.lsp.buf.signature_help()")
    -- LSP diagnostic
    vim.cmd("command! LspGetAll lua vim.lsp.diagnostic.get_all()")
    vim.cmd("command! LspGetNext lua vim.lsp.diagnostic.get_next()")
    vim.cmd("command! LspGetPrev lua vim.lsp.diagnostic.get_prev()")
    vim.cmd("command! LspGoToNext lua vim.lsp.diagnostic.goto_next()")
    vim.cmd("command! LspGoToPrev lua vim.lsp.diagnostic.goto_prev()")
    -- Virtual text toggle
    vim.cmd("command! LspVirtualTextToggle lua require('languages.global.utils').toggle_virtual_text()")
end
Nvim lsp installer

williamboman/nvim-lsp-installer


Init

-- lua/modules/global/init.lua

modules["williamboman/nvim-lsp-installer"] = {
    requires = "neovim/nvim-lspconfig",
    config = languages_config.nvim_lsp_installer
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.nvim_lsp_installer()
    require("nvim-lsp-installer").settings {
        ui = {
            icons = {
                server_installed = "",
                server_pending = "",
                server_uninstalled = ""
            }
        }
    }
end
Lsp signature

ray-x/lsp_signature.nvim


Init

-- lua/modules/global/init.lua

modules["ray-x/lsp_signature.nvim"] = {}

Config

-- Default configuration
Nvim treesitter

nvim-treesitter/nvim-treesitter (requires nvim-treesitter/playground)


Init

-- lua/modules/global/init.lua

modules["nvim-treesitter/nvim-treesitter"] = {
    requires = {
        {
            "nvim-treesitter/playground",
            after = "nvim-treesitter"
        }
    },
    event = {
        "BufRead",
        "BufNewFile"
    },
    run = ":TSUpdate",
    config = languages_config.nvim_treesitter
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.nvim_treesitter()
    require("nvim-treesitter.configs").setup {
        ensure_installed = "all",
        ignore_install = {
            "haskell"
        },
        highlight = {
            enable = true
        },
        indent = {
            enable = {
                "javascriptreact"
            }
        },
        playground = {
            enable = true,
            disable = {},
            updatetime = 25,
            persist_queries = false,
            keybindings = {
                toggle_query_editor = "o",
                toggle_hl_groups = "i",
                toggle_injected_languages = "t",
                toggle_anonymous_nodes = "a",
                toggle_language_display = "I",
                focus_language = "f",
                unfocus_language = "F",
                update = "R",
                goto_node = "<cr>",
                show_help = "?"
            }
        },
        autopairs = {
            enable = true
        },
        autotag = {
            enable = true
        },
        rainbow = {
            enable = true
        },
        context_commentstring = {
            enable = true,
            config = {
                javascriptreact = {
                    style_element = "{/*%s*/}"
                }
            }
        }
    }
end
Any jump

pechorin/any-jump.vim


Init

-- lua/modules/global/init.lua

modules["pechorin/any-jump.vim"] = {
    event = {
        "BufRead",
        "BufNewFile"
    },
    config = languages_config.any_jump
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.any_jump()
    vim.g.any_jump_disable_default_keybindings = 1
    vim.g.any_jump_list_numbers = 1
end
Lsp trouble

folke/lsp-trouble.nvim (requires kyazdani42/nvim-web-devicons)


Init

-- lua/modules/global/init.lua

modules["folke/lsp-trouble.nvim"] = {
    requires = "kyazdani42/nvim-web-devicons",
    config = languages_config.lsp_trouble
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.lsp_trouble()
    require("trouble").setup {
        height = 12,
        mode = "lsp_document_diagnostics",
        use_lsp_diagnostic_signs = true,
        signs = {
            error = "",
            warning = "",
            hint = "",
            information = "",
            other = ""
        }
    }
end
Symbols outline

simrat39/symbols-outline.nvim


Init

-- lua/modules/global/init.lua

modules["simrat39/symbols-outline.nvim"] = {
    cmd = "SymbolsOutline",
    config = languages_config.symbols_outline
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.symbols_outline()
    require("symbols-outline").setup {
        highlight_hovered_item = true,
        show_guides = true
    }
end
Nvim dap ui

rcarriga/nvim-dap-ui (requires mfussenegger/nvim-dap | jbyuki/one-small-step-for-vimkind)


Init

-- lua/modules/global/init.lua

modules["rcarriga/nvim-dap-ui"] = {
    event = {
        "BufRead",
        "BufNewFile"
    },
    requires = {
        "mfussenegger/nvim-dap",
        "jbyuki/one-small-step-for-vimkind"
    },
    config = languages_config.nvim_dap_ui
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.nvim_dap_ui()
    local dapui = require("dapui")
    local dap = require("dap")
    dapui.setup(
        {
            icons = {
                expanded = "",
                collapsed = ""
            },
            mappings = {
                expand = {
                    "<CR>",
                    "<2-LeftMouse>"
                },
                open = "o",
                remove = "d",
                edit = "e",
                repl = "r"
            },
            sidebar = {
                elements = {
                    {
                        id = "scopes",
                        size = 0.25
                    },
                    {
                        id = "breakpoints",
                        size = 0.25
                    },
                    {
                        id = "stacks",
                        size = 0.25
                    },
                    {
                        id = "watches",
                        size = 00.25
                    }
                },
                size = 40,
                position = "left"
            },
            tray = {
                elements = {
                    "repl"
                },
                size = 10,
                position = "bottom"
            },
            floating = {
                max_height = nil,
                max_width = nil,
                mappings = {
                    close = {
                        "q",
                        "<Esc>"
                    }
                }
            },
            windows = {
                indent = 1
            }
        }
    )
    dap.listeners.after.event_initialized["dapui_config"] = function()
        dapui.open()
    end
    dap.listeners.before.event_terminated["dapui_config"] = function()
        dapui.close()
    end
    dap.listeners.before.event_exited["dapui_config"] = function()
        dapui.close()
    end
    vim.fn.sign_define(
        "DapBreakpoint",
        {
            text = "",
            texthl = "",
            linehl = "",
            numhl = ""
        }
    )
    vim.fn.sign_define(
        "DapStopped",
        {
            text = "",
            texthl = "",
            linehl = "",
            numhl = ""
        }
    )
    vim.fn.sign_define(
        "DapLogPoint",
        {
            text = "",
            texthl = "",
            linehl = "",
            numhl = ""
        }
    )
    vim.cmd('command! DapToggleBreakpoint lua require"dap".toggle_breakpoint()')
    vim.cmd('command! DapStartContinue lua require"dap".continue()')
    vim.cmd('command! DapStepInto lua require"dap".step_into()')
    vim.cmd('command! DapStepOver lua require"dap".step_over()')
    vim.cmd('command! DapStepOut lua require"dap".step_out()')
    vim.cmd('command! DapUp lua require"dap".up()')
    vim.cmd('command! DapDown lua require"dap".down()')
    vim.cmd('command! DapPause lua require"dap".pause()')
    vim.cmd('command! DapClose lua require"dap".close()')
    vim.cmd('command! DapDisconnect lua require"dap".disconnect()')
    vim.cmd('command! DapRestart lua require"dap".restart()')
    vim.cmd('command! DapToggleRepl lua require"dap".repl.toggle()')
    vim.cmd('command! DapGetSession lua require"dap".session()')
    vim.cmd('command! DapUIClose lua require"dap".close(); require"dap".disconnect(); require"dapui".close()')
end
DAPInstall

Pocco81/DAPInstall.nvim


Init

-- lua/modules/global/init.lua

modules["Pocco81/DAPInstall.nvim"] = {
    event = "BufWinEnter",
    config = languages_config.dapinstall
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.dapinstall()
    local path_debuggers = vim.fn.stdpath("data") .. "/dapinstall/"
    require("dap-install").setup(
        {
            installation_path = path_debuggers
        }
    )
end
Vim dadbod ui

kristijanhusak/vim-dadbod-ui (requires tpope/vim-dadbod | kristijanhusak/vim-dadbod-completion)


Init

-- lua/modules/global/init.lua

modules["kristijanhusak/vim-dadbod-ui"] = {
    requires = {
        {
            "tpope/vim-dadbod",
            opt = true
        },
        {
            "kristijanhusak/vim-dadbod-completion",
            opt = true
        }
    },
    cmd = {
        "DBUIToggle",
        "DBUIAddConnection",
        "DBUI",
        "DBUIFindBuffer",
        "DBUIRenameBuffer"
    },
    config = languages_config.vim_dadbod_ui
}

Config

-- lua/modules/global/configs/languages/init.lua

function config.vim_dadbod_ui()
    if packer_plugins["vim-dadbod"] and not packer_plugins["vim-dadbod"].loaded then
        vim.cmd [[packadd vim-dadbod]]
    end
    vim.g.db_ui_show_help = 0
    vim.g.db_ui_win_position = "left"
    vim.g.db_ui_use_nerd_fonts = 1
    vim.g.db_ui_winwidth = 35
    vim.api.nvim_set_keymap(
        "n",
        "<leader>Du",
        ":DBUIToggle<CR>",
        {
            noremap = true,
            silent = true
        }
    )
    vim.api.nvim_set_keymap(
        "n",
        "<leader>Df",
        ":DBUIFindBuffer<CR>",
        {
            noremap = true,
            silent = true
        }
    )
    vim.api.nvim_set_keymap(
        "n",
        "<leader>Dr",
        ":DBUIRenameBuffer<CR>",
        {
            noremap = true,
            silent = true
        }
    )
    vim.api.nvim_set_keymap(
        "n",
        "<leader>Dl",
        ":DBUILastQueryInfo<CR>",
        {
            noremap = true,
            silent = true
        }
    )
    vim.g.db_ui_auto_execute_table_helpers = true
end
Markdown preview

iamcco/markdown-preview.nvim


Init

-- lua/modules/global/init.lua

modules["iamcco/markdown-preview.nvim"] = {
    event = {
        "VimEnter",
        "BufReadPre"
    },
    run = "cd app && yarn install"
}

Config

-- Default configuration

1.5. Completion

Nvim cmp

hrsh7th/nvim-cmp (requires hrsh7th/cmp-nvim-lsp | hrsh7th/cmp-vsnip | hrsh7th/cmp-buffer | hrsh7th/cmp-path)


Init

-- lua/modules/global/init.lua

modules["hrsh7th/nvim-cmp"] = {
    requires = {
        {
            "hrsh7th/cmp-nvim-lsp"
        },
        {
            "hrsh7th/cmp-vsnip",
            after = "nvim-cmp"
        },
        {
            "hrsh7th/cmp-buffer",
            after = "nvim-cmp"
        },
        {
            "hrsh7th/cmp-path",
            after = "nvim-cmp"
        }
    },
    event = {
        "BufRead",
        "BufNewFile",
        "InsertEnter"
    },
    config = completion_config.nvim_cmp
}

Config

-- lua/modules/global/configs/completion/init.lua

function config.nvim_cmp()
    local cmp = require("cmp")
    local lsp_symbols = {
        Text = "   (Text) ",
        Method = "   (Method)",
        Function = "   (Function)",
        Constructor = "   (Constructor)",
        Field = " ﴲ  (Field)",
        Variable = "[] (Variable)",
        Class = "   (Class)",
        Interface = " ﰮ  (Interface)",
        Module = "   (Module)",
        Property = " 襁 (Property)",
        Unit = "   (Unit)",
        Value = "   (Value)",
        Enum = " 練 (Enum)",
        Keyword = "   (Keyword)",
        Snippet = "   (Snippet)",
        Color = "   (Color)",
        File = "   (File)",
        Reference = "   (Reference)",
        Folder = "   (Folder)",
        EnumMember = "   (EnumMember)",
        Constant = "   (Constant)",
        Struct = "   (Struct)",
        Event = "   (Event)",
        Operator = "   (Operator)",
        TypeParameter = "   (TypeParameter)"
    }
    cmp.setup(
        {
            mapping = {
                ["<C-p>"] = cmp.mapping.select_prev_item(),
                ["<C-n>"] = cmp.mapping.select_next_item(),
                ["<C-d>"] = cmp.mapping.scroll_docs(-4),
                ["<C-f>"] = cmp.mapping.scroll_docs(4),
                ["<C-Space>"] = cmp.mapping.complete(),
                ["<C-e>"] = cmp.mapping.close(),
                ["<CR>"] = cmp.mapping.confirm(
                    {
                        behavior = cmp.ConfirmBehavior.Replace,
                        select = true
                    }
                ),
                ["<Tab>"] = cmp.mapping(
                    cmp.mapping.select_next_item(),
                    {
                        "i",
                        "s"
                    }
                ),
                ["<S-Tab>"] = cmp.mapping(
                    cmp.mapping.select_prev_item(),
                    {
                        "i",
                        "s"
                    }
                )
            },
            formatting = {
                format = function(entry, item)
                    item.kind = lsp_symbols[item.kind]
                    item.menu =
                        ({
                        nvim_lsp = "[LSP]",
                        buffer = "[Buffer]",
                        path = "[Path]",
                        vsnip = "[VSnip]"
                    })[entry.source.name]
                    return item
                end
            },
            sources = {
                {
                    name = "nvim_lsp"
                },
                {
                    name = "vsnip"
                },
                {
                    name = "path"
                },
                {
                    name = "buffer"
                }
            },
            snippet = {
                expand = function(args)
                    vim.fn["vsnip#anonymous"](args.body)
                end
            }
        }
    )
end
Vim vsnip

hrsh7th/vim-vsnip (requires hrsh7th/vim-vsnip-integ | rafamadriz/friendly-snippets)


Init

-- lua/modules/global/init.lua

modules["hrsh7th/vim-vsnip"] = {
    requires = {
        {
            "hrsh7th/vim-vsnip-integ",
            after = "vim-vsnip"
        },
        {
            "rafamadriz/friendly-snippets",
            after = "vim-vsnip"
        }
    },
    event = "InsertEnter"
}

Config

-- Default configuration
Lspkind nvim

onsails/lspkind-nvim


Init

-- lua/modules/global/init.lua

modules["onsails/lspkind-nvim"] = {
    event = {
        "BufRead",
        "BufNewFile"
    },
    config = completion_config.lspkind_nvim
}

Config

-- lua/modules/global/configs/completion/init.lua

function config.lspkind_nvim()
    require("lspkind").init(
        {
            with_text = true,
            symbol_map = {
                Text = "",
                Method = "",
                Function = "",
                Constructor = "",
                Variable = "[]",
                Class = "",
                Interface = "",
                Module = "",
                Property = "",
                Unit = "",
                Value = "",
                Enum = "",
                Keyword = "",
                Snippet = "",
                Color = "",
                File = "",
                Folder = "",
                EnumMember = "",
                Constant = "",
                Struct = ""
            }
        }
    )
end
Emmet vim

mattn/emmet-vim


Init

-- lua/modules/global/init.lua

modules["mattn/emmet-vim"] = {
    event = "InsertEnter",
    config = completion_config.emmet_vim
}

Config

-- lua/modules/global/configs/completion/init.lua

function config.emmet_vim()
    vim.g.user_emmet_complete_tag = 0
    vim.g.user_emmet_install_global = 0
    vim.g.user_emmet_install_command = 0
    vim.g.user_emmet_mode = "a"
end

2. Disable of default Module (Plug-in)

You can disable of any default Module (Plug-in)

Example

Init

-- lua/modules/custom/init.lua

modules["glepnir/dashboard-nvim"] = false

3. Rewrite of settings of default Module (Plug-in)

You can rewrite of settings of any of default Module (Plug-in)

Example

Init

-- lua/modules/custom/init.lua

local ui_config = require("modules.custom.configs.ui")

modules["glepnir/dashboard-nvim"] = {
    event = "VimEnter",
    config = ui_config.dashboard
}

Config

-- lua/modules/custom/configs/ui/init.lua

function config.dashboard()
    vim.g.dashboard_custom_header = {
        " 8 8888         ,o888888o.         ,o888888o.        ,o888888o.     ",
        " 8 8888      . 8888     `88.      8888     `88.   . 8888     `88.   ",
        " 8 8888     ,8 8888       `8b  ,8 8888       `8. ,8 8888       `8b  ",
        " 8 8888     88 8888        `8b 88 8888           88 8888        `8b ",
        " 8 8888     88 8888         88 88 8888           88 8888         88 ",
        " 8 8888     88 8888         88 88 8888           88 8888         88 ",
        " 8 8888     88 8888        ,8P 88 8888   8888888 88 8888        ,8P ",
        " 8 8888     `8 8888       ,8P  `8 8888       .8' `8 8888       ,8P  ",
        " 8 8888      ` 8888     ,88'      8888     ,88'   ` 8888     ,88'   ",
        " 8 888888888888 `8888888P'         `8888888P'        `8888888P'     "

    }
    vim.g.dashboard_preview_file_height = 12
    vim.g.dashboard_preview_file_width = 80
    vim.g.dashboard_custom_section = {
        a = {
            description = {"     Projects                 "},
            command = "CtrlSpace b"
        },
        b = {
            description = {"     File explorer            "},
            command = "Vifm"
        },
        c = {
            description = {"     Search file              "},
            command = "SnapFiles"
        },
        d = {
            description = {"     Search in files          "},
            command = "SnapGrep"
        }
    }
end

4. Add new Module (Plug-in)

You can add new Module (Plug-in)

Example

Init

-- lua/modules/custom/init.lua

local version_control_config = require("modules.custom.configs.version_control")

modules["ruifm/gitlinker.nvim"] = {
    requires = 'nvim-lua/plenary.nvim',
    config = version_control_config.gitlinker
}

Config

-- lua/modules/custom/configs/version_control/init.lua

function config.gitlinker()
    require"gitlinker".setup({
        opts = {
            remote = nil,
            add_current_line_on_normal_mode = true,
            action_callback = require"gitlinker.actions".copy_to_clipboard,
            print_url = true
        },
        callbacks = {
                ["github.com"] = require("gitlinker.hosts").get_github_type_url,
                ["gitlab.com"] = require("gitlinker.hosts").get_gitlab_type_url,
                ["try.gitea.io"] = require("gitlinker.hosts").get_gitea_type_url,
                ["codeberg.org"] = require("gitlinker.hosts").get_gitea_type_url,
                ["bitbucket.org"] = require("gitlinker.hosts").get_bitbucket_type_url,
                ["try.gogs.io"] = require("gitlinker.hosts").get_gogs_type_url,
                ["git.sr.ht"] = require("gitlinker.hosts").get_srht_type_url,
                ["git.launchpad.net"] = require("gitlinker.hosts").get_launchpad_type_url,
                ["repo.or.cz"] = require("gitlinker.hosts").get_repoorcz_type_url,
                ["git.kernel.org"] = require("gitlinker.hosts").get_cgit_type_url,
                ["git.savannah.gnu.org"] = require("gitlinker.hosts").get_cgit_type_url
        },
        mappings = "<leader>gy"
    })
end
Clone this wiki locally