diff --git a/config/programs/vim/configuration.nix b/config/programs/vim/configuration.nix index d7a475ab..ac46b44d 100644 --- a/config/programs/vim/configuration.nix +++ b/config/programs/vim/configuration.nix @@ -35,8 +35,62 @@ in { ${config.extraLua} EOF_991fbac8c1efc440 ''; - }; + vim.opt = { + # undo/backup directories + undofile = true; + backup = true; + # tab settings + tabstop = 4; + softtabstop = 4; + shiftwidth = 4; + expandtab = true; + matchpairs = "(:),{:},[:],<:>,「:」,『:』,【:】,“:”,‘:’,《:》,„:“,‚:‘,«:»,‹:›"; + number = true; + relativenumber = true; + ignorecase = true; + smartcase = true; + fileencoding = "utf-8"; + + linebreak = true; + showbreak = "↪"; + wildmode = "list:longest"; + scrolloff = 3; + mouse = "a"; + mousemodel = "popup"; + list = true; + listchars = "tab:▸ ,extends:❯,precedes:❮,nbsp:␣"; + autowrite = true; + shortmess = "filnxtToOFcSI"; + completeopt = "menu,preview,menuone"; + pumheight = 10; + pumblend = 10; + winblend = 0; + complete = "kspell,."; + spelllang = "en"; + spellsuggest = "best,9"; + shiftround = true; + virtualedit = "block"; + formatoptions = "tcqjmM"; + tildeop = true; + synmaxcol = 250; + startofline = false; + grepprg = "rg --vimgrep --no-heading --smart-case"; + grepformat = "%f:%l:%c:%m"; + termguicolors = true; + guicursor = "n-v-c:block-Cursor/lCursor,i-ci-ve:ver25-Cursor2/lCursor2,r-cr:hor20,o:hor20"; + signcolumn = "yes:1"; + diffopt = "vertical,filler,closeoff,context:3,internal,indent-heuristic,algorithm:histogram"; + wrap = false; + ruler = true; + }; + + extraLuaModules = [ + "config.undodir" + ]; + + output.path.path = with pkgs; [ripgrep]; + }; options.isDesktop = lib.options.mkEnableOption "desktop integration and LSP"; options.extraLua = lib.options.mkOption { type = lib.types.lines; diff --git a/config/programs/vim/modules/.keep b/config/programs/vim/modules/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/config/programs/vim/modules/lua/.keep b/config/programs/vim/modules/lua/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/config/programs/vim/modules/lua/config/undodir.lua b/config/programs/vim/modules/lua/config/undodir.lua new file mode 100644 index 00000000..27a76d46 --- /dev/null +++ b/config/programs/vim/modules/lua/config/undodir.lua @@ -0,0 +1,5 @@ +local home = os.getenv("HOME") + +vim.opt.undodir = home .. "/.cache/nvim/undo-files//" +vim.opt.directory = home .. "/.cache/nvim/swap-files//" +vim.opt.backupdir = home .. "/.cache/nvim/backup-files//"