]> git.rmz.io Git - dotfiles.git/commitdiff
nvim: reset options similar to vimrc
authorSamir Benmendil <me@rmz.io>
Tue, 11 Apr 2023 13:20:27 +0000 (14:20 +0100)
committerSamir Benmendil <me@rmz.io>
Tue, 31 Oct 2023 23:08:51 +0000 (23:08 +0000)
I wanted to disable the options that LazyVim sets, but there seems to be
a bug that prevents this at the moment. So reset the various settings I
have in my vimrc again in `config/options.lua`.

See https://github.com/LazyVim/LazyVim/issues/566

nvim/lua/config/options.lua
nvim/lua/plugins/core.lua

index 3ea1454fa3580ee1ca5e9e9e03b87e5269aed64b..757eeed8e4fa708a597a38456ba41efdd524e77f 100644 (file)
@@ -1,3 +1,35 @@
 -- Options are automatically loaded before lazy.nvim startup
--- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
--- Add any additional options here
+
+local opt = vim.opt
+
+-- FIXME: There's currently no way to disable LazyVim's default options, so
+-- reset the ones from vimrc.
+-- See https://github.com/LazyVim/LazyVim/issues/566
+-- 1. settings that are overriden in LazyVim options
+opt.clipboard = "" -- Sync with system clipboard
+opt.completeopt = "menu,menuone,noselect"
+opt.formatoptions:append("jcrnqlt") -- see vimrc for details
+opt.formatoptions:remove("o") -- see vimrc for details
+opt.number = false
+opt.relativenumber = false
+opt.scrolloff = 5
+opt.shiftwidth = 4
+opt.tabstop = 8
+opt.sidescrolloff = 1
+opt.splitbelow = false
+opt.splitright = true
+
+-- FIXME:
+-- 2. settings I might want to include when disabling options works
+opt.pumblend = 10 -- Popup blend
+opt.pumheight = 10 -- Maximum number of entries in a popup
+opt.showmode = false -- Dont show mode since we have a statusline
+opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
+opt.timeoutlen = 300
+opt.updatetime = 200 -- Save swap file and trigger CursorHold
+if vim.fn.has("nvim-0.9.0") == 1 then
+  opt.splitkeep = "screen"
+  opt.shortmess:append({ C = true })
+end
+-- do not let markdown plugin change indent
+vim.g.markdown_recommended_style = 0
index 32a62dcfbe2bb0526c6e6ddcec17ffd05bf37542..5b83b88b728b37f0482aa23ba7dc1fbe682bc598 100644 (file)
@@ -4,6 +4,7 @@ return {
     opts = {
       defaults = {
         autocmds = false,
+        options = false,
       },
     },
   },