DomacsVim

configuration

Configuration file located in ~/.config/dvim/init.lua

By default, this file is created in the first run of the program. And there is such a content in it:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 -- add custom keys dvim.keys = {} -- add custom plugins dvim.plugins = {} -- set leaderkey dvim.mapleader = " " -- set theme dvim.colorscheme = "onedark" -- change configs -- you can see the modules in here : -- for module, _ in pairs(dvim.core) do -- print(module) -- end -- template : -- dvim.core.[module].[pattern].[...] -- example : dvim.core.nvimtree.view.width = 31 -- change default icons -- dvim.icons.[category].[icon] -- categorys : -- devicons, ui, kind_icons -- dvim.icons.ui.search = " " -- dvim.icons.devicons["html"] = " " -- dvim.icons.kind_icons.folder = " " dvim.icons.kind_icons.folder = " " -- change options -- you can see the options in here : -- vim.opt.backup = false, -- creates a backup file -- vim.opt.clipboard = "unnamedplus", -- allows neovim to access the system clipboard -- vim.opt.cmdheight = 1, -- more space in the neovim command line for displaying messages -- vim.opt.completeopt = "menu,menuone,noselect", -- vim.opt.conceallevel = 0, -- so that `` is visible in markdown files -- vim.opt.fileencoding = "utf-8", -- the encoding written to a file -- vim.opt.foldmethod = "manual", -- folding, set to "expr" for treesitter based folding -- vim.opt.foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding -- vim.opt.guifont = "monospace:h17", -- the font used in graphical neovim applications -- vim.opt.hidden = true, -- required to keep multiple buffers and open multiple buffers -- vim.opt.hlsearch = true, -- highlight all matches on previous search pattern -- vim.opt.ignorecase = true, -- ignore case in search patterns -- vim.opt.mouse = "a", -- allow the mouse to be used in neovim -- vim.opt.pumheight = 10, -- pop up menu height -- vim.opt.showmode = false, -- we don't need to see things like -- INSERT -- anymore -- vim.opt.smartcase = true, -- smart case -- vim.opt.splitbelow = true, -- force all horizontal splits to go below current window -- vim.opt.splitright = true, -- force all vertical splits to go to the right of current window -- vim.opt.swapfile = false, -- creates a swapfile -- vim.opt.termguicolors = true, -- set term gui colors (most terminals support this) -- vim.opt.timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds) -- vim.opt.title = true, -- set the title of window to the value of the titlestring -- vim.opt.titlestring = "%<%F - DomacsVim", -- what the title of the window will be set to -- vim.opt.undodir = undodir, -- set an undo directory -- vim.opt.undofile = true, -- enable persistent undo -- vim.opt.updatetime = 100, -- faster completion -- vim.opt.writebackup = false, -- if a file is being edited by another program -- vim.opt.expandtab = true, -- convert tabs to spaces -- vim.opt.shiftwidth = 2, -- the number of spaces inserted for each indentation -- vim.opt.tabstop = 2, -- insert 2 spaces for a tab -- vim.opt.cursorline = true, -- highlight the current line -- vim.opt.number = true, -- set numbered lines -- vim.opt.numberwidth = 4, -- set number column width to 2 {default 4} -- vim.opt.signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time -- vim.opt.wrap = false, -- display lines as one long line -- vim.opt.shadafile = dvim_cache_dir .. "/dvim.shada", -- vim.opt.scrolloff = 8, -- minimal number of screen lines to keep above and below the cursor. -- vim.opt.sidescrolloff = 8, -- minimal number of screen lines to keep left and right of the cursor. -- vim.opt.showcmd = false, -- vim.opt.ruler = false, -- vim.opt.laststatus = 3, -- Lspconfig: -- vim.lsp.set_log_level("debug") -- dvim.core.lspconfig.[pattern] -- you can add you own structure : -- for example, add lua/ directory and and write plugins.lua in here or add lua/configs or lua/keymappings or ...

Keybindings

The default leader key is : Space, you can chane it with :

1 dvim.mapleader = &quot &quot

To set the new key in the desired mode, you can:

1 2 3 4 5 6 dvim.keys = { command_mode = {}, normal_mode = {}, term_mode = {}, visual_mode = {}, }

Mapping format

1 2 3 4 5 6 7 8 9 dvim.keys = { normal_mode = { ["keys"] = "action", [";"] = ":", ["<leader>tt"] = function() return require("base46").toggle_transparency() end, } }

Whichkey

1 dvim.core.whichkey.mappings['key'] = {val}

Whichkey format

1 2 3 4 5 6 7 dvim.core.whichkey.mappings['key'] = "value" dvim.core.whichkey.mappings['key'] = { name = "", ['sub-key1'] = "value1", ['sub-key2'] = "value2", ... }

