From 4e479c4d3a8f0f813c2818d73516741b69e7a4fb Mon Sep 17 00:00:00 2001 From: Derek Wan Date: Sat, 29 Jun 2024 08:42:42 +0900 Subject: [PATCH] More aliases (#159) * Upgrades * more --- .bumpversion.cfg | 2 +- git/aliases.sh | 7 ++++++- install-mac.conf.yaml | 4 ++++ nvim/lazy-lock.json | 30 +++++++++++++++--------------- nvim/lua/snippets.lua | 9 +++++++++ shell/common.sh | 9 +++++++-- 6 files changed, 42 insertions(+), 19 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 028f41e..911da33 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,2 +1,2 @@ [bumpversion] -current_version = 0.1.157 +current_version = 0.1.158 diff --git a/git/aliases.sh b/git/aliases.sh index 3973185..e7b1d08 100644 --- a/git/aliases.sh +++ b/git/aliases.sh @@ -199,7 +199,7 @@ if command -v git >/dev/null 2>&1; then alias grmr='git rm -r' alias grmrf='git rm -rf' # status - alias gs='git status' + gs() { git status "$@"; } # stash alias gst='git stash' alias gstd='git stash drop' @@ -233,4 +233,9 @@ if command -v git >/dev/null 2>&1; then # push alias gpw='gp && gitweb' alias gpfw='gpf && gitweb' + + # watchexec + if command -v gitweb >/dev/null 2>&1; then + gsw() { watchexec -- git status "$@"; } + fi fi diff --git a/install-mac.conf.yaml b/install-mac.conf.yaml index 933f665..7dc7488 100644 --- a/install-mac.conf.yaml +++ b/install-mac.conf.yaml @@ -181,6 +181,10 @@ Installing stylua, ] - ["command -v tmux >/dev/null 2>&1 || brew install tmux", Installing tmux] + - [ + "command -v topgrade >/dev/null 2>&1 || brew install topgrade", + Installing topgrade, + ] - ["command -v uv >/dev/null 2>&1 || brew install uv", Installing uv] - [ "command -v watch >/dev/null 2>&1 || brew install watch", diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 4fa6567..9528384 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -37,11 +37,11 @@ }, "conform.nvim": { "branch": "master", - "commit": "9a06e83527407a7600a2fe4e0d10adf432b6215e" + "commit": "c26dadf8a47a547768d1048a0d698ecec33494ce" }, "dial.nvim": { "branch": "master", - "commit": "7af2daaaf933b0617ded0f78b49f4d5fc45f9f64" + "commit": "750f802879c90ea51f92b68c35fa562ee575804a" }, "fidget.nvim": { "branch": "main", @@ -53,11 +53,11 @@ }, "fzf-lua": { "branch": "main", - "commit": "1ec6eeda11c3a3dcd544e1c61ad4b8c9b49903c4" + "commit": "41ea49cfc1b3f0586753bbeb7850474f28dc22cf" }, "gitsigns.nvim": { "branch": "main", - "commit": "8df63f2ddc615feb71fd4aee45a4cee022876df1" + "commit": "6b1a14eabcebbcca1b9e9163a26b2f8371364cb7" }, "inc-rename.nvim": { "branch": "main", @@ -65,7 +65,7 @@ }, "indent-blankline.nvim": { "branch": "master", - "commit": "4036c8ae9cc29faf8e6443fa5b23e679db055d24" + "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, "iswap.nvim": { "branch": "master", @@ -73,7 +73,7 @@ }, "lazy.nvim": { "branch": "main", - "commit": "4ea9fe060042f345960ad0c01aa7bca91405e10a" + "commit": "a1fffe18f9355030fbb483156c762f50f5e0db73" }, "leap.nvim": { "branch": "main", @@ -89,7 +89,7 @@ }, "luasnip": { "branch": "master", - "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" + "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "marks.nvim": { "branch": "master", @@ -145,11 +145,11 @@ }, "nvim-lint": { "branch": "master", - "commit": "941fa1220a61797a51f3af9ec6b7d74c8c7367ce" + "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, "nvim-lspconfig": { "branch": "master", - "commit": "9c9eb07fecc578e25e28db8dc9002b43fff2ed79" + "commit": "95b2fc427353e42318c974d10685d500441b821b" }, "nvim-neoclip.lua": { "branch": "main", @@ -157,11 +157,11 @@ }, "nvim-spectre": { "branch": "master", - "commit": "ec67d4b5370094b923dfcf6b09b39142f2964861" + "commit": "49fae98ef2bfa8342522b337892992e3495065d5" }, "nvim-surround": { "branch": "main", - "commit": "b36bf49d097a09781ad6ac0cfea28b40b74570a3" + "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-tree-pairs": { "branch": "main", @@ -173,11 +173,11 @@ }, "nvim-treesitter": { "branch": "master", - "commit": "9d80c1497ec343f81c0c5800b65f2e73ca569025" + "commit": "3e535e826da265748b875b18dbfb361bd1a1701c" }, "nvim-treesitter-context": { "branch": "master", - "commit": "5efba33af0f39942e426340da7bc15d7dec16474" + "commit": "f2cbd231e296a282aa9aedb2a411539801557307" }, "nvim-treesitter-textobjects": { "branch": "master", @@ -221,11 +221,11 @@ }, "tokyonight.nvim": { "branch": "main", - "commit": "81c867c5f638597a82c82094dcb90ed42444dabc" + "commit": "30d7be361a7fbf187a881f17e574e9213d5108ea" }, "trouble.nvim": { "branch": "main", - "commit": "57761ba7148164f0315ed203e714ac242329abd4" + "commit": "88c3be40c061ce053ab326ce4fdcb973a1f785ff" }, "vim-caser": { "branch": "master", diff --git a/nvim/lua/snippets.lua b/nvim/lua/snippets.lua index d1c250e..30ef2b2 100644 --- a/nvim/lua/snippets.lua +++ b/nvim/lua/snippets.lua @@ -4,7 +4,13 @@ local s = ls.snippet local t = ls.text_node ls.add_snippets("python", { + -- breakpoints s("bp", { t({ "breakpoint()", "" }) }), + s("index-bp", { + t({ "if index == " }), + i(1, "Index"), + t({ ":", " breakpoint()" }), + }), -- miscellaneous s("fu-annotations", { t({ "from __future__ import annotations", "" }) }), @@ -110,6 +116,8 @@ ls.add_snippets("python", { s("po-int64", { t({ "from polars import Int64", "" }) }), s("po-list", { t({ "from polars import List", "" }) }), s("po-lit", { t({ "from polars import lit", "" }) }), + s("po-max-horizontal", { t({ "from polars import max_horizontal", "" }) }), + s("po-min-horizontal", { t({ "from polars import min_horizontal", "" }) }), s("po-series", { t({ "from polars import Series", "" }) }), s("po-struct", { t({ "from polars import struct", "" }) }), s("po-utf8", { t({ "from polars import Utf8", "" }) }), @@ -128,6 +136,7 @@ ls.add_snippets("python", { s("py-approx", { t({ "from pytest import approx", "" }) }), s("py-fixture", { t({ "from pytest import fixture", "" }) }), s("py-mark", { t({ "from pytest import mark, param", "" }) }), + s("py-param", { t({ "from pytest import param", "" }) }), s("py-raises", { t({ "from pytest import raises", "" }) }), -- pytest-benchmark diff --git a/shell/common.sh b/shell/common.sh index 6e838a1..efd1ef6 100644 --- a/shell/common.sh +++ b/shell/common.sh @@ -162,12 +162,12 @@ fi # ps alias pst='ps -fLu "$USER"| wc -l' -if [ "$(command -v watch)" ]; then +if command -v watch >/dev/null 2>&1; then alias wpst='watch -d -n0.1 "ps -fLu \"$USER\" | wc -l"' fi # pyright -if [ "$(command -v pyright)" ]; then +if command -v pyright >/dev/null 2>&1; then pyr() { pyright "$@"; } pyrw() { pyr -w "$@"; } fi @@ -184,6 +184,11 @@ pyproject() { ${EDITOR} "$(groot)"/pyproject.toml; } # q start_q() { QHOME="${HOME}"/q rlwrap -r "$HOME"/q/m64/q "$@"; } +# rg +if command -v pyright >/dev/null 2>&1 && command -v watchexec >/dev/null 2>&1; then + rgw() { watchexec rg "$@"; } +fi + # rm alias rmr='rm -r' alias rmf='rm -f'