diff options
author | Yigit Sever | 2021-10-08 00:09:37 +0300 |
---|---|---|
committer | Yigit Sever | 2021-10-08 00:09:37 +0300 |
commit | a8903ac96dd7cd0e1af968d729e557d579f26124 (patch) | |
tree | afe2c89a0fbc1b0bfe79dd1b9ea9d7050f83fc08 /.config/nvim/lua/settings.lua | |
parent | 82bc7c109cd3890b3494d88f7ead43c3aa3e7860 (diff) | |
download | dotfiles-a8903ac96dd7cd0e1af968d729e557d579f26124.tar.gz dotfiles-a8903ac96dd7cd0e1af968d729e557d579f26124.tar.bz2 dotfiles-a8903ac96dd7cd0e1af968d729e557d579f26124.zip |
neovim: migrate to init.lua
Diffstat (limited to '.config/nvim/lua/settings.lua')
-rw-r--r-- | .config/nvim/lua/settings.lua | 103 |
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 | |||
14 | local o = vim.o -- gl[o]bal options | ||
15 | local wo = vim.wo -- [w]indow-local [o]ptions | ||
16 | local bo = vim.bo -- [b]uffer-local [o]ptions | ||
17 | local opt = vim.opt -- convenient :set | ||
18 | |||
19 | -- look & feel | ||
20 | o.termguicolors = true | ||
21 | vim.cmd('colorscheme rose-pine') | ||
22 | |||
23 | -- interact with system clipboard | ||
24 | opt.clipboard:append('unnamedplus') | ||
25 | |||
26 | -- copy indent on a new line | ||
27 | o.autoindent = true | ||
28 | |||
29 | -- :h tabstop, 2. point | ||
30 | -- use appropriate number of spaces to insert a <Tab> | ||
31 | o.expandtab = true | ||
32 | o.shiftwidth = 4 | ||
33 | o.softtabstop = 4 | ||
34 | o.tabstop = 8 | ||
35 | |||
36 | -- use english for spellchecking, but don't spellcheck by default | ||
37 | o.spell = true | ||
38 | o.spelllang = "en_gb" | ||
39 | o.spell = false | ||
40 | |||
41 | -- tab completion, zsh style | ||
42 | o.wildmode = "full" | ||
43 | opt.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) | ||
52 | o.joinspaces = false | ||
53 | |||
54 | -- keep n lines above/below cursor while scrolling | ||
55 | o.scrolloff = 4 | ||
56 | -- line numbers | ||
57 | o.number = true | ||
58 | -- fold manually, when I place markers | ||
59 | o.foldmethod = "marker" | ||
60 | -- set the terminal title | ||
61 | o.title = true | ||
62 | -- wrap using 'breakat' character | ||
63 | o.linebreak = true | ||
64 | -- new split panes will split to below and right | ||
65 | o.splitbelow = true | ||
66 | o.splitright = true | ||
67 | -- highlight the current line, yoc undoes | ||
68 | o.cursorline = true | ||
69 | -- current line actual number, rest are relative | ||
70 | o.relativenumber = true | ||
71 | -- we are already using a cursorline, don't clobber linter messages | ||
72 | o.showmode = false | ||
73 | -- jump to the matching bracket briefly | ||
74 | o.showmatch = true | ||
75 | -- move freely between buffers | ||
76 | o.hidden = true | ||
77 | |||
78 | -- persistent undo | ||
79 | o.undodir = "/home/yigit/.vim/undodir" | ||
80 | o.undofile = true | ||
81 | |||
82 | -- lower case searches ignore case, upper case searches do not | ||
83 | o.ignorecase = true | ||
84 | o.smartcase = true | ||
85 | |||
86 | -- https://stackoverflow.com/a/3445040/ | ||
87 | -- switch case labels | ||
88 | o.cinoptions = "l1" | ||
89 | |||
90 | if vim.fn.executable("rg") then | ||
91 | o.grepprg = "rg --vimgrep --no-heading --smart-case" | ||
92 | end | ||
93 | |||
94 | -- iwhite: ignore changes in amount of white space. | ||
95 | -- vertical: start diff mode with vertical splits | ||
96 | -- filler: show filler lines, | ||
97 | opt.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 | ||
103 | opt.completeopt = {"menu", "preview"} | ||