-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
84 lines (74 loc) · 1.92 KB
/
init.lua
File metadata and controls
84 lines (74 loc) · 1.92 KB
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
vim.g.mapleader = " "
-- Options (loaded before plugins for faster startup)
vim.opt.smartindent = true
vim.opt.autoindent = true
vim.opt.expandtab = true
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.clipboard = "unnamedplus"
vim.opt.termguicolors = true
vim.opt.colorcolumn = "120"
vim.wo.number = true
vim.wo.relativenumber = true
require("config.keymaps")
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", {
performance = {
rtp = {
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
-- Autocmds
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
vim.opt.number = true
vim.opt.relativenumber = true
end,
})
vim.api.nvim_create_autocmd("BufReadPost", {
pattern = "*",
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then
vim.api.nvim_win_set_cursor(0, mark)
end
end,
})
vim.api.nvim_create_user_command("Boil", function()
vim.fn.feedkeys("iboil\t")
end, {})
vim.cmd [[highlight ColorColumn ctermbg=15 guibg=#2e3440]]
-- File types
vim.filetype.add({
extension = { j2 = "php" },
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "php",
callback = function()
if vim.fn.expand("%:e") == "j2" then
vim.cmd([[syntax include @jinja syntax/jinja.vim]])
vim.cmd([[syntax region jinjaRegion start="{{" end="}}" contains=@jinja]])
vim.cmd([[syntax region jinjaTag start="{%" end="%}" contains=@jinja]])
end
end,
})