]> git.rmz.io Git - dotfiles.git/blobdiff - nvim/lua/config/options.lua
lazyvim: foldexpr using treesitter if available
[dotfiles.git] / nvim / lua / config / options.lua
index 1bc95c875dd511292ff456477091fa1d001417f8..81ff29e02db9ba47808933b49911f9d83ea4fa93 100644 (file)
@@ -2,26 +2,15 @@
 
 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
+vim.g.man_hardwrap = 1
+vim.env.MANWIDTH = 80
+
+vim.diagnostic.config({ virtual_text = false })
+
+-- TODO: also try noinsert
 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
-opt.timeoutlen = 1000
 
--- FIXME:
--- 2. settings I might want to include when disabling options works
+-- Some settings taken from LazyVim's default options
 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
@@ -31,5 +20,8 @@ if vim.fn.has("nvim-0.9.0") == 1 then
   opt.splitkeep = "screen"
   opt.shortmess:append({ C = true })
 end
+opt.foldmethod = "expr"
+opt.foldexpr = "v:lua.require'rmz.util'.foldexpr()"
+
 -- do not let markdown plugin change indent
 vim.g.markdown_recommended_style = 0