diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..a2b3d36 --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,11 @@ +vim.o.number = true +vim.o.relativenumber = true +vim.o.cursorline = true +vim.o.wrap = false +vim.o.tabstop = 2 +vim.o.softtabstop = 2 +vim.o.shiftwidth = 2 +vim.g.mapleader = " " + +-- Plugins bootstrap +require("config.lazy") diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..52b176f --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,11 @@ +{ + "colorviewer.nvim": { "branch": "main", "commit": "7e3fcff372c68526d85028053199721b635d83a1" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..404f1fe --- /dev/null +++ b/nvim/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,30 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Setup lazy.nvim + +require("lazy").setup({ + spec = { + -- import plugins + { import = "plugins" }, + }, + -- Configure any other settings. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "tokyonight" } }, + -- automatically check for plugin updates + checker = { enabled = true, notify = true }, +}) diff --git a/nvim/.config/nvim/lua/plugins/color-viewer.lua b/nvim/.config/nvim/lua/plugins/color-viewer.lua new file mode 100644 index 0000000..a0661ed --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/color-viewer.lua @@ -0,0 +1,8 @@ +return { + 'Godswill-255/colorviewer.nvim', + config = function() + require('colorviewer').setup({ + symbol = "■", + }) + end +} diff --git a/nvim/.config/nvim/lua/plugins/line.lua b/nvim/.config/nvim/lua/plugins/line.lua new file mode 100644 index 0000000..b9b4d36 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/line.lua @@ -0,0 +1,62 @@ +return { + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + opts = function() + return { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + refresh_time = 16, -- ~60fps + events = { + 'WinEnter', + 'BufEnter', + 'BufWritePost', + 'SessionLoadPost', + 'FileChangedShellPost', + 'VimResized', + 'Filetype', + 'CursorMoved', + 'CursorMovedI', + 'ModeChanged', + }, + }, + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } + end + } +} diff --git a/nvim/.config/nvim/lua/plugins/noice.lua b/nvim/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..3f76046 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,15 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + } +} diff --git a/nvim/.config/nvim/lua/plugins/theme.lua b/nvim/.config/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..1d8545a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/theme.lua @@ -0,0 +1,14 @@ +return { + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = function() + if os.getenv("TERM") ~= "linux" then + vim.cmd.colorscheme("tokyonight-storm") + end + end + } +} + diff --git a/nvim/.config/nvim/lua/plugins/which-key.lua b/nvim/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..205da0a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,18 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)" + } + }, +}