From 2a3d18deff31e75273945d61a1785d386a310479 Mon Sep 17 00:00:00 2001 From: bpc2003 Date: Fri, 16 May 2025 11:00:33 -0400 Subject: Init commit --- init.lua | 6 +++++ lazy-lock.json | 5 +++++ lua/config/lazy.lua | 53 +++++++++++++++++++++++++++++++++++++++++++++ lua/plugins/keybindings.lua | 27 +++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/config/lazy.lua create mode 100644 lua/plugins/keybindings.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..5f2496e --- /dev/null +++ b/init.lua @@ -0,0 +1,6 @@ +require("config.lazy") +require("plugins.keybindings") + +vim.cmd([[colorscheme gruvbox]]) +vim.wo.relativenumber = true +vim.opt.clipboard = "unnamedplus" diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..ba149fd --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,5 @@ +{ + "gruvbox.nvim": { "branch": "main", "commit": "00e38a379bab3389e187b3953566d67d494dfddd" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" } +} diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..d3c4443 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,53 @@ +-- 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 + { + "nvim-treesitter/nvim-treesitter", + run = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = "all", + highlight = { + enable = true, + disable = {}, + }, + indent = { + enable = true, + }, + }) + end + }, + { + "ellisonleao/gruvbox.nvim" + }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "gruvbox" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/lua/plugins/keybindings.lua b/lua/plugins/keybindings.lua new file mode 100644 index 0000000..4665e69 --- /dev/null +++ b/lua/plugins/keybindings.lua @@ -0,0 +1,27 @@ +-- buffer commands +vim.keymap.set('n', 't', ':tabnew', { noremap = true, silent = true }) +vim.keymap.set('n', 'n', 'gt') +vim.keymap.set('n', 'p', 'gT') + +-- terminal +vim.keymap.set('n', 'v', ':vertical term', { noremap = true, silent = true}) +vim.keymap.set('n', 'h', ':belowright term', { noremap = true, silent = true}) + +-- lazy +vim.keymap.set('n', 'l', ':Lazy', { noremap = true }) +vim.keymap.set('n', 'lu', ':Lazy update', { noremap = true }) +vim.keymap.set('n', 'ls', ':Lazy sync', { noremap = true }) +vim.keymap.set('n', 'lx', ':Lazy clean', { noremap = true }) +vim.keymap.set('n', 'lc', ':Lazy check', { noremap = true }) +vim.keymap.set('n', 'll', ':Lazy log', { noremap = true }) +vim.keymap.set('n', 'lr', ':Lazy restore', { noremap = true }) +vim.keymap.set('n', 'lp', ':Lazy profile', { noremap = true }) +vim.keymap.set('n', 'ld', ':Lazy debug', { noremap = true }) + +-- write commands +vim.keymap.set('n', 's', ':w', { noremap = true }) +vim.keymap.set('n', 'sq', ':wq', { noremap = true }) + +-- quit +vim.keymap.set('n', 'q', ':q', { silent = true }) +vim.keymap.set('n', 'Q', ':q!', { silent = true}) -- cgit v1.2.3