From 2a3d18deff31e75273945d61a1785d386a310479 Mon Sep 17 00:00:00 2001 From: bpc2003 Date: Fri, 16 May 2025 11:00:33 -0400 Subject: Init commit --- lua/config/lazy.lua | 53 +++++++++++++++++++++++++++++++++++++++++++++ lua/plugins/keybindings.lua | 27 +++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 lua/config/lazy.lua create mode 100644 lua/plugins/keybindings.lua (limited to 'lua') 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