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
|
local opt = vim.opt
local var = vim.g
local key = vim.keymap
-- tabs
opt.tabstop = 4
opt.softtabstop = 4
opt.shiftwidth = 4
opt.expandtab = true
opt.smartindent = true
-- search
opt.showmatch = true
opt.ignorecase = true
opt.smartcase = true
opt.swapfile = false -- noswapfile
opt.clipboard = "unnamedplus"
opt.undofile = true -- persistent undo
vim.cmd("syntax on")
opt.termguicolors = true
opt.number = true
opt.relativenumber = true
opt.numberwidth = 2
opt.cursorline = true
opt.background = "dark"
var.gruvbox_improved_warnings = 1
vim.cmd("colorscheme gruvbox")
vim.cmd([[autocmd VimEnter * hi Normal ctermbg=NONE guibg=NONE]])
-- keybindings
var.mapleader = " "
var.localleader = " "
-- splits
key.set("n", "<leader>h", "<C-w>h")
key.set("n", "<leader>j", "<C-w>j")
key.set("n", "<leader>k", "<C-w>k")
key.set("n", "<leader>l", "<C-w>l")
key.set("n", "<leader>L", ":vs<CR>")
key.set("n", "<leader>J", ":sp<CR>")
opt.splitright = true
opt.splitbelow = true
key.set("n", "<Esc><Esc>", ":nohlsearch<CR>", { silent = true })
key.set("n", "<leader>w", ":w!<CR>")
key.set("n", "<leader>W", ":wq!<CR>")
key.set("t", [[<C-\]], [[<C-\><C-n>]])
vim.api.nvim_create_autocmd("FileType", { pattern=[[html,css]], command = "EmmetInstall" })
var.user_emmet_mode = "n"
var.user_emmet_install_global = 0
var.user_emmet_leader_key = ","
|