From f7e802d3f3bc22806a3b837da9ca85cffa26b2ca Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 3 Jun 2025 14:59:53 -0700 Subject: [PATCH 01/13] [zsh] bool() function Converts its first argument to a bool return value (0 or 1) and echos "yes" or "no". --- zsh/func/bool | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 zsh/func/bool diff --git a/zsh/func/bool b/zsh/func/bool new file mode 100644 index 0000000..c5bf961 --- /dev/null +++ b/zsh/func/bool @@ -0,0 +1,31 @@ +# Eryn Wells +# vim: set ft=zsh: + +function bool { + if [[ $1 -eq 0 ]]; then + echo "no" + return false + fi + + local lowercase_value=${(L)1} + + if [[ "$lowercase_value" == "yes" ]]; then + echo "yes" + return true + fi + + if [[ "$lowercase_value" == "no" ]]; then + echo "no" + return false + fi + + if [[ "$lowercase_value" =~ '^[0-9]+$' ]]; then + echo "yes" + return true + fi + + echo "no" + return false +} + +bool "$@" From bb82a7ca75bd59af633b8dc9503d360c6b01aa0a Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 1 Aug 2025 10:33:03 -0700 Subject: [PATCH 02/13] [nvim] Update format of rust-analyzer LSP config I think the format of the config table for rust-analyzer changed. checkOnSave takes a bool, and a separate check table provides the parameters. --- config/nvim/lua/lsp.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index 87f964f..0bed968 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -115,7 +115,8 @@ lspconfig.rust_analyzer.setup { enable = true, }, }, - checkOnSave = { + checkOnSave = true, + check = { command = 'clippy', extraArgs = { "--", From 6dc9120dd0fd965b970424fab9e57e57ffbb7798 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 1 Aug 2025 10:37:26 -0700 Subject: [PATCH 03/13] [zsh] Update the Usage message of update-path to note the default is exporting the modified variable --- zsh/func/update-path | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh/func/update-path b/zsh/func/update-path index 4172df4..624258a 100644 --- a/zsh/func/update-path +++ b/zsh/func/update-path @@ -20,7 +20,8 @@ Arguments --------- %B-e%b | %B--export%b | %B--no-export%b - Export the variable after modification. + Export the variable after modification. The default is to export if the + variable is modified. %B-f%b | %B--force%b Unconditionally add the path, even if it doesn't exist. From fa0e59ea3911a7660c39ac07f994eee23dc4d450 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 1 Aug 2025 10:38:48 -0700 Subject: [PATCH 04/13] [zsh] Autoload the bool function --- zsh/func/bool | 26 +++++++++++++------------- zshrc | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/zsh/func/bool b/zsh/func/bool index c5bf961..1fe2567 100644 --- a/zsh/func/bool +++ b/zsh/func/bool @@ -2,30 +2,30 @@ # vim: set ft=zsh: function bool { - if [[ $1 -eq 0 ]]; then - echo "no" - return false + if [[ "$1" =~ '^-?[0-9]+$' ]]; then + if (( $1 == 0 )); then + echo "no" + return 1 + else + echo "yes" + return 0 + fi fi local lowercase_value=${(L)1} - if [[ "$lowercase_value" == "yes" ]]; then + if [[ "$lowercase_value" == "yes" || "$lowercase_value" == "true" ]]; then echo "yes" - return true + return 0 fi - if [[ "$lowercase_value" == "no" ]]; then + if [[ "$lowercase_value" == "no" || "$lowercase_value" == "false" ]]; then echo "no" - return false - fi - - if [[ "$lowercase_value" =~ '^[0-9]+$' ]]; then - echo "yes" - return true + return 1 fi echo "no" - return false + return 1 } bool "$@" diff --git a/zshrc b/zshrc index 8f70595..da1297d 100644 --- a/zshrc +++ b/zshrc @@ -21,6 +21,7 @@ fi do_init_functions zsh_init_rc_functions +autoload -Uz bool autoload -Uz g autoload -Uz nethack autoload -Uz pw From bd05bc392a3cb11696c94a8bf7578d8a03b9c728 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 9 Aug 2025 07:44:55 -0700 Subject: [PATCH 05/13] [vim] Add Meta-O to show open buffers in Neovide --- config/nvim/lua/keys.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/nvim/lua/keys.lua b/config/nvim/lua/keys.lua index 4eaebbb..d83fb21 100644 --- a/config/nvim/lua/keys.lua +++ b/config/nvim/lua/keys.lua @@ -6,7 +6,7 @@ local function init_key_options() vim.g.mapleader = "," end -local function navigation_mappings() +local function text_navigation_mappings() local options = { noremap = true } -- Navigate by soft-wrapped lines using Alt/Option/Meta + jk @@ -87,17 +87,22 @@ end local function telescope_mappings() local builtin = require('telescope.builtin') + map('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) map('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) map('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) map('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) + + if vim.fn.has('gui_running') then + map('n', 'D-O', builtin.buffers, { desc = 'Open existing' }) + end end local function init_all_global_keybindings() init_key_options() clipboard_mappings() window_key_mappings() - navigation_mappings() + text_navigation_mappings() diagnostic_mappings() telescope_mappings() end From e0f813182a5a79ca9a87912d927216e3c9858d33 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 9 Aug 2025 07:45:15 -0700 Subject: [PATCH 06/13] [vim] Configure ts_ls for Typescript and JS --- config/nvim/lua/lsp.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index 87f964f..885ab76 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -76,6 +76,11 @@ lspconfig.eslint.setup { capabilities = cmp_capabilities, } +lspconfig.ts_ls.setup { + on_attach = on_attach, + capabilities = cmp_capabilities, +} + lspconfig.html.setup { on_attach = on_attach, capabilities = cmp_capabilities, From 972d5f452438138fb36cfcee094d596aac219300 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 9 Aug 2025 07:45:52 -0700 Subject: [PATCH 07/13] [vim] Set mode with a string in Ansible tasks file for setting up vim --- Ansible/roles/eryn/tasks/vim.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ansible/roles/eryn/tasks/vim.yml b/Ansible/roles/eryn/tasks/vim.yml index 2763070..42346a3 100644 --- a/Ansible/roles/eryn/tasks/vim.yml +++ b/Ansible/roles/eryn/tasks/vim.yml @@ -19,7 +19,7 @@ ansible.builtin.file: path: "{{ ansible_local.xdg.state_home }}/vim" owner: "{{ ansible_user_id }}" - mode: 0750 + mode: "0750" state: directory - name: "vim : Symlink runtime directory" From cf613b301259f925e7d0e5281d3cbd57bae6a4ac Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 11 Aug 2025 17:00:13 -0700 Subject: [PATCH 08/13] [fortune] Add some fortune strings and a Makefile to build indexed string files --- Fortune/Makefile | 16 ++++++++++++++++ Fortune/eryn | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 Fortune/Makefile create mode 100644 Fortune/eryn diff --git a/Fortune/Makefile b/Fortune/Makefile new file mode 100644 index 0000000..9a1c213 --- /dev/null +++ b/Fortune/Makefile @@ -0,0 +1,16 @@ + +STRFILE=strfile + +DATFILES=eryn.dat + +.PHONY: all clean + +%.dat: % + $(STRFILE) $^ $@ + +.PHONY: all +all: $(DATFILES) + +.PHONY: clean +clean: + rm -f $(DATFILES) diff --git a/Fortune/eryn b/Fortune/eryn new file mode 100644 index 0000000..1a77ce3 --- /dev/null +++ b/Fortune/eryn @@ -0,0 +1,7 @@ +Please practice this until you can easily do it. + -- Andrej Diamantstein +% +Easy, isn't it? + -- Andrej Diamantstein +% +TWENTY THREE NINETEEN!!!! From 71ab83d8f3611613bcbeb433d7d4086c40764e26 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 11 Aug 2025 17:07:28 -0700 Subject: [PATCH 09/13] [fortune] A few more quotes --- Fortune/eryn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Fortune/eryn b/Fortune/eryn index 1a77ce3..87f0bc2 100644 --- a/Fortune/eryn +++ b/Fortune/eryn @@ -5,3 +5,12 @@ Easy, isn't it? -- Andrej Diamantstein % TWENTY THREE NINETEEN!!!! +% +You only have to let the soft animal of your body +love what it loves. + -- Mary Oliver, Wild Geese +% +Be a lamp, or a lifeboat, or a ladder +help someone’s soul to heal +Walk out of your house like a shepherd. + -- Rumi, Ode 3090 From 09f098500650653a60f8eefbcb5d4a0386b15b75 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 11 Aug 2025 17:07:39 -0700 Subject: [PATCH 10/13] Ignore Fortune .dat files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 848e7f5..44c1071 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,5 @@ vim/backup/ zsh/cache/ Ansible/*.retry + +Fortune/*.dat From aefda50590c3275c0bb8a4b8fbb2f76c7f4b19a4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 11 Aug 2025 17:08:07 -0700 Subject: [PATCH 11/13] [setup.sh] Add some missing items to the skipitems array; skip Fortune --- setup.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index f2275ba..cd03e50 100755 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,23 @@ dotfiles_dir=$(cd "$(dirname "$0")" && pwd) sys=`uname -s | tr A-Z a-z` -skipitems=(setup.sh README.md py bin Alfred Colors Dotfiles LaunchAgents Python '.*\.orig' '.*~') +skipitems=( \ + '.*\.orig' \ + '.*~' \ + Alfred \ + Ansible \ + bin \ + Colors \ + Dotfiles \ + Fortune \ + LaunchAgents \ + py \ + Python \ + README.md \ + setup.sh \ + Web \ + Xcode \ +) function link { local action From 884fa0a5421cf6c93469249e2d0e85ca9bd84877 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 11 Aug 2025 17:12:14 -0700 Subject: [PATCH 12/13] [setup.sh] Build fortunes file in setup.sh --- setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.sh b/setup.sh index cd03e50..758c4bf 100755 --- a/setup.sh +++ b/setup.sh @@ -54,6 +54,11 @@ function matches_skip_item { return 1 } +function build_fortunes { + echo "Building fortunes file" + (cd Fortune && make) +} + print -P " %BHome:%b $HOME" print -P " %BDotfiles:%b $dotfiles_dir" print -P "%BSkip Items:%b $skipitems\n" @@ -163,4 +168,6 @@ if (( $configure_vim )); then $VIM +PlugInstall +qall fi +build_fortunes + exit 0 From 6b08decfb9724a0ba45bbb4490725fa6517651ec Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Aug 2025 20:37:15 -0700 Subject: [PATCH 13/13] [nvim] Add an app template snippet for Nannou apps (nnapp) --- config/nvim/UltiSnips/rust.snippets | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 config/nvim/UltiSnips/rust.snippets diff --git a/config/nvim/UltiSnips/rust.snippets b/config/nvim/UltiSnips/rust.snippets new file mode 100644 index 0000000..da88543 --- /dev/null +++ b/config/nvim/UltiSnips/rust.snippets @@ -0,0 +1,38 @@ +# rust.snippets +# vim: set ts=8 sw=8 sts=8 noet list: +# Eryn Wells + +snippet nnapp +// Eryn Wells + +use nannou::prelude::*; + +struct Model { + _window: window::Id, +} + +impl Model { + fn new(app: &App) -> Self { + let window = app.new_window().view(view).build().unwrap(); + Self { + _window: window, + } + } + + fn update(app: &App, model: &mut Model, update: Update) { + model.update(app, update) + } + + fn update(&mut self, app: &App, update: Update) { + // TODO: Update the model here. + } +} + +fn view(app: &App, model: &Model, frame: Frame) { + // TODO: Draw the view here. +} + +fn main() { + nannou::app(Model::new).update(update).run(); +} +endsnippet