about summary refs log tree commit diff stats
path: root/.config/nvim/init.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/init.lua')
-rw-r--r--.config/nvim/init.lua61
1 files changed, 61 insertions, 0 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
new file mode 100644
index 0000000..42b0544
--- /dev/null
+++ b/.config/nvim/init.lua
@@ -0,0 +1,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     = ","
+