This has been enhanced and moved to https://github.com/Konfekt/select-pass.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Set &grepprg to git-grep inside repo, fall back rg, ugrep or grep otherwise. | |
| " Assumes a global ignore file `$XDG_CONFIG_HOME/grep/ignore`; create it by, | |
| " say `touch ~/.config/grep/ignore` to ensure its existence. | |
| augroup vimrcFindGrep | |
| autocmd! | |
| augroup END | |
| if has('unix') && executable('chrt') && executable('ionice') | |
| let s:scheduler = 'chrt --idle 0 ionice -c2 -n7 ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " A command using FZF to list all files in a Git repo; | |
| " takes a range 0, N or N,M to restrict to files that have been, respectively, | |
| " altered, altered in last N commits, altered in-between last N and M commits. | |
| " From https://github.com/junegunn/fzf.vim/blob/879db51d0965515cdaef9b7f6bdeb91c65d2829e/autoload/fzf/vim.vim#L742 | |
| function! s:get_git_root(dir) | |
| if empty(a:dir) && exists('*FugitiveWorkTree') | |
| return FugitiveWorkTree() | |
| endif | |
| let dir = len(a:dir) ? a:dir : substitute(split(expand('%:p:h'), '[/\\]\.git\([/\\]\|$\)')[0], '^fugitive://', '', '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S uv run --script | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "cryptography>=42", | |
| # ] | |
| # [tool.uv] | |
| # exclude-newer = "2025-12-26 00:00" | |
| # /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Check Python code snippets on the fly with pyrefly. | |
| " Put into ~/.vim/plugins` and use the mapping `g4` on a visual selection or a text object. | |
| if exists('g:loaded_pyrefly_operator') | finish | endif | |
| let g:loaded_pyrefly_operator = 1 | |
| if !executable('pyrefly') | finish | endif | |
| let s:pyrefly_efm = join([ | |
| \ '%E%\s%#ERROR %m', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Save as ~/.mailcap. Then use run-mailcap to: | |
| # | |
| # - open files by `run-mailcap --action=view <file>`, or | |
| # - view them in the terminal by `run-mailcap --action=cat <file>`. | |
| # | |
| # Useful | |
| # | |
| # - in mutt by `set mailcap_file $HOME/.mailcap` | |
| # - in Vim by adding to your vimrc | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Generate compile_commands.json for clangd. | |
| " Prefer CMake export, else Ninja compdb, else Bear + Make with optional append: | |
| " First check is whether need for (re)generation be at all, then where relative | |
| " to the open file, then calling CMake, Ninja, or finally Bear if applicable (as | |
| " background jobs). To make those builders work more predictably, additional | |
| " flags are passed to ensure all files are indexed as, say, `bear -- make` falls | |
| " short in presence of build artifacts. | |
| if exists('b:did_c_compdb_ftplugin') | finish | endif | |
| let b:did_c_compdb_ftplugin = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Adaption of https://github.com/majutsushi/etc/commit/e62904088c698e064c17522d54dff91b629ee253#diff-53b7e445a85984949f551c277d4cc4ee9682287cb234e075e6d352be887e7494 | |
| # with https://github.com/pivotal-cf/git-hooks-core/blob/master/.base-hook | |
| # | |
| # This script is meant to be put into a directory pointed to by core.hooksPath | |
| # in Git 2.9. | |
| # Then for each hook you want to support, create a symlink "hookname -> multihook" | |
| # and optionally a directory "hookname.d" where you can put all scripts for | |
| # that hook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Run or Raise Application using Shortcut | |
| ; From https://gist.github.com/dewaka/c494543b4cd2a2dcd09cc5a6aa0f7517 adapted to ah2 | |
| RunOrRaise(exePath, winID:="") { | |
| if (winID == "") { | |
| exeName := SubStr(exePath, InStr(exePath, "\", , -1)+1) | |
| winID := "ahk_exe " . exeName | |
| } | |
| If not WinExist(winID) { | |
| UserProfile := EnvGet("USERPROFILE") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # exit on error or on use of undeclared variable or pipe error: | |
| set -o errexit -o errtrace -o nounset -o pipefail | |
| # optionally debug output by supplying TRACE=1 | |
| [[ "${TRACE:-0}" == "1" ]] && set -o xtrace | |
| # Bash 4.4+ supports inherit_errexit; this improves error handling in functions and subshells. If unavailable, ignore. | |
| shopt -s inherit_errexit 2>/dev/null || true | |
| PS4='+\t ' |
NewerOlder