Skip to content

01. Modules (PlugIns)

Biser Stoilov edited this page Oct 12, 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",
    config = ui_config.colorscheme
}

Config

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

function config.colorscheme()
    vim.cmd('colorscheme lvim')
end
Dashboard

glepnir/dashboard-nvim


Init

-- lua/modules/global/init.lua

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

Config

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

function config.dashboard()
    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 = "Vifm"
        },
        c = {
            description = {"     Search file              "},
            command = "SnapFiles"
        },
        d = {
            description = {"     Search in files          "},
            command = "SnapGrep"
        },
        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
Tree Explorer

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


Init

-- lua/modules/global/init.lua

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

Config

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

function config.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 = 40,
            side = "left",
            auto_resize = false,
            mappings = {
                custom_only = false,
                list = {}
            }
        }
    }
end
Which key

AckslD/nvim-whichkey-setup.lua (requires liuchengxu/vim-which-key)


Init

-- lua/modules/global/init.lua

modules["AckslD/nvim-whichkey-setup.lua"] = {
    event = {
        "VimEnter",
        "BufReadPre"
    },
    requires = "liuchengxu/vim-which-key",
    config = ui_config.whichkey
}

Config

Galaxy status line

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


Init

-- lua/modules/global/init.lua

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

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()
                -- auto change color according the vim mode
                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
Floaterm

voldikss/vim-floaterm


Init

-- lua/modules/global/init.lua

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

Config

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

function config.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
Lvim helper

lvim-tech/lvim-helper


Init

-- lua/modules/global/init.lua

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

Config

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

function config.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_vimspector.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
Indent blank lines

lukas-reineke/indent-blankline.nvim


Init

-- lua/modules/global/init.lua

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

Config

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

