diff --git a/bin/tips b/bin/tips index 7ca4565..96a49a6 100755 --- a/bin/tips +++ b/bin/tips @@ -11,13 +11,16 @@ def tips_home() -> pathlib.Path: return pathlib.Path(os.getenv("TIPS_HOME", default)) / "tips.d" -def list_tips(_: argparse.Namespace) -> list[str]: - for name in tips_home().iterdir(): - print(name.name) - +def list_tips(args: argparse.Namespace) -> None: + if (name := args.name) is None: + for _tips_dir in tips_home().iterdir(): + name = _tips_dir.name + if args.query is not None and args.query not in name: + continue + print(name) + return -def show_tips(args: argparse.Namespace) -> None: - tips_file = tips_home() / args.name / "tips" + tips_file = tips_home() / name / "tips" if not tips_file.exists(): print(f"No tips available for {args.name}") return @@ -56,7 +59,6 @@ def main(args: argparse.Namespace) -> None: actions = { "list": list_tips, - "show": show_tips, "edit": edit_tips, "init": init_tips, } @@ -73,10 +75,6 @@ if __name__ == "__main__": parser.add_argument("--version", "-v", action="version", version="0.0.1") sub_parsers = parser.add_subparsers(help="sub command help", dest="sub_parser") - show_parser = sub_parsers.add_parser("show") - show_parser.add_argument("name", type=str, default=None) - show_parser.add_argument("--query", "-q") - edit_parser = sub_parsers.add_parser("edit") edit_parser.add_argument("name", type=str, default=None) @@ -84,6 +82,8 @@ if __name__ == "__main__": init_parser.add_argument("name", type=str) list_parser = sub_parsers.add_parser("list") + list_parser.add_argument("name", type=str, nargs="?") + list_parser.add_argument("--query", "-q") args = parser.parse_args() main(args) diff --git a/brew/config.d/base/Brewfile b/brew/config.d/base/Brewfile index d572436..ea9f5fd 100644 --- a/brew/config.d/base/Brewfile +++ b/brew/config.d/base/Brewfile @@ -1,3 +1,2 @@ -brew 'gcc' -brew 'nvim' +brew 'neovim' brew 'zsh' diff --git a/brew/config.d/gui/Brewfile b/brew/config.d/gui/Brewfile index a25f699..cc5cb9a 100644 --- a/brew/config.d/gui/Brewfile +++ b/brew/config.d/gui/Brewfile @@ -1,10 +1,10 @@ -tap 'homebrew/cask-fonts' cask 'arc' -cask '1password' -cask 'docker' cask 'font-jetbrains-mono' +cask 'docker' cask 'notion' +cask 'ngrok/ngrok/ngrok' cask 'insomnia' cask 'slack' cask 'visual-studio-code' cask 'wezterm' +cask '1password' diff --git a/tips/tips.d/git/tips b/tips/tips.d/git/tips new file mode 100644 index 0000000..fff3df3 --- /dev/null +++ b/tips/tips.d/git/tips @@ -0,0 +1,2 @@ +* delete remotes/origin/{branch} from local git: git fetch -p +* grep excluding specific path: git grep -- ':!folder' diff --git a/tips/tips.d/rye/tips b/tips/tips.d/rye/tips new file mode 100644 index 0000000..727d8ec --- /dev/null +++ b/tips/tips.d/rye/tips @@ -0,0 +1,2 @@ +* add specific version of Python: `rye fetch 3.11` +* get default python: `rye config --get default.toolchain` diff --git a/tips/tips.d/tail/tips b/tips/tips.d/tail/tips new file mode 100644 index 0000000..edc418d --- /dev/null +++ b/tips/tips.d/tail/tips @@ -0,0 +1 @@ +show contents from N-th line onward: tail -n +{n} diff --git a/wezterm/config.d/wezterm.lua b/wezterm/config.d/wezterm.lua index 6bfdb57..4a4a1c4 100644 --- a/wezterm/config.d/wezterm.lua +++ b/wezterm/config.d/wezterm.lua @@ -9,7 +9,7 @@ config.scrollback_lines = 9999999 config.hyperlink_rules = wezterm.default_hyperlink_rules() -- Font -config.font = wezterm.font 'JetBrains Mono' +config.font = wezterm.font 'JetBrains Mono NL' config.font_size = 16.0 -- https://wezfurlong.org/wezterm/colorschemes/g/index.html