Plugins

The configurations for core (builtin) plugins are accessible through the dvim.core table.
You can enable or disable core plugins with this syntax :

1 2 3 dvim.core.alpha.active = false dvim.core.nvimtree.active = false dvim.core.bufferline.active = false

And to add your custom plugins :

1 2 3 4 5 6 7 8 9 10 dvim.plugins = { { "Repository URL", -- for example: https://github.com/wfxr/minimap.vim enable = true, -- When false, or if the function returns false, then this plugin will not be included in the spec lazy = true, -- When true, the plugin will only be loaded when needed. Lazy-loaded plugins are automatically loaded when their Lua modules are required, or when one of the lazy-loading handlers triggers dependencies = {} -- A list of plugin names or plugin specs that should be loaded when the plugin loads. Dependencies are always lazy-loaded unless specified otherwise. When specifying a name, make sure the plugin spec has been defined somewhere else. opts = {} -- opts should be a table (will be merged with parent specs), return a table (replaces parent specs) or should change a table. The table will be passed to the Plugin.config() function. Setting this value will imply Plugin.config() config = function() end -- config is executed when the plugin loads. The default implementation will automatically run require(MAIN).setup(opts). Lazy uses several heuristics to determine the plugin's MAIN module automatically based on the plugin's name. See also opts. To use the default implementation without opts set config to true. }, }

You can see another options in here

Configure builtin plugins

1 2 dvim.core.nvimtree.view.width = 61 dvim.core.gitsigns.signcolumn = false
BUT : if you use this syntax, you will face problem because you will overwrite all the configurations in this table :
1 2 3 4 5 6 dvim.core.nvimtree = { view = { width = 61 } ... }

Colorschemes

1 dvim.colorscheme = 'theme'

Default icons

1 2 3 4 5 6 -- dvim.icon.[category].[icon] = 'your icon' -- categorys : -- devicons, ui, kind_icons dvim.icons.ui.search = "..." dvim.icons.devicons["html"] = "..." -- or dvim.icons.devicons.html dvim.icons.kind_icons.folder = "..."

Options

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 vim.opt.backup = false, -- creates a backup file vim.opt.clipboard = "unnamedplus", -- allows neovim to access the system clipboard vim.opt.cmdheight = 1, -- more space in the neovim command line for displaying messages vim.opt.completeopt = "menu,menuone,noselect", vim.opt.conceallevel = 0, -- so that `` is visible in markdown files vim.opt.fileencoding = "utf-8", -- the encoding written to a file vim.opt.foldmethod = "manual", -- folding, set to "expr" for treesitter based folding vim.opt.foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding vim.opt.guifont = "monospace:h17", -- the font used in graphical neovim applications vim.opt.hidden = true, -- required to keep multiple buffers and open multiple buffers vim.opt.hlsearch = true, -- highlight all matches on previous search pattern vim.opt.ignorecase = true, -- ignore case in search patterns vim.opt.mouse = "a", -- allow the mouse to be used in neovim vim.opt.pumheight = 10, -- pop up menu height vim.opt.showmode = false, -- we don't need to see things like -- INSERT -- anymore vim.opt.smartcase = true, -- smart case vim.opt.splitbelow = true, -- force all horizontal splits to go below current window vim.opt.splitright = true, -- force all vertical splits to go to the right of current window vim.opt.swapfile = false, -- creates a swapfile vim.opt.termguicolors = true, -- set term gui colors (most terminals support this) vim.opt.timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds) vim.opt.title = true, -- set the title of window to the value of the titlestring vim.opt.titlestring = "%<%F - DomacsVim", -- what the title of the window will be set to vim.opt.undodir = undodir, -- set an undo directory vim.opt.undofile = true, -- enable persistent undo vim.opt.updatetime = 100, -- faster completion vim.opt.writebackup = false, -- if a file is being edited by another program vim.opt.expandtab = true, -- convert tabs to spaces vim.opt.shiftwidth = 2, -- the number of spaces inserted for each indentation vim.opt.tabstop = 2, -- insert 2 spaces for a tab vim.opt.cursorline = true, -- highlight the current line vim.opt.number = true, -- set numbered lines vim.opt.numberwidth = 4, -- set number column width to 2 {default 4} vim.opt.signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time vim.opt.wrap = false, -- display lines as one long line vim.opt.shadafile = dvim_cache_dir .. "/dvim.shada", vim.opt.scrolloff = 8, -- minimal number of screen lines to keep above and below the cursor. vim.opt.sidescrolloff = 8, -- minimal number of screen lines to keep left and right of the cursor. vim.opt.showcmd = false, vim.opt.ruler = false, vim.opt.laststatus = 3