function config.indent_blankline()
    vim.g.indent_blankline_char = ""
    vim.g.indent_blankline_show_first_indent_level = true
    vim.g.indent_blankline_filetype_exclude = {
        "startify",
        "dashboard",
        "dotooagenda",
        "log",
        "fugitive",
        "gitcommit",
        "packer",
        "vimwiki",
        "markdown",
        "json",
        "txt",
        "vista",
        "help",
        "todoist",
        "NvimTree",
        "peekaboo",
        "git",
        "TelescopePrompt",
        "undotree",
        "flutterToolsOutline"
    }
    vim.g.indent_blankline_buftype_exclude = {
        "terminal",
        "nofile"
    }
    vim.g.indent_blankline_show_trailing_blankline_indent = false
    vim.g.indent_blankline_show_current_context = true
    vim.g.indent_blankline_context_patterns = {
        "class",
        "function",
        "method",
        "block",
        "list_literal",
        "selector",
        "^if",
        "^table",
        "if_statement",
        "while",
        "for"
    }
    vim.cmd("autocmd CursorMoved * IndentBlanklineRefresh")
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_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/*}'"
    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

Snap

camspiers/snap


Init

-- lua/modules/global/init.lua

modules["camspiers/snap"] = {}

Config

-- lua/configs/global/utils.lua

local snap = require "snap"
local fzf = snap.get "consumer.fzf"
local limit = snap.get "consumer.limit"
local producer_file = snap.get"producer.ripgrep.file".args {
    '--hidden', "--iglob", "!vendor/* !node_modules/* !target/* !git/*"
}
local producer_vimgrep = snap.get "producer.ripgrep.vimgrep"
local producer_buffer = snap.get "producer.vim.buffer"
local producer_oldfile = snap.get "producer.vim.oldfile"
local producer_git = snap.get "consumer.fzf"(snap.get "producer.git.file")
local producer_help = snap.get "consumer.fzf"(snap.get "producer.vim.help")
local select_file = snap.get "select.file"
local select_vimgrep = snap.get "select.vimgrep"
local preview_file = snap.get "preview.file"
local preview_vimgrep = snap.get "preview.vimgrep"

function init_treesitter()
    if not packer_plugins["nvim-treesitter"].loaded then
        vim.cmd [[packadd nvim-treesitter]]
    end
end

function utils.snap_files()
    init_treesitter()
    snap.run({
        prompt = "  Files  ",
        producer = fzf(producer_file),
        select = select_file.select,
        multiselect = select_file.multiselect,
        views = {preview_file}
    })
end

function utils.snap_grep()
    init_treesitter()
    snap.run({
        prompt = "  Grep  ",
        producer = limit(10000, producer_vimgrep),
        select = select_vimgrep.select,
        multiselect = select_vimgrep.multiselect,
        views = {preview_vimgrep}
    })
end

function utils.snap_grep_selected_word()
    init_treesitter()
    snap.run({
        prompt = "  Grep  ",
        producer = limit(10000, producer_vimgrep),
        select = select_vimgrep.select,
        multiselect = select_vimgrep.multiselect,
        views = {preview_vimgrep},
        initial_filter = vim.fn.expand("<cword>")
    })
end

function utils.snap_git()
    init_treesitter()
    snap.run {
        prompt = "  Git  ",
        producer = producer_git,
        select = snap.get"select.file".select,
        multiselect = snap.get"select.file".multiselect,
        views = {snap.get "preview.file"}
    }
end

function utils.snap_help()
    init_treesitter()
    snap.run {
        prompt = " ﲉ Help  ",
        producer = producer_help,
        select = snap.get"select.help".select,
        views = {snap.get "preview.help"}
    }
end

function utils.snap_buffers()
    init_treesitter()
    snap.run({
        prompt = " ﬘ Buffers  ",
        producer = fzf(producer_buffer),
        select = select_file.select,
        multiselect = select_file.multiselect,
        views = {preview_file}
    })
end

function utils.snap_old_files()
    init_treesitter()
    snap.run({
        prompt = "  Oldfiles  ",
        producer = fzf(producer_oldfile),
        select = select_file.select,
        multiselect = select_file.multiselect,
        views = {preview_file}
    })
end

function utils.init_spectre()
    if not packer_plugins["nvim-spectre"].loaded then
        vim.cmd [[packadd nvim-spectre]]
    end
    if not packer_plugins["plenary.nvim"].loaded then
        vim.cmd [[packadd plenary.nvim]]
    end
    if not packer_plugins["popup.nvim"].loaded then
        vim.cmd [[packadd popup.nvim]]
    end
    require("spectre").open()
end

IMPORTANT: Predefined in lua/configs/global/utils.lua

Spectre

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


Init

-- lua/modules/global/init.lua

modules["windwp/nvim-spectre"] = {
    opt = true,
    config = editor_config.spectre,
    requires = {
        {
            "nvim-lua/popup.nvim"
        },
        {
            "nvim-lua/plenary.nvim"
        },
        after = "nvim-spectre"
    }
}

Config

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

function config.spectre()
    if not packer_plugins["plenary.nvim"].loaded or not packer_plugins["popup.nvim"].loaded then
        vim.cmd [[packadd plenary.nvim]]
        vim.cmd [[packadd popup.nvim]]
    end
    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
        }
    )
end
Comment

terrortylor/nvim-comment


Init

-- lua/modules/global/init.lua

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

Config

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

function config.comment()
    require("nvim_comment").setup()
end
Bookmarks

MattesGroeger/vim-bookmarks


Init

-- lua/modules/global/init.lua

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

Config

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

function config.bookmarks()
    vim.g.bookmark_no_default_key_mappings = 1
    vim.g.bookmark_sign = ""
end
Doge

kkoomen/vim-doge


Init

-- lua/modules/global/init.lua

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

Config

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

function config.doge()
    vim.g.doge_mapping = "<Leader>*"
end
Autopairs

windwp/nvim-autopairs


Init

-- lua/modules/global/init.lua

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

Config

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

function config.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
Colorizer

norcalli/nvim-colorizer.lua


Init

-- lua/modules/global/init.lua

modules["norcalli/nvim-colorizer.lua"] = {
    event = "VimEnter",
    config = editor_config.colorize
}

Config

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

function config.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
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"] = {
    cmd = "Neogit",
    config = version_control_config.neogit,
    requires = {
        {
            "nvim-lua/plenary.nvim",
            after = "neogit"
        }
    }
}

Config

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

function config.neogit()
    if not packer_plugins["plenary.nvim"].loaded then
        vim.cmd [[packadd plenary.nvim]]
    end
    if not packer_plugins["diffview.nvim"].loaded then
        vim.cmd [[packadd diffview.nvim]]
    end
    require("neogit").setup {
        disable_signs = false,
        disable_context_highlighting = false,
        disable_commit_confirmation = false,
        signs = {
            section = {
                "",
                ""
            },
            item = {
                "",
                ""
            },
            hunk = {
                "",
                ""
            }
        },
        integrations = {
            diffview = true
        }
    }
end
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"] = {
    event = "BufReadPre",
    config = version_control_config.gitsigns,
    requires = {
        {
            "nvim-lua/plenary.nvim",
            after = "gitsigns.nvim"
        }
    }
}

Config

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

function config.gitsigns()
    if not packer_plugins["plenary.nvim"].loaded then
        vim.cmd [[packadd plenary.nvim]]
    end
    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
    }
end
Git blame

f-person/git-blame.nvim


Init

-- lua/modules/global/init.lua

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

Config

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

function config.blame()
    vim.g.gitblame_enabled = 0
end
Diff view

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"] = {
    cmd = "UndotreeToggle"
}

Config

-- Default configuration

1.4. Languages

Lsp config

neovim/nvim-lspconfig


Init

-- lua/modules/global/init.lua

modules["neovim/nvim-lspconfig"] = {
    config = languages_config.lsp
}

Config

-- lua/languages/global/diagnostics/init.lua

function config.lsp()
    require("languages.global.diagnostics").init_diagnostics()
end

IMPORTANT: Defined in lua/languages/global/diagnostics/init.lua

Lsp install

kabouzeid/nvim-lspinstall


Init

-- lua/modules/global/init.lua

modules["kabouzeid/nvim-lspinstall"] = {}

Config

-- Default configuration
Lsp signature

ray-x/lsp_signature.nvim


Init

-- lua/modules/global/init.lua

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

Config

-- Default configuration
Treesitter

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


Init

-- lua/modules/global/init.lua

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

Config

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

function config.treesitter()
    if not packer_plugins["playground"].loaded then
        vim.cmd [[packadd playground]]
    end
    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.jump
}

Config

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

function config.jump()
    vim.cmd([[unmap <leader>j]])
    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"] = {
    config = languages_config.trouble,
    requires = "kyazdani42/nvim-web-devicons"
}

Config

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

function config.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"] = {
    event = {
        "BufRead",
        "BufNewFile"
    },
    config = languages_config.symbols
}

Config

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

function config.symbols()
    require("symbols-outline").setup {
        highlight_hovered_item = true,
        show_guides = true
    }
end
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"] = {
    config = languages_config.dapui,
    requires = {
        "mfussenegger/nvim-dap",
        "jbyuki/one-small-step-for-vimkind"
    }
}

Config

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

function config.dapui()
    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 = ""
        }
    )
end
DAP install

Pocco81/DAPInstall.nvim


Init

-- lua/modules/global/init.lua

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

Config

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

function config.dapinstall()
    local global = require("core.global")
    local path_debuggers = vim.fn.stdpath("data") .. "/dapinstall/"
    require("dap-install").setup(
        {
            installation_path = path_debuggers
        }
    )
end
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"] = {
    cmd = {
        "DBUIToggle",
        "DBUIAddConnection",
        "DBUI",
        "DBUIFindBuffer",
        "DBUIRenameBuffer"
    },
    config = languages_config.vim_dadbod_ui,
    requires = {
        {
            "tpope/vim-dadbod",
            opt = true
        },
        {
            "kristijanhusak/vim-dadbod-completion",
            opt = true
        }
    }
}

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
JDTLS

mfussenegger/nvim-jdtls


Init

-- lua/modules/global/init.lua

modules["mfussenegger/nvim-jdtls"] = {
    event = "VimEnter"
}

Config

-- Default configuration

1.5. Completion

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"] = {
    event = {
        "BufRead",
        "BufNewFile",
        "InsertEnter"
    },
    config = completion_config.cmp,
    requires = {
        {
            "hrsh7th/cmp-nvim-lsp"
        },
        {
            "hrsh7th/cmp-vsnip",
            after = "nvim-cmp"
        },
        {
            "hrsh7th/cmp-buffer",
            after = "nvim-cmp"
        },
        {
            "hrsh7th/cmp-path",
            after = "nvim-cmp"
        }
    }
}

Config

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

function config.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
Vsnip

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


Init

-- lua/modules/global/init.lua

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

Config

-- Default configuration
Lsp kind

onsails/lspkind-nvim


Init

-- lua/modules/global/init.lua

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

Config

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

function config.lspkind()
    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

mattn/emmet-vim


Init

-- lua/modules/global/init.lua

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

Config

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

function config.emmet()
    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