From b9fafe3d854673faf80f7e6c5c628c4ae8ae9290 Mon Sep 17 00:00:00 2001 From: Vitor Gonçalves Date: Wed, 24 Jan 2024 03:31:49 -0300 Subject: nvim: major updates, init.lua and gruvbox finally --- .config/nvim/init.lua | 61 +++++++++++++++++++++++++++++++++ .config/nvim/init.vim | 55 ----------------------------- .config/nvim/pack/plugins/start/gruvbox | 1 + .gitmodules | 6 ++++ 4 files changed, 68 insertions(+), 55 deletions(-) create mode 100644 .config/nvim/init.lua delete mode 100644 .config/nvim/init.vim create mode 160000 .config/nvim/pack/plugins/start/gruvbox 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", "h", "h") +key.set("n", "j", "j") +key.set("n", "k", "k") +key.set("n", "l", "l") +key.set("n", "L", ":vs") +key.set("n", "J", ":sp") +opt.splitright = true +opt.splitbelow = true + +key.set("n", "", ":nohlsearch", { silent = true }) +key.set("n", "w", ":w!") +key.set("n", "W", ":wq!") + +key.set("t", [[]]) + +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 = "," + diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100644 index 58f2798..0000000 --- a/.config/nvim/init.vim +++ /dev/null @@ -1,55 +0,0 @@ -set nocompatible - -" inteligent indentation -filetype indent plugin on -set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smartindent -set showmatch ignorecase smartcase -set noswapfile - -set clipboard=unnamedplus - -set undofile " persist undo - -syntax on -set termguicolors - -set number relativenumber numberwidth=2 cursorline -set conceallevel=3 - -set background=dark -let g:sonokai_style = 'shusia' -let g:sonokai_better_performance = 1 -let g:sonokai_transparent_background = 1 -colo sonokai - -"" bindings -" leader mapping -nnoremap -let mapleader=" " -let localleader=" " - -" easy splits -nnoremap h h -nnoremap j j -nnoremap k k -nnoremap l l -nnoremap L :vs -nnoremap J :sp -nnoremap :nohlsearch -set splitright splitbelow - -" easy write -nmap w :w! -nmap W :w! -nmap q :wq! - -" easy term-mode -tnoremap - -" emmet -let g:user_emmet_mode='n' " only on normal mode, thx -let g:user_emmet_install_global = 0 -autocmd FileType html,css EmmetInstall - -let g:user_emmet_leader_key=',' - diff --git a/.config/nvim/pack/plugins/start/gruvbox b/.config/nvim/pack/plugins/start/gruvbox new file mode 160000 index 0000000..f1ecde8 --- /dev/null +++ b/.config/nvim/pack/plugins/start/gruvbox @@ -0,0 +1 @@ +Subproject commit f1ecde848f0cdba877acb0c740320568252cc482 diff --git a/.gitmodules b/.gitmodules index 9494896..12b9b80 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,9 @@ [submodule ".config/zsh/plugins/zsh-syntax-highlighting"] path = .config/zsh/plugins/zsh-syntax-highlighting url = https://github.com/zsh-users/zsh-syntax-highlighting.git +[submodule ".config/nvim/pack/plugins/start/gruvbox"] + path = .config/nvim/pack/plugins/start/gruvbox + url = https://github.com/morhetz/gruvbox +[submodule ".config/nvim/pack/plugins/start/vimpeccable"] + path = .config/nvim/pack/plugins/start/vimpeccable + url = https://github.com/svermeulen/vimpeccable -- cgit 1.4.1-2-gfad0