diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..dbc863e --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1 @@ +require("config") diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..183685d --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,7 @@ +{ + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" }, + "telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} diff --git a/nvim/.config/nvim/lua/config/init.lua b/nvim/.config/nvim/lua/config/init.lua new file mode 100644 index 0000000..5d5ae58 --- /dev/null +++ b/nvim/.config/nvim/lua/config/init.lua @@ -0,0 +1,3 @@ +require("config.remap") +require("config.settings") +require("config.lazy") diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..4375521 --- /dev/null +++ b/nvim/.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/nvim/.config/nvim/lua/config/remap.lua b/nvim/.config/nvim/lua/config/remap.lua new file mode 100644 index 0000000..28499fd --- /dev/null +++ b/nvim/.config/nvim/lua/config/remap.lua @@ -0,0 +1,6 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- builtins +vim.keymap.set("n", "e", vim.cmd.Ex, {desc = "Explorer"}) +vim.keymap.set("n", "bd", ":bd", {desc = "Close Buffer"}) diff --git a/nvim/.config/nvim/lua/config/settings.lua b/nvim/.config/nvim/lua/config/settings.lua new file mode 100644 index 0000000..40447b5 --- /dev/null +++ b/nvim/.config/nvim/lua/config/settings.lua @@ -0,0 +1,11 @@ +vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.wrap = true diff --git a/nvim/.config/nvim/lua/plugins/catppuccin.lus b/nvim/.config/nvim/lua/plugins/catppuccin.lus new file mode 100644 index 0000000..19df104 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/catppuccin.lus @@ -0,0 +1 @@ +return { "catppuccin/nvim", name = "catppuccin", priority = 1000 } diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..8baa1ed --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,19 @@ +return { + 'nvim-telescope/telescope.nvim', version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + -- optional but recommended + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + }, + keys = { + { + "fb", + "Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true", + desc = "Buffers", + }, + { "ff", "Telescope find_files", desc = "Find Files"}, + { "fr", "Telescope oldfiles", desc = "Recent" }, + { "fB", "Telescope buffers", desc = "Buffers (all)" }, + { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, + } +} diff --git a/nvim/.config/nvim/lua/plugins/whichkey.lua b/nvim/.config/nvim/lua/plugins/whichkey.lua new file mode 100644 index 0000000..06423bd --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/whichkey.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)", + }, + } +}