From a7f8df9e50fd40b78512bc10324495b8932186bd Mon Sep 17 00:00:00 2001 From: Falon Clark Date: Thu, 19 Mar 2026 13:09:21 -0400 Subject: [PATCH] Initial Commit --- init.lua | 10 ++++++ lazy-lock.json | 32 +++++++++++++++++ lua/config/autocmd.lua | 24 +++++++++++++ lua/config/lazy.lua | 35 +++++++++++++++++++ lua/config/mappings.lua | 62 +++++++++++++++++++++++++++++++++ lua/config/options.lua | 41 ++++++++++++++++++++++ lua/plugins/autopairs.lua | 25 +++++++++++++ lua/plugins/barbar.lua | 19 ++++++++++ lua/plugins/chezmoi.lua | 11 ++++++ lua/plugins/colorscheme.lua | 25 +++++++++++++ lua/plugins/comment.lua | 7 ++++ lua/plugins/completions.lua | 36 +++++++++++++++++++ lua/plugins/fterm.lua | 5 +++ lua/plugins/lsp.lua | 35 +++++++++++++++++++ lua/plugins/lualine.lua | 11 ++++++ lua/plugins/mason.lua | 21 +++++++++++ lua/plugins/neo-tree.lua | 16 +++++++++ lua/plugins/none-ls.lua | 13 +++++++ lua/plugins/origami.lua | 11 ++++++ lua/plugins/render-markdown.lua | 7 ++++ lua/plugins/telescope.lua | 23 ++++++++++++ lua/plugins/themery.lua | 30 ++++++++++++++++ lua/plugins/treesitter.lua | 17 +++++++++ lua/plugins/which-key.lua | 21 +++++++++++ 24 files changed, 537 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/config/autocmd.lua create mode 100644 lua/config/lazy.lua create mode 100644 lua/config/mappings.lua create mode 100644 lua/config/options.lua create mode 100644 lua/plugins/autopairs.lua create mode 100644 lua/plugins/barbar.lua create mode 100644 lua/plugins/chezmoi.lua create mode 100644 lua/plugins/colorscheme.lua create mode 100644 lua/plugins/comment.lua create mode 100644 lua/plugins/completions.lua create mode 100644 lua/plugins/fterm.lua create mode 100644 lua/plugins/lsp.lua create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/mason.lua create mode 100644 lua/plugins/neo-tree.lua create mode 100644 lua/plugins/none-ls.lua create mode 100644 lua/plugins/origami.lua create mode 100644 lua/plugins/render-markdown.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/themery.lua create mode 100644 lua/plugins/treesitter.lua create mode 100644 lua/plugins/which-key.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..4e1e332 --- /dev/null +++ b/init.lua @@ -0,0 +1,10 @@ +-- Rebind leader to space +vim.keymap.set("n", "", "", { noremap = true, silent = true }) +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +require("config.lazy") + +require("config.options") +require("config.mappings") +require("config.autocmd") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..35d3122 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,32 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "FTerm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" }, + "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "catppuccin": { "branch": "main", "commit": "384f304c8b04664c9e0091fbfb3923c5f97c1bcf" }, + "chezmoi.nvim": { "branch": "main", "commit": "ad26a6c4f5be0c348612518fcb1b7116649e026f" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, + "gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a676ab7282da8d651e175118bcf54483ca11e46d" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "none-ls.nvim": { "branch": "main", "commit": "c9317c2a8629d4e39e7cf47be74cb67f3ab37cda" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, + "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, + "nvim-lspconfig": { "branch": "master", "commit": "11f730caa976a00def4387cbacb6183cec7939c7" }, + "nvim-origami": { "branch": "main", "commit": "e5b527f41d18c2ee5af868e1a3939b60f15fdb90" }, + "nvim-tree.lua": { "branch": "master", "commit": "e16cd38962bc40c22a51ee004aa4f43726d74a16" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "render-markdown.nvim": { "branch": "main", "commit": "e3c18ddd27a853f85a6f513a864cf4f2982b9f26" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, + "themery.nvim": { "branch": "main", "commit": "bfa58f4b279d21cb515b28023e1b68ec908584b2" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua new file mode 100644 index 0000000..3cb9798 --- /dev/null +++ b/lua/config/autocmd.lua @@ -0,0 +1,24 @@ +vim.api.nvim_create_autocmd("InsertEnter", { + callback = function() + vim.opt.number = false + vim.opt.relativenumber = true + end, +}) + +vim.api.nvim_create_autocmd("InsertLeave", { + callback = function() + vim.opt.number = true + vim.opt.relativenumber = false + end, +}) + +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" }, + callback = function(ev) + local bufnr = ev.buf + local edit_watch = function() + require("chezmoi.commands.__edit").watch(bufnr) + end + vim.schedule(edit_watch) + end, +}) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..f5ee74c --- /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/config/mappings.lua b/lua/config/mappings.lua new file mode 100644 index 0000000..dce96e6 --- /dev/null +++ b/lua/config/mappings.lua @@ -0,0 +1,62 @@ +local function map(m, k, v) + vim.keymap.set(m, k, v, { noremap = true, silent = true}) +end + +-- Basic File Manip +map("n","w","write") + +-- Window movement +map("n", "", "h") +map("n", "", "j") +map("n", "", "k") +map("n", "", "l") + +-- Neo-Tree +map("n", "e", "NvimTreeToggle") + +-- Telescope +map("n", "ff", "Telescope find_files") +map("n", "fg", "Telescope live_grep") + +-- Buffer Navigation w/ shift + left/right +map("n", "", "bnext") +map("n", "", "bprevious") + +-- Close and Force Close Buffer +map("n", "q", "BufferClose") +map("n", "Q", "BufferClose!") + +-- Reorder Buffers w/ alt + shift + left/right +map('n', '', 'BufferMovePrevious') +map('n', '', 'BufferMoveNext') + +-- Jump To Buffer with alt +-- TODO!! + +-- Pin Buffer with alt+p +map('n', '', 'BufferPin') + +-- Open FTerm +map('n', 'z', ":lua require('FTerm').open()") +map('t', '', 'lua require("FTerm").close()') --preserves session + +-- Change Theme +map("n", "p", "Themery") --cycle themes + +-- LSP +map("n", "K", vim.lsp.buf.hover) +map("n", "gd", vim.lsp.buf.definition) +map("n", "ca", vim.lsp.buf.code_action) + +-- Formatting +map("n", "gf", vim.lsp.buf.format) + +-- Toggle rel/abs line numbers +map("n", "nn", function() + if vim.wo.relativenumber then + vim.wo.relativenumber = false + vim.wo.number = true + else + vim.wo.relativenumber = true + end +end) diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..fbfe419 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,41 @@ +local options = { + -- Make text not wrap because its annoying + wrap = false, + + -- Set nvim to use terminal colors + termguicolors = true, + + -- Highlight line cursor is on + cursorline = true, + + -- Enable absolute and relative line numbers + number = true, + relativenumber = true, + + -- Indentation + tabstop = 4, + shiftwidth = 4, + expandtab = true, + smartindent = true, + + winborder = "rounded", + + -- Bind yank and put to wl-clipboard + clipboard = "unnamedplus", + + updatetime = 250, + + swapfile = false, + + foldmethod = "manual" +} + +for k, v in pairs(options) do + vim.opt[k] = v +end + +-- Diagnostics Setup +vim.diagnostic.config({ + virtual_text = false, + virtual_lines = true, +}) diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua new file mode 100644 index 0000000..07550f6 --- /dev/null +++ b/lua/plugins/autopairs.lua @@ -0,0 +1,25 @@ +return { + 'windwp/nvim-autopairs', + event = "InsertEnter", + config = function() + require("nvim-autopairs").setup({ + disable_in_macro = true, -- disable when recording or executing a macro + disable_in_visualblock = false, -- disable when insert after visual block mode + disable_in_replace_mode = true, + ignored_next_char = [=[[%w%%%'%[%"%.%`%$]]=], + enable_moveright = true, + enable_afterquote = true, -- add bracket pairs after quote + enable_check_bracket_line = true, --- check bracket in same line + enable_bracket_in_quote = true, -- + enable_abbr = false, -- trigger abbreviation + break_undo = true, -- switch for basic rule break undo sequence + check_ts = false, + map_cr = true, + map_bs = true, -- map the key + map_c_h = false, -- Map the key to delete a pair + map_c_w = false, -- map to delete a pair if possible + }) + end + -- use opts = {} for passing setup options + -- this is equivalent to setup({}) function +} diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua new file mode 100644 index 0000000..4ce7ccf --- /dev/null +++ b/lua/plugins/barbar.lua @@ -0,0 +1,19 @@ +return { + "romgrk/barbar.nvim", + dependencies = { + "lewis6991/gitsigns.nvim", -- OPTIONAL: for git status + "nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons + }, + init = function() + vim.g.barbar_auto_setup = false + end, + opts = { + animation = false, + clickable = false, + + sidebar_filetypes = { + NvimTree = true, + }, + }, + version = "^1.0.0", -- optional: only update when a new 1.x version is released +} diff --git a/lua/plugins/chezmoi.lua b/lua/plugins/chezmoi.lua new file mode 100644 index 0000000..c8a2260 --- /dev/null +++ b/lua/plugins/chezmoi.lua @@ -0,0 +1,11 @@ +return { + "xvzc/chezmoi.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("chezmoi").setup({ + edit = { + watch = true, + } + }) + end, +} diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..505b11f --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,25 @@ +return { + { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + config = function() + require("catppuccin").setup({ + flavor = "mocha", + + float = { + transparent = true + } + }) + end, + }, + { + "ellisonleao/gruvbox.nvim", + priority = 1000, + config = function() + require("gruvbox").setup({ + -- Gruvbox Configure + }) + end + } +} diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..fe8edcd --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,7 @@ +return { + 'numToStr/Comment.nvim', + config = function() + require("Comment").setup({}) + end, +} + diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua new file mode 100644 index 0000000..3cbec8c --- /dev/null +++ b/lua/plugins/completions.lua @@ -0,0 +1,36 @@ +return { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "saadparwaiz1/cmp_luasnip", + "L3MON4D3/LuaSnip", + "rafamadriz/friendly-snippets", + }, + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), -- Up + [""] = cmp.mapping.scroll_docs(4), -- Down + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "luasnip" }, + { name = "nvim_lsp" }, + }), + }) + end, +} diff --git a/lua/plugins/fterm.lua b/lua/plugins/fterm.lua new file mode 100644 index 0000000..313a6e6 --- /dev/null +++ b/lua/plugins/fterm.lua @@ -0,0 +1,5 @@ +return { + "numToStr/FTerm.nvim", + config = function() + end +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..f5bdc26 --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,35 @@ +local function configure_lsp(server, config) + vim.lsp.config(server, config) + vim.lsp.enable(server) +end + +return { + "neovim/nvim-lspconfig", + config = function() + vim.lsp.inlay_hint.enable(true) + + local capabilities = require("cmp_nvim_lsp").default_capabilities() + + configure_lsp("lua_ls", { + capabilities = capabilities, + settings = { + Lua = { + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + }, + }, + }, + }) + configure_lsp("pyright", { + capabilities = capabilities, + }) + + configure_lsp("jdtls", { + capabilities = capabilities, + }) + + configure_lsp("marksman", { + capabilities = capabilities, + }) + end, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..32edbc2 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,11 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('lualine').setup({ + options = { + theme = 'ayu_mirage' + } + }) + end, +} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua new file mode 100644 index 0000000..2b6d818 --- /dev/null +++ b/lua/plugins/mason.lua @@ -0,0 +1,21 @@ +return { + { + "mason-org/mason.nvim", + config = function() + require("mason").setup() + end, + }, + { + "mason-org/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "rust_analyzer", + "pyright", + "jdtls", + } + }) + end + }, +} diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..3cfa15a --- /dev/null +++ b/lua/plugins/neo-tree.lua @@ -0,0 +1,16 @@ +return { + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("nvim-tree").setup({ + diagnostics = { + enable = true, + } + }) + + end, +} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua new file mode 100644 index 0000000..ddc16f6 --- /dev/null +++ b/lua/plugins/none-ls.lua @@ -0,0 +1,13 @@ +return { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.mdformat, + }, + }) + end, +} diff --git a/lua/plugins/origami.lua b/lua/plugins/origami.lua new file mode 100644 index 0000000..69f9c35 --- /dev/null +++ b/lua/plugins/origami.lua @@ -0,0 +1,11 @@ +return { + "chrisgrieser/nvim-origami", + event = "VeryLazy", + config = function () + require("origami").setup({}) + end, + init = function () + vim.opt.foldlevel = 99 + vim.opt.foldlevelstart = 99 + end +} diff --git a/lua/plugins/render-markdown.lua b/lua/plugins/render-markdown.lua new file mode 100644 index 0000000..e3ce9ae --- /dev/null +++ b/lua/plugins/render-markdown.lua @@ -0,0 +1,7 @@ +return { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, + config = function() + require("render-markdown").setup({}) + end, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..d019faf --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,23 @@ +return { + { + 'nvim-telescope/telescope.nvim', version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + -- optional but recommended + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + } + }, + { + "nvim-telescope/telescope-ui-select.nvim", + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}) + } + } + }) + require("telescope").load_extension("ui-select") + end + } +} diff --git a/lua/plugins/themery.lua b/lua/plugins/themery.lua new file mode 100644 index 0000000..25f9366 --- /dev/null +++ b/lua/plugins/themery.lua @@ -0,0 +1,30 @@ +return { + "zaldih/themery.nvim", + lazy = false, + config = function() + require("themery").setup({ + themes = { + { + name = "Catppuccin", + colorscheme = "catppuccin", + before = [[ + vim.opt.background = "dark" + ]], + after = [[ + require("lualine").setup({ options = { theme = "ayu_mirage" } }) + ]] + }, + { + name = "Gruvbox", + colorscheme = "gruvbox", + before = [[ + vim.opt.background = "dark" + ]], + after = [[ + require("lualine").setup({ options = { theme = "gruvbox" } }) + ]] + } + } + }) + end +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..8ea23a8 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,17 @@ +return { + 'nvim-treesitter/nvim-treesitter', + lazy = false, + branch = 'master', + build = ':TSUpdate', + config = function() + local configs = require("nvim-treesitter.configs") + configs.setup({ + highlight = { enable = true }, + indent = { enable = true }, + autotag = { enable = true }, + ensure_installed = { + "lua", "c", "rust", "python", "java" + }, + }) + end, +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..33a0d39 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,21 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + config = function() + local wk = require("which-key") + + wk.add({ + + { "e", desc = "Explorer" }, + + { "ff", desc = "Find files" }, + { "fg", desc = "Live grep" }, + + { "q", desc = "Close buffer" }, + { "Q", desc = "Force close buffer" }, + + { "nn", desc = "Toggle relative numbers" }, + + }) + end, +}