From 74cef33a46f98efd8e8c28d4a1d34699273b2b95 Mon Sep 17 00:00:00 2001 From: scottc Date: Sat, 22 Feb 2025 21:30:21 +0000 Subject: [PATCH] First config --- .gitignore | 1 + init.lua | 12 ++++++++++++ lua/config/lazy.lua | 35 +++++++++++++++++++++++++++++++++++ lua/plugins/colorscheme.lua | 10 ++++++++++ lua/plugins/marks.lua | 7 +++++++ lua/plugins/treesitter.lua | 22 ++++++++++++++++++++++ 6 files changed, 87 insertions(+) create mode 100644 .gitignore create mode 100644 init.lua create mode 100644 lua/config/lazy.lua create mode 100644 lua/plugins/colorscheme.lua create mode 100644 lua/plugins/marks.lua create mode 100644 lua/plugins/treesitter.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e033bc6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +lazy-lock.json diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..93d406a --- /dev/null +++ b/init.lua @@ -0,0 +1,12 @@ +require("config.lazy") + +vim.opt.mouse = '' + +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.rnu = true + +vim.cmd("syntax on") + +vim.keymap.set('n', 'p', 'pu') + diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..e9e399e --- /dev/null +++ b/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/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..326ad6a --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,10 @@ +return { + { + "Mofiqul/dracula.nvim", + lazy = false, -- make sure we load this during startup if it is your main colorscheme + priority = 1000, -- make sure to load this before all the other start plugins + config = function() + vim.cmd([[colorscheme dracula]]) + end, + }, +} diff --git a/lua/plugins/marks.lua b/lua/plugins/marks.lua new file mode 100644 index 0000000..326b36d --- /dev/null +++ b/lua/plugins/marks.lua @@ -0,0 +1,7 @@ +return { + { + "chentoast/marks.nvim", + event = "VeryLazy", + opts = {}, + }, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..1e3f7c3 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,22 @@ +local opts = { + ensure_installed = { + 'c', + 'lua', + 'vim', + 'vimdoc', + 'query', + 'markdown', + 'markdown_inline', + }, +} + +local function config() + require('nvim-treesitter.configs').setup(opts) +end + +return { + 'nvim-treesitter/nvim-treesitter', + config = config, + build = ':TSUpdate' +} +