summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/settings.lua
diff options
context:
space:
mode:
diffstat (limited to '.config/nvim/lua/settings.lua')
-rw-r--r--.config/nvim/lua/settings.lua103
1 files changed, 103 insertions, 0 deletions
diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua
new file mode 100644
index 0000000..5996c51
--- /dev/null
+++ b/.config/nvim/lua/settings.lua
@@ -0,0 +1,103 @@
1-- ┌──────────────────┐
2-- │ ▗ │
3-- │▛▀▖▞▀▖▞▀▖▌ ▌▄ ▛▚▀▖│
4-- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│
5-- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│
6-- └──────────────────┘
7-- ┌───────────────────────┐
8-- │ ▐ ▐ ▗ │
9-- │▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│
10-- │▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│
11-- │▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │
12-- └───────────────────────┘
13
14local o = vim.o -- gl[o]bal options
15local wo = vim.wo -- [w]indow-local [o]ptions
16local bo = vim.bo -- [b]uffer-local [o]ptions
17local opt = vim.opt -- convenient :set
18
19-- look & feel
20o.termguicolors = true
21vim.cmd('colorscheme rose-pine')
22
23-- interact with system clipboard
24opt.clipboard:append('unnamedplus')
25
26-- copy indent on a new line
27o.autoindent = true
28
29-- :h tabstop, 2. point
30-- use appropriate number of spaces to insert a <Tab>
31o.expandtab = true
32o.shiftwidth = 4
33o.softtabstop = 4
34o.tabstop = 8
35
36-- use english for spellchecking, but don't spellcheck by default
37o.spell = true
38o.spelllang = "en_gb"
39o.spell = false
40
41-- tab completion, zsh style
42o.wildmode = "full"
43opt.wildignore = {
44 '*.o', '*.obj', '*.class', '*.aux', '*.lof', '*.log', '*.lot', '*.fls',
45 '*.toc', '*.fmt', '*.fot', '*.cb', '*.cb2', '.*.lb', '.dvi', '*.xdv',
46 '*.bbl', '*.bcf', '*.blg', '*-blx.aux', '*-blx.bib', '*.run.xml',
47 '*.fdb_latexmk', '*.synctex', '*.synctex(busy)', '*.synctex.gz',
48 '*.synctex.gz(busy)', '*.pdfsync'
49}
50
51-- put one space while joining (not two)
52o.joinspaces = false
53
54-- keep n lines above/below cursor while scrolling
55o.scrolloff = 4
56-- line numbers
57o.number = true
58-- fold manually, when I place markers
59o.foldmethod = "marker"
60-- set the terminal title
61o.title = true
62-- wrap using 'breakat' character
63o.linebreak = true
64-- new split panes will split to below and right
65o.splitbelow = true
66o.splitright = true
67-- highlight the current line, yoc undoes
68o.cursorline = true
69-- current line actual number, rest are relative
70o.relativenumber = true
71-- we are already using a cursorline, don't clobber linter messages
72o.showmode = false
73-- jump to the matching bracket briefly
74o.showmatch = true
75-- move freely between buffers
76o.hidden = true
77
78-- persistent undo
79o.undodir = "/home/yigit/.vim/undodir"
80o.undofile = true
81
82-- lower case searches ignore case, upper case searches do not
83o.ignorecase = true
84o.smartcase = true
85
86-- https://stackoverflow.com/a/3445040/
87-- switch case labels
88o.cinoptions = "l1"
89
90if vim.fn.executable("rg") then
91 o.grepprg = "rg --vimgrep --no-heading --smart-case"
92end
93
94-- iwhite: ignore changes in amount of white space.
95-- vertical: start diff mode with vertical splits
96-- filler: show filler lines,
97opt.diffopt = {
98 "iwhite", "vertical", "filler", "algorithm:patience", "indent-heuristic"
99}
100
101-- menu: use a popup menu to show the possible completions
102-- preview: show extra information
103opt.completeopt = {"menu", "preview"}