-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.lua
115 lines (98 loc) · 2.22 KB
/
init.lua
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
-- globals
local g, cmd, fn, o, og, wo = vim.g, vim.cmd, vim.fn, vim.opt, vim.opt_global, vim.wo
g.mousehide = true
og.termguicolors = true
g.mapleader = " "
-- global border_type
g.border_type = "rounded" -- supported: rounded, single, double
require "utils"
L("signs", function(signs)
signs.setup()
end)
L "lazy_init"
-- encoding
og.encoding = "utf-8"
og.fileencoding = "utf-8"
-- general settingsinit
cmd [[
filetype plugin indent on
syntax enable
]]
o.timeout = true
o.ttimeout = false
o.backspace = { "indent", "eol", "start" }
o.showmatch = true
o.showmode = false
o.whichwrap:append "b,s,h,l,<,>,<,>"
o.scrolljump = 10
o.scrolloff = 5
o.mouse = "a"
o.modeline = true
o.updatetime = 100
o.cmdheight = 2
o.hidden = true
o.confirm = true
o.signcolumn = "auto:3"
o.path:append "**"
o.undodir = fn.expand "~/.config/nvim/undodir"
o.undofile = true
o.inccommand = "split"
-- More natural splitting
o.splitbelow = true
o.splitright = true
o.clipboard = ""
o.swapfile = false
o.spelllang = { "de_de", "en_us" }
o.backup = false
o.writebackup = false
-- line numbers
o.rnu = true
o.nu = true
o.ruler = true
-- search
o.incsearch = true
o.hlsearch = true
o.ignorecase = true
o.smartcase = true
-- wildmenu
o.wildmenu = true
o.wildmode = { longest = "full", "full" }
o.wildoptions = "pum"
o.cpoptions:append "n"
o.infercase = false
o.shortmess:append "c"
-- formatting
o.wrap = true
o.autoindent = true
o.shiftwidth = 4
o.expandtab = true
o.tabstop = 4
o.softtabstop = 4
o.joinspaces = false
o.laststatus = 2
o.comments = { sl = "/*", mb = "*", elx = "*/" }
o.linebreak = true
o.breakindent = true
o.breakindentopt = { shift = "2" }
o.conceallevel = 2 -- for ligatures, toggle with keymap
wo.foldtext = "v:lua.vim.treesitter.foldtext()"
-- Plugin settings
-- tex falvor
g.tex_flavor = "latex"
-- whichkey
g.whichkey = true
if fn.has "windows" then
o.fillchars = { vert = "┃", eob = "■", diff = "╱" }
end
-- command abbreviations
vim.cmd [[cabbrev yfn :let @+ = expand("%:t")]]
vim.cmd [[cabbrev yfp :let @+ = expand("%:p")]]
vim.cmd [[cabbrev yrp :let @+ = expand("%")]]
L "mappings"
L("user_settings", function(settings)
settings.setup()
end)
L("lazy", function(lazy)
local opts = L "lazy_opts" or {}
lazy.setup("plugins", opts)
end)