-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
87 lines (69 loc) · 1.74 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
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.cmd [[filetype plugin on]]
vim.g.mapleader = " " -- Must be before call to Lazy.nvim
require("lazy").setup("plugins")
vim.cmd [[filetype indent on]]
vim.cmd [[syntax on]]
vim.o.guifont = "FiraCode Nerd Font Mono:h12,Fira Code:h12"
vim.o.backspace = "indent,eol,start"
vim.bo.shiftwidth = 2
vim.o.shiftwidth = 2
vim.bo.tabstop = 2
vim.o.tabstop = 2
vim.o.smarttab = true
vim.o.expandtab = true
vim.o.fixeol = false
vim.o.foldenable = true
vim.o.foldmethod = "syntax"
vim.bo.autoindent = true
vim.bo.cindent = true
vim.bo.cinoptions = "N-s"
vim.o.showmatch = true
vim.wo.number = true
vim.o.cursorline = true
vim.o.colorcolumn = "100"
vim.o.signcolumn = "yes"
vim.o.scrolloff = 5
vim.o.ignorecase = true
-- Status line
vim.o.laststatus = 2
-- QuickFix and Make
vim.o.switchbuf = "useopen,usetab,newtab"
vim.o.title = true
vim.o.titlestring = "%f"
vim.o.clipboard = "unnamedplus"
vim.o.hidden = true
if vim.fn.has("win32") then
vim.g.mouse = "a"
end
require('keymap')
-- Terminal setup
vim.api.nvim_command([[autocmd TermOpen * setlocal statusline=%{b:term_title}]])
-- Additional filetypes
vim.filetype.add({
extension = {
dshl = 'hlsl',
frag = 'glsl',
vert = 'glsl',
}
})
-- Selective autoformat on save
vim.api.nvim_create_augroup('AutoFormatting', {})
vim.api.nvim_create_autocmd('BufWritePre', {
pattern = '*.lua',
group = 'AutoFormatting',
callback = function()
vim.lsp.buf.format({ async = false })
end,
})