diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..867f923 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,10 @@ +-- Initialize lazy.nvim +require("config.lazy") + +-- Set leader key +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Source other configuration files +require("keybindings") +require("settings") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..dd45001 --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,6 @@ +{ + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, + "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" } +} diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..f5ee74c --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,35 @@ +-- 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) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/.config/nvim/lua/keybindings.lua b/.config/nvim/lua/keybindings.lua new file mode 100644 index 0000000..e69de29 diff --git a/.config/nvim/lua/plugins/neo-tree.lua b/.config/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..15586fd --- /dev/null +++ b/.config/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,26 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v2.x", + requires = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- for file icons + "MunifTanjim/nui.nvim", + }, + config = function() + require("neo-tree").setup({ + filesystem = { + filtered_items = { + visible = true, -- Hide files and folders starting with a dot `.` + hide_dotfiles = false, + hide_gitignored = false, + }, + }, + }) + vim.api.nvim_set_keymap( + "n", + "e", + ":Neotree toggle", + { noremap = true, silent = true } + ) + end, +} diff --git a/.config/nvim/lua/plugins/nui.lua b/.config/nvim/lua/plugins/nui.lua new file mode 100644 index 0000000..f85bdd3 --- /dev/null +++ b/.config/nvim/lua/plugins/nui.lua @@ -0,0 +1,3 @@ +return { + "MunifTanjim/nui.nvim", +} diff --git a/.config/nvim/lua/plugins/plenary.lua b/.config/nvim/lua/plugins/plenary.lua new file mode 100644 index 0000000..857227c --- /dev/null +++ b/.config/nvim/lua/plugins/plenary.lua @@ -0,0 +1,3 @@ +return { + "nvim-lua/plenary.nvim", +} diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua new file mode 100644 index 0000000..dadb085 --- /dev/null +++ b/.config/nvim/lua/settings.lua @@ -0,0 +1,7 @@ +-- Set basic options +vim.o.number = true -- Show line numbers +vim.o.relativenumber = true -- Show relative line numbers +vim.o.tabstop = 4 -- Number of spaces tabs count for +vim.o.shiftwidth = 4 -- Number of spaces to use for each step of (auto)indent +vim.o.expandtab = true -- Convert tabs to spaces +vim.o.smartindent = true -- Insert indents automatically