Skip to content

Commit

Permalink
Merge branch 'main' of github.com:himkt/dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
himkt committed Jul 13, 2024
2 parents df1c3ee + 7a813ca commit ffefd34
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
22 changes: 11 additions & 11 deletions bin/tips
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -56,7 +59,6 @@ def main(args: argparse.Namespace) -> None:

actions = {
"list": list_tips,
"show": show_tips,
"edit": edit_tips,
"init": init_tips,
}
Expand All @@ -73,17 +75,15 @@ 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)

init_parser = sub_parsers.add_parser("init")
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)
3 changes: 1 addition & 2 deletions brew/config.d/base/Brewfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
brew 'gcc'
brew 'nvim'
brew 'neovim'
brew 'zsh'
6 changes: 3 additions & 3 deletions brew/config.d/gui/Brewfile
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 2 additions & 0 deletions tips/tips.d/git/tips
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* delete remotes/origin/{branch} from local git: git fetch -p
* grep excluding specific path: git grep -- ':!folder'
2 changes: 2 additions & 0 deletions tips/tips.d/rye/tips
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* add specific version of Python: `rye fetch 3.11`
* get default python: `rye config --get default.toolchain`
1 change: 1 addition & 0 deletions tips/tips.d/tail/tips
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
show contents from N-th line onward: tail -n +{n}
2 changes: 1 addition & 1 deletion wezterm/config.d/wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ffefd34

Please sign in to comment.