lvim-tech/lvim

config explanation

YassinRian opened this issue · 2 comments

I am having hard time understanding how we can change the ESC to something easier like fd or jj . Also not clear how the colorscheme can be changed ...I would really appreciate it if you could explain this a little bit more.
Thanks in advance !!

For theme:

-- lua/modules/custom/init.lua

modules["lvim-tech/lvim-colorscheme"] = false
modules["your/theme"] = {
    event = {
        "VimEnter",
        "BufRead",
        "BufNewFile"
    },
    config = function()
        vim.cmd("colorscheme theme")
    end
}

For keys:

-- lua/configs/custom/init.lua

local funcs = require("core.funcs")
local keymaps = require("configs.custom.keymaps")

configs["keymaps_global"] = function()
    funcs.keymaps("n", {noremap = false, silent = true}, keymaps.normal)
    funcs.keymaps("x", {noremap = false, silent = true}, keymaps.visual)
end
-- lua/configs/custom/keymaps.lua

local keymaps = {}

keymaps["normal"] = {
    {"<Esc>", "<Esc>:noh<CR>"}, -- Remove highlight after search
}

keymaps["visual"] = {
    -- your keys
}

return keymaps

This is great ..Thanks a lot !