about summary refs log tree commit diff stats
path: root/.config/nvim/init.lua
blob: f0de3b7e038e9b817067721297b827db1c96d2e7 (plain) (blame)
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
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"
require('gruvbox').setup({ transparent_mode = true, dim_inactive = true, })
vim.cmd("colorscheme gruvbox")


-- 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     = ","