Compare commits

..

14 commits

Author SHA1 Message Date
6b08decfb9 [nvim] Add an app template snippet for Nannou apps (nnapp) 2025-08-12 20:37:15 -07:00
884fa0a542 [setup.sh] Build fortunes file in setup.sh 2025-08-11 17:12:14 -07:00
aefda50590 [setup.sh] Add some missing items to the skipitems array; skip Fortune 2025-08-11 17:08:07 -07:00
09f0985006 Ignore Fortune .dat files 2025-08-11 17:07:39 -07:00
71ab83d8f3 [fortune] A few more quotes 2025-08-11 17:07:28 -07:00
cf613b3012 [fortune] Add some fortune strings and a Makefile to build indexed string files 2025-08-11 17:00:13 -07:00
196004e993 Merge remote-tracking branch 'origin/main' 2025-08-09 07:46:48 -07:00
972d5f4524 [vim] Set mode with a string in Ansible tasks file for setting up vim 2025-08-09 07:45:52 -07:00
e0f813182a [vim] Configure ts_ls for Typescript and JS 2025-08-09 07:45:15 -07:00
bd05bc392a [vim] Add Meta-O to show open buffers in Neovide 2025-08-09 07:44:55 -07:00
fa0e59ea39 [zsh] Autoload the bool function 2025-08-01 10:40:10 -07:00
6dc9120dd0 [zsh] Update the Usage message of update-path to note the default is exporting the modified variable 2025-08-01 10:40:10 -07:00
bb82a7ca75 [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.
2025-08-01 10:40:10 -07:00
f7e802d3f3 [zsh] bool() function
Converts its first argument to a bool return value (0 or 1) and echos
"yes" or "no".
2025-08-01 10:40:10 -07:00
11 changed files with 145 additions and 6 deletions

2
.gitignore vendored
View file

@ -32,3 +32,5 @@ vim/backup/
zsh/cache/
Ansible/*.retry
Fortune/*.dat

View file

@ -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"

16
Fortune/Makefile Normal file
View file

@ -0,0 +1,16 @@
STRFILE=strfile
DATFILES=eryn.dat
.PHONY: all clean
%.dat: %
$(STRFILE) $^ $@
.PHONY: all
all: $(DATFILES)
.PHONY: clean
clean:
rm -f $(DATFILES)

16
Fortune/eryn Normal file
View file

@ -0,0 +1,16 @@
Please practice this until you can easily do it.
-- Andrej Diamantstein
%
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 someones soul to heal
Walk out of your house like a shepherd.
-- Rumi, Ode 3090

View file

@ -0,0 +1,38 @@
# rust.snippets
# vim: set ts=8 sw=8 sts=8 noet list:
# Eryn Wells <eryn@erynwells.me>
snippet nnapp
// Eryn Wells <eryn@erynwells.me>
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

View file

@ -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', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
map('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
map('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
map('n', '<leader>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

View file

@ -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,
@ -115,7 +120,8 @@ lspconfig.rust_analyzer.setup {
enable = true,
},
},
checkOnSave = {
checkOnSave = true,
check = {
command = 'clippy',
extraArgs = {
"--",

View file

@ -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
@ -38,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"
@ -147,4 +168,6 @@ if (( $configure_vim )); then
$VIM +PlugInstall +qall
fi
build_fortunes
exit 0

31
zsh/func/bool Normal file
View file

@ -0,0 +1,31 @@
# Eryn Wells <eryn@erynwells.me>
# vim: set ft=zsh:
function bool {
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" || "$lowercase_value" == "true" ]]; then
echo "yes"
return 0
fi
if [[ "$lowercase_value" == "no" || "$lowercase_value" == "false" ]]; then
echo "no"
return 1
fi
echo "no"
return 1
}
bool "$@"

View file

@ -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.

1
zshrc
View file

@ -21,6 +21,7 @@ fi
do_init_functions zsh_init_rc_functions
autoload -Uz bool
autoload -Uz g
autoload -Uz nethack
autoload -Uz pw