about summary refs log tree commit diff stats
path: root/.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
parent071793d598df0fcfa5cbdf62ae0f08455cf2b3c6 (diff)
downloaddots-8abb5dc6dfcbf67534f9fd521f1576c7e163c6e4.tar.gz
nvim: major refactor
it's basically the same config but refactored
Diffstat (limited to '.config')
-rw-r--r--.config/nvim/init.lua61
-rw-r--r--.config/nvim/lazy-lock.json4
-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
m---------.config/nvim/pack/plugins/start/emmet-vim0
m---------.config/nvim/pack/plugins/start/gruvbox.nvim0
m---------.config/nvim/pack/plugins/start/vim-polyglot0
9 files changed, 75 insertions, 60 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index f0de3b7..dbc863e 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -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")
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json
new file mode 100644
index 0000000..712e221
--- /dev/null
+++ b/.config/nvim/lazy-lock.json
@@ -0,0 +1,4 @@
+{
+  "gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" },
+  "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }
+}
\ No newline at end of file
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, {})
diff --git a/.config/nvim/pack/plugins/start/emmet-vim b/.config/nvim/pack/plugins/start/emmet-vim
deleted file mode 160000
-Subproject def5d57a1ae5afb1b96ebe83c4652d1c03640f4
diff --git a/.config/nvim/pack/plugins/start/gruvbox.nvim b/.config/nvim/pack/plugins/start/gruvbox.nvim
deleted file mode 160000
-Subproject 4176b0b720db0c90ab4030e5c1b4893faf41fd5
diff --git a/.config/nvim/pack/plugins/start/vim-polyglot b/.config/nvim/pack/plugins/start/vim-polyglot
deleted file mode 160000
-Subproject bc8a81d3592dab86334f27d1d43c080ebf680d4