summaryrefslogtreecommitdiff
path: root/lua/config/set.lua
blob: aaa7e4202d23639ea178f73afa974728d75ba2df (plain)
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
-- :h vim.<dict> (dict: g, w, b, t, v, etc) for global variable help
-- and :h (vim.<dict>.)<something> for the option help (without the "()" part)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

vim.o.hlsearch = true

vim.wo.number = true
vim.wo.relativenumber = true

vim.o.mouse = 'a'
vim.o.clipboard = 'unnamedplus'

vim.o.breakindent = true

-- Basically a persistent undo file, useful for undotree plugin
vim.o.undofile = true

-- Case insensitive searching UNLESS /C or capital in search
vim.o.ignorecase = true
vim.o.smartcase = true

vim.wo.signcolumn = 'yes'

-- vim.o.updatetime = 250
vim.o.timeout = true
vim.o.timeoutlen = 300

-- Not sure if these affect some plugins, or if the plugins set their own options
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect'

vim.o.termguicolors = true

-- Code folding, depends on treesitter
vim.foldmethod='expr'
vim.opt.foldexpr='nvim_treesitter#foldexpr()'
-- Disable folding at startup.
vim.nofoldenable=true

-- Highlight on yank
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
  callback = function()
    vim.highlight.on_yank()
  end,
  group = highlight_group,
  pattern = '*',
})

-- Clang
vim.g.c_syntax_for_h = true