aboutsummaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/eugenetriguba/options.lua
blob: a0c794bc1793eb017e9c254c8e4f09d6c26558d0 (plain) (blame)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
local opt = vim.opt

-- Make line numbers default
opt.number = true

-- Use relative line numbers, to help with jumping.
opt.relativenumber = true

-- In Insert mode, replace <Tab> with the appropriate
-- number of spaces.
opt.expandtab = true

-- When starting a new line, use smart indentation to
-- figure out what indentation the new line should be
-- at.
opt.autoindent = true
opt.smartindent = true

-- Number of spaces to use for each step of autoindentation.
opt.shiftwidth = 2

-- Number of spaces to use when using <Tab>.
opt.tabstop = 2

-- Case-insensitive searching UNLESS \C or one
-- or more capital letters in the search term
opt.ignorecase = true
opt.smartcase = true

-- Keep signcolumn on by default
opt.signcolumn = 'yes'

-- Show which line your cursor is on
opt.cursorline = true

-- If performing an operation that would fail due to unsaved
-- changes in the buffer (like `:q`), instead raise a dialog
-- asking if you wish to save the current file(s)
--
-- See `:help 'confirm'`
opt.confirm = true

-- Save undo history
opt.undofile = true

-- Minimal number of screen lines to keep above and below the cursor.
opt.scrolloff = 10

-- Enable mouse mode e.g. can be useful for resizing splits
opt.mouse = 'a'

-- Don't show the mode, since it's already in the status line
opt.showmode = false

-- Sync clipboard between OS and Neovim.
--
-- Schedule the setting after `UiEnter` because it can increase
-- startup-time. Remove this option to keep the OS clipboard
-- independent from neovim.
--
-- See `:help 'clipboard'`
vim.schedule(function()
  opt.clipboard = 'unnamedplus'
end)

-- Continue to visually indent wrapped lines
-- to preserve horizontal blocks of text
opt.breakindent = true

-- Decrease update time
opt.updatetime = 250

-- Decrease mapped sequence wait time
opt.timeoutlen = 300

-- Configure how new splits should be opened
opt.splitright = true
opt.splitbelow = true

-- Sets how neovim will display certain whitespace characters
-- in the editor.
--
-- See `:help 'list'` and `:help 'listchars'`
opt.list = true
opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }

-- Preview substitutions live, as you type!
opt.inccommand = 'split'

-- Enable project-local configuration
vim.o.exrc = true