From e21b930344d3cf84dee9ffbb3dfd64af30fb682b Mon Sep 17 00:00:00 2001 From: Fernando Araoz Date: Tue, 21 Jan 2025 14:38:50 -0500 Subject: [PATCH 1/3] feat: fish alias for git --- config/fish/config.fish | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/fish/config.fish b/config/fish/config.fish index 617b09b..3cfd065 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -7,6 +7,14 @@ set -gx EDITOR vi set -gx VISUAL vi set -gx TERM foot +function git-push + git push github (git rev-parse --abbrev-ref HEAD) +end + +function git-pull + git pull github develop --no-rebase +end + # Proper PATH handling fish_add_path $HOME/.local/bin fish_add_path $HOME/.cargo/bin From 60fa4c71215dcfae9ddeff556113aedb63712c92 Mon Sep 17 00:00:00 2001 From: Fernando Araoz Date: Tue, 21 Jan 2025 17:13:15 -0500 Subject: [PATCH 2/3] feat(nvim): initialize fennel --- .gitignore | 2 ++ config/nvim/.hotpot.lua | 19 +++++++++++++ config/nvim/fnl/plugins/init.fnl | 3 ++ config/nvim/init.lua | 48 ++++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 .gitignore create mode 100644 config/nvim/.hotpot.lua create mode 100644 config/nvim/fnl/plugins/init.fnl create mode 100644 config/nvim/init.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..896dd22 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +config/nvim/lua + diff --git a/config/nvim/.hotpot.lua b/config/nvim/.hotpot.lua new file mode 100644 index 0000000..1746f33 --- /dev/null +++ b/config/nvim/.hotpot.lua @@ -0,0 +1,19 @@ +-- By default, the Fennel compiler wont complain if unknown variables are +-- referenced, we can force a compiler error so we don't try to run faulty code. +local allowed_globals = {} +for key, _ in pairs(_G) do + table.insert(allowed_globals, key) +end + +return { + -- by default, build all fnl/ files into lua/ + build = true, + -- remove stale lua/ files + clean = true, + compiler = { + modules = { + -- enforce unknown variable errors + allowedGlobals = allowed_globals, + }, + }, +} diff --git a/config/nvim/fnl/plugins/init.fnl b/config/nvim/fnl/plugins/init.fnl new file mode 100644 index 0000000..70e822c --- /dev/null +++ b/config/nvim/fnl/plugins/init.fnl @@ -0,0 +1,3 @@ +(print ":D (happy) (fennel lazy module)") + +[] diff --git a/config/nvim/init.lua b/config/nvim/init.lua new file mode 100644 index 0000000..003eaf1 --- /dev/null +++ b/config/nvim/init.lua @@ -0,0 +1,48 @@ +-- Ensure lazy and hotpot are always installed +local function ensure_installed(plugin, branch) + local user, repo = string.match(plugin, "(.+)/(.+)") + local repo_path = vim.fn.stdpath("data") .. "/lazy/" .. repo + if not (vim.uv or vim.loop).fs_stat(repo_path) then + vim.notify("Installing " .. plugin .. " " .. branch) + local repo_url = "https://github.com/" .. plugin .. ".git" + local out = vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "--branch=" .. branch, + repo_url, + repo_path, + }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone " .. plugin .. ":\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end + end + return repo_path +end +local lazy_path = ensure_installed("folke/lazy.nvim", "stable") +local hotpot_path = ensure_installed("rktjmp/hotpot.nvim", "v0.14.6") +-- As per Lazy's install instructions, but also include hotpot +vim.opt.runtimepath:prepend({ hotpot_path, lazy_path }) + +-- You must call vim.loader.enable() before requiring hotpot unless you are +-- passing {performance = {cache = false}} to Lazy. +vim.loader.enable() + +require("hotpot") -- Optionally you may call require("hotpot").setup(...) here + +-- You must include Hotpot in your plugin list for it to function correctly. +-- If you want to use Lazy's "structured" style, see the next code sample. +require("lazy").setup({ + spec = { + -- Add hotpot directly here + { "rktjmp/hotpot.nvim" }, + -- Then import your other plugins + { import = "plugins" }, + }, +}) From af29f68f6bca3749809e0d887251d0e96fb07060 Mon Sep 17 00:00:00 2001 From: Fernando Araoz Date: Tue, 21 Jan 2025 17:27:56 -0500 Subject: [PATCH 3/3] feat(nvim): more fennel --- config/nvim/fnl/config.fnl | 8 ++++++++ config/nvim/init.lua | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 config/nvim/fnl/config.fnl diff --git a/config/nvim/fnl/config.fnl b/config/nvim/fnl/config.fnl new file mode 100644 index 0000000..832838f --- /dev/null +++ b/config/nvim/fnl/config.fnl @@ -0,0 +1,8 @@ +(set vim.g.mapleader " ") +(set vim.g.maplocalleader " ") +(set vim.g.have_nerd_font true) +(set vim.opt.number true) +(set vim.opt.relativenumber true) + +(print "I have been setup :D") + diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 003eaf1..eb14ff7 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -36,6 +36,9 @@ vim.loader.enable() require("hotpot") -- Optionally you may call require("hotpot").setup(...) here +-- config defined in fnl +require("config") + -- You must include Hotpot in your plugin list for it to function correctly. -- If you want to use Lazy's "structured" style, see the next code sample. require("lazy").setup({ @@ -46,3 +49,5 @@ require("lazy").setup({ { import = "plugins" }, }, }) + +