about summary refs log tree commit diff stats
path: root/.config/nvim/lua/config
diff options
context:
space:
mode:
authorVitor Gonçalves <vitorg@tilde.team>2024-02-03 11:04:08 -0300
committerVitor Gonçalves <vitorg@tilde.team>2024-02-03 11:04:08 -0300
commit8abb5dc6dfcbf67534f9fd521f1576c7e163c6e4 (patch)
treeea35a714bc6c29a792e9fb10cec16d0c879cccb0 /.config/nvim/lua/config
parent071793d598df0fcfa5cbdf62ae0f08455cf2b3c6 (diff)
downloaddots-8abb5dc6dfcbf67534f9fd521f1576c7e163c6e4.tar.gz
nvim: major refactor
it's basically the same config but refactored
Diffstat (limited to '.config/nvim/lua/config')
-rw-r--r--.config/nvim/lua/config/init.lua10
-rw-r--r--.config/nvim/lua/config/map.lua14
-rw-r--r--.config/nvim/lua/config/opt.lua27
-rw-r--r--.config/nvim/lua/config/plg.lua19
4 files changed, 70 insertions, 0 deletions
diff --git a/.config/nvim/lua/config/init.lua b/.config/nvim/lua/config/init.lua
new file mode 100644
index 0000000..c14e595
--- /dev/null
+++ b/.config/nvim/lua/config/init.lua
@@ -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")
diff --git a/.config/nvim/lua/config/map.lua b/.config/nvim/lua/config/map.lua
new file mode 100644
index 0000000..24a286f
--- /dev/null
+++ b/.config/nvim/lua/config/map.lua
@@ -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 })
diff --git a/.config/nvim/lua/config/opt.lua b/.config/nvim/lua/config/opt.lua
new file mode 100644
index 0000000..ab65cd5
--- /dev/null
+++ b/.config/nvim/lua/config/opt.lua
@@ -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
diff --git a/.config/nvim/lua/config/plg.lua b/.config/nvim/lua/config/plg.lua
new file mode 100644
index 0000000..c08d99c
--- /dev/null
+++ b/.config/nvim/lua/config/plg.lua
@@ -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, {})