diff --git a/alacritty.configlink/alacritty.yml b/alacritty.configlink/alacritty.yml index 489988d..c88b661 100644 --- a/alacritty.configlink/alacritty.yml +++ b/alacritty.configlink/alacritty.yml @@ -593,6 +593,7 @@ key_bindings: - { key: A, mods: Super, chars: "\x02" } # CMD-A sends CTRL-B for tmux - { key: D, mods: Super, chars: "\x14" } # CMD-D sends CTRL-T for fzf - { key: O, mods: Super, chars: "edit\x0D" } # CMD-O opens file in vim + - { key: R, mods: Super, chars: "recent\x0D" } # CMD-R opens file in vim - { key: Return, mods: Shift, chars: "\x1b[13;2u" } - { key: N, mods: Command, action: SpawnNewInstance } diff --git a/cargo/Cargofile b/cargo/Cargofile new file mode 100644 index 0000000..be20472 --- /dev/null +++ b/cargo/Cargofile @@ -0,0 +1,6 @@ +# Packages to install with Cargo + +toml-cli # Parse TOML from the command line +rates # See exchange rates +wrangler # Cloudflare Workers CLI +csview # Quick display CSV as tables diff --git a/fish.configlink/functions/abbrs.fish b/fish.configlink/functions/abbrs.fish index 6612507..ea014d1 100644 --- a/fish.configlink/functions/abbrs.fish +++ b/fish.configlink/functions/abbrs.fish @@ -79,6 +79,7 @@ function abbrs --description 'All abbreviations' abbr -a fingerprint 'ssh-keyscan myhost.com | ssh-keygen -lf -' abbr -a publickey 'ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub' abbr -a forloop 'for i in (seq 1 100)' + abbr -a gatekeeper 'sudo spctl --master-disable' # Docker abbr -a dc '$DOTS/bin/docker_cleanup' diff --git a/fish.configlink/functions/recent.fish b/fish.configlink/functions/recent.fish new file mode 100644 index 0000000..54aea64 --- /dev/null +++ b/fish.configlink/functions/recent.fish @@ -0,0 +1,4 @@ +function recent --description "Open a recent file in Vim" + set vimfile (fd --exec stat -f "%m%t%N" | sort -nr | cut -f2 | fzf) + and vim $vimfile +end diff --git a/homebrew/fun.Brewfile b/homebrew/fun.Brewfile index 21d7747..b1af51c 100644 --- a/homebrew/fun.Brewfile +++ b/homebrew/fun.Brewfile @@ -4,3 +4,4 @@ tap "nmasur/repo" brew "nmasur/repo/bid" # Look up stock tickers brew "nmasur/repo/bee" # Cheat on NYTimes Spelling Bee +brew "tickrs" # Interactive stock tickers diff --git a/homebrew/learning.Brewfile b/homebrew/learning.Brewfile index 82946ef..928a1b0 100644 --- a/homebrew/learning.Brewfile +++ b/homebrew/learning.Brewfile @@ -17,3 +17,4 @@ brew "cjbassi/ytop/ytop" # Fancy system performance brew "nmasur/repo/update-ssh-config" # Update .ssh/config brew "kakoune" # Modal editor brew "awslogs" # View AWS log streams +brew "uplink" # StorJ encrypted storage CLI diff --git a/homebrew/utils.Brewfile b/homebrew/utils.Brewfile index e947354..992c2a1 100644 --- a/homebrew/utils.Brewfile +++ b/homebrew/utils.Brewfile @@ -16,3 +16,4 @@ brew "youtube-dl" # Download YouTube videos brew "googler" # Search Google brew "gh" # GitHub commands brew "pandoc" # Document converter +brew "visidata" # Spreadsheet manipulation diff --git a/nvim.configlink/settings/vimwiki.vim b/nvim.configlink/settings/vimwiki.vim index b42b5ae..3569ae7 100644 --- a/nvim.configlink/settings/vimwiki.vim +++ b/nvim.configlink/settings/vimwiki.vim @@ -18,3 +18,13 @@ let g:vimwiki_auto_chdir = 1 " Set local dir to Wiki when open let g:vimwiki_create_link = 0 " Don't automatically create new links let g:vimwiki_listsyms = ' x' " Set checkbox symbol progression let g:vimwiki_table_mappings = 0 " VimWiki table keybinds interfere with tab completion + +" Insert from command-mode into buffer +function! PInsert(item) + let @z=a:item + norm "zpx +endfunction + +command! AddTag call fzf#run({'source': 'rg "#[\w/]+[ |\$]" -o --no-filename --no-line-number | sort | uniq', 'sink': function('PInsert')}) + +autocmd FileType markdown inoremap ;tt :AddTag diff --git a/scripts/bootstrap b/scripts/bootstrap index 56ae9de..2911d8e 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -46,24 +46,24 @@ use_fish_shell() { exit 1 fi FISH_SHELL=$(which fish) - if ! (cat /etc/shells | grep $FISH_SHELL > /dev/null) + if ! (grep "$FISH_SHELL" /etc/shells > /dev/null) then echo "Modifying /etc/shells" echo "Requires sudo password" - sudo echo $FISH_SHELL >> /etc/shells + echo "$FISH_SHELL" | sudo tee -a /etc/shells fi if ! (echo "$SHELL" | grep fish > /dev/null) then echo "Changing default shell to fish" echo "Requires sudo password" - sudo chsh -s $FISH_SHELL + sudo chsh -s "$FISH_SHELL" fi echo "fish ✓" } setup_poetry() { - poetry completions fish > $(brew --prefix)/share/fish/vendor_completions.d/poetry.fish + poetry completions fish > "$(brew --prefix)/share/fish/vendor_completions.d/poetry.fish" } printf "\nbootstrapping...\n\n" @@ -76,8 +76,9 @@ use_fish_shell echo "" echo "consider running other scripts:" -echo " - all_brews" -echo " - install_casks" +echo " - brews" +echo " - casks" echo " - configure_macos" -echo " - install_rust" +echo " - rust" +echo " - cargos" echo "" diff --git a/scripts/all_brews b/scripts/brews similarity index 91% rename from scripts/all_brews rename to scripts/brews index 28297d3..1b0cc81 100755 --- a/scripts/all_brews +++ b/scripts/brews @@ -5,7 +5,6 @@ cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1) DOTS="$PWD" all_brews() { - brewfile=$DOTS/homebrew/Caskfile for brewfile in $(find "$DOTS/homebrew" -iname "*.Brewfile") do /usr/local/bin/brew bundle check --file "$brewfile" \ diff --git a/scripts/cargos b/scripts/cargos new file mode 100755 index 0000000..6b8469b --- /dev/null +++ b/scripts/cargos @@ -0,0 +1,26 @@ +#!/bin/sh + +DOTS=$(dirname "$0")/.. +cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1) +DOTS="$PWD" + +check_rust() { + if ! (which ~/.cargo/bin/rustup > /dev/null) + then + echo "Install rust (cargo) before continuing" + echo "Run the rust script before this one" + exit 1 + fi +} + +all_cargos() { + cargofile=$DOTS/cargo/Cargofile + sed 's/#.*$//g;/^$/d' "$cargofile" | while read -r line + do + cargo install "$line" + done \ + && echo "all cargos installed ✓" +} + +check_rust +all_cargos diff --git a/scripts/install_casks b/scripts/casks similarity index 100% rename from scripts/install_casks rename to scripts/casks diff --git a/scripts/install_rust b/scripts/rust similarity index 86% rename from scripts/install_rust rename to scripts/rust index 1a30f43..2456f0b 100755 --- a/scripts/install_rust +++ b/scripts/rust @@ -29,12 +29,12 @@ download_rust_analyzer() { echo "rust-analyzer ✓" } +# cargo-edit: quickly add and remove packages +# whatfeatures: see optional features for a package install_cargos() { set -- \ - 'cargo-edit' - 'cargo-whatfeatures' \ - 'jql' \ - 'toml-cli' + 'cargo-edit' \ + 'cargo-whatfeatures' for program do cargo install "$program" done