From 64726d97a4522105412eccac311358d3789f2966 Mon Sep 17 00:00:00 2001 From: Faye Lorenz Date: Tue, 3 Mar 2026 01:51:12 -0600 Subject: [PATCH] Update --- dot_bashrc | 5 +- dot_config/nvim/dot_luarc.json | 7 + dot_config/nvim/init.lua | 295 +++++++++++++++++++++++++++++++++ 3 files changed, 306 insertions(+), 1 deletion(-) create mode 100644 dot_config/nvim/dot_luarc.json create mode 100644 dot_config/nvim/init.lua diff --git a/dot_bashrc b/dot_bashrc index f893a79..0e4519a 100644 --- a/dot_bashrc +++ b/dot_bashrc @@ -10217,7 +10217,10 @@ if [[ $EUID -ne 0 ]] && \ [[ "${TERM_PROGRAM}" != "atom" ]] && \ [[ $_SKIP_SYSTEM_INFO = false ]]; then - if hascommand --strict hyfetch; then + if hascommand --strict espifetch; then + espifetch + + elif hascommand --strict hyfetch; then hyfetch # Link: https://github.com/LinusDierheimer/fastfetch diff --git a/dot_config/nvim/dot_luarc.json b/dot_config/nvim/dot_luarc.json new file mode 100644 index 0000000..43ed052 --- /dev/null +++ b/dot_config/nvim/dot_luarc.json @@ -0,0 +1,7 @@ +{ + "diagnostics.globals": [ + "vim", + "MiniDeps", + "MiniSnippets" + ] +} \ No newline at end of file diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua new file mode 100644 index 0000000..aba1a13 --- /dev/null +++ b/dot_config/nvim/init.lua @@ -0,0 +1,295 @@ +-- Basic setup + +vim.cmd("set expandtab") +vim.cmd("set tabstop=2") +vim.cmd("set softtabstop=2") +vim.cmd("set shiftwidth=2") +vim.cmd("set nowrap") +vim.g.mapleader = " " + +-- Install mini.deps + +local path_package = vim.fn.stdpath("data") .. "/site/" +local mini_path = path_package .. "pack/deps/start/mini.nvim" +if not vim.loop.fs_stat(mini_path) then + vim.cmd('echo "Installing `mini.nvim`" | redraw') + local clone_cmd = { + "git", + "clone", + "--filter=blob:none", + "https://github.com/nvim-mini/mini.nvim", + mini_path, + } + vim.fn.system(clone_cmd) + vim.cmd("packadd mini.nvim | helptags ALL") + vim.cmd('echo "Installed `mini.nvim`" | redraw') +end + +require("mini.deps").setup({ path = { package = path_package } }) + +-- Plugins + +local add = MiniDeps.add + +add({ + source = "benomahony/uv.nvim", + depends = { + "nvim-telescope/telescope.nvim" + } +}) + +add({ + source = "catppuccin/nvim", + name = "catppuccin", +}) + +add({ + source = "goolord/alpha-nvim", + depends = { + "nvim-tree/nvim-web-devicons", + }, +}) + +add({ + source = "hrsh7th/cmp-nvim-lsp", +}) + +add({ + source = "hrsh7th/nvim-cmp", +}) + +add({ + source = "L3MON4D3/LuaSnip", + depends = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, +}) + +add({ + source = "lumiliet/vim-twig", +}) + +add({ + source = "mason-org/mason.nvim", +}) + +add({ + source = "mason-org/mason-lspconfig.nvim", +}) + +add({ + source = "monkoose/neocodeium", +}) + +add({ + source = "neovim/nvim-lspconfig", +}) + +add({ + source = "nvim-lualine/lualine.nvim", +}) + +add({ + source = "nvim-neo-tree/neo-tree.nvim", + depends = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + }, +}) + +add({ + source = "nvim-telescope/telescope.nvim", + depends = { "nvim-lua/plenary.nvim" }, +}) + +add({ + source = "nvim-telescope/telescope-ui-select.nvim", +}) + +add({ + source = "nvim-treesitter/nvim-treesitter", + hooks = { + post_checkout = function() + vim.cmd("TSUpdate") + end, + }, +}) + +add({ + source = "nvimtools/none-ls.nvim", +}) + +-- Config + +require('uv').setup() + +vim.cmd.colorscheme("catppuccin") + +local alpha = require("alpha") +local dashboard = require("alpha.themes.startify") + +dashboard.section.header.val = { + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + [[ ]], + [[ ]], +} + +alpha.setup(dashboard.opts) + +local capabilities = require("cmp_nvim_lsp").default_capabilities() + +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), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), +}) + +require("mason").setup() + +require("mason-lspconfig").setup({ + ensure_installed = { + "bashls", + "clangd", + "html", + "intelephense", + "lua_ls", + "pyright", + "twiggy_language_server", + }, +}) + +vim.lsp.config.bashls = { + capabilities = capabilities, +} + +vim.lsp.config.html = { + capabilities = capabilities, +} + +vim.lsp.config.intelephense = { + capabilities = capabilities, +} + +vim.lsp.config.lua_ls = { + capabilities = capabilities, +} + +vim.lsp.config.twiggy_language_server = { + filetypes = { "htmldjango.twig" }, + capabilities = capabilities, +} + +local neocodeium = require("neocodeium") +neocodeium.setup() +vim.keymap.set("i", "", neocodeium.accept) + +require("lualine").setup({ + options = { + theme = "dracula", + }, +}) + +require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, +}) + +require("telescope").load_extension("ui-select") + +require("nvim-treesitter").install({ + "bash", + "c", + "html", + "lua", + "php", + "python", + "twig", +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "" }, + callback = function() + vim.treesitter.start() + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, +}) + +local null_ls = require("null-ls") +local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) + +null_ls.setup({ + sources = { + null_ls.builtins.diagnostics.twigcs, + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.clang_format, + null_ls.builtins.formatting.phpcsfixer, + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.shfmt, + null_ls.builtins.formatting.stylua, + }, + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format({ async = false }) + end, + }) + end + end, +}) + +-- Keybindings + +vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) +vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) +vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, {}) + +vim.keymap.set("n", "", ":Neotree filesystem toggle left", {}) + +local builtin = require("telescope.builtin") +vim.keymap.set("n", "", builtin.find_files, {}) +vim.keymap.set("n", "fg", builtin.live_grep, {}) + +vim.keymap.set("n", "gf", vim.lsp.buf.format, {})