nvim: major refactor

it's basically the same config but refactored
This commit is contained in:
Vitor Gonçalves 2024-02-03 11:04:08 -03:00
parent 071793d598
commit 8abb5dc6df
Signed by: vitorg
GPG Key ID: B90BF113DF56EB41
9 changed files with 75 additions and 63 deletions

View File

@ -1,60 +1 @@
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 = ","
require("config")

View File

@ -0,0 +1,4 @@
{
"gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" },
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }
}

View File

@ -0,0 +1,10 @@
require("config.map")
require("config.opt")
require("config.plg")
-- Colorscheme configuration
require("gruvbox").setup({
italic = { strings = false, emphasis = false, comments = false },
transparent_mode = true
})
vim.cmd("colorscheme gruvbox")

View File

@ -0,0 +1,14 @@
local key = vim.keymap
vim.g.mapleader = " "
vim.g.localleader = " "
-- movement between splits
key.set("n", "<C-h>", "<C-w>h")
key.set("n", "<C-j>", "<C-w>j")
key.set("n", "<C-k>", "<C-w>k")
key.set("n", "<C-l>", "<C-w>l")
key.set("n", "<C-L>", ":vs<CR>")
key.set("n", "<C-J>", ":sp<CR>")
key.set("n", "<Esc><Esc>", ":nohlsearch<CR>", { silent = true })

View File

@ -0,0 +1,27 @@
local opt = vim.opt
-- 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.undofile = true -- persistent undo
vim.cmd("syntax on")
opt.termguicolors = true
opt.number = true
opt.relativenumber = true
opt.numberwidth = 2
opt.cursorline = true
opt.splitright = true
opt.splitbelow = true

View File

@ -0,0 +1,19 @@
-- Initialize lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.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)
local plugins = {
{ "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...}
}
require("lazy").setup(plugins, {})

@ -1 +0,0 @@
Subproject commit def5d57a1ae5afb1b96ebe83c4652d1c03640f4d

@ -1 +0,0 @@
Subproject commit 4176b0b720db0c90ab4030e5c1b4893faf41fd51

@ -1 +0,0 @@
Subproject commit bc8a81d3592dab86334f27d1d43c080ebf680d42