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/fish/config.fish b/config/fish/config.fish index 15f1cd5..8eba419 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 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/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/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..eb14ff7 --- /dev/null +++ b/config/nvim/init.lua @@ -0,0 +1,53 @@ +-- 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 + +-- 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({ + spec = { + -- Add hotpot directly here + { "rktjmp/hotpot.nvim" }, + -- Then import your other plugins + { import = "plugins" }, + }, +}) + +