Skip to content

Commit

Permalink
Add rlwrap and justpath (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
dycw authored Jun 24, 2024
1 parent 58adbaf commit 1570314
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[bumpversion]
current_version = 0.1.156
current_version = 0.1.157
8 changes: 8 additions & 0 deletions install-mac.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
"command -v rg >/dev/null 2>&1 || brew install ripgrep",
Installing ripgrep,
]
- [
"command -v rlwrap >/dev/null 2>&1 || brew install rlwrap",
Installing rlwrap,
]
- ["command -v ruff >/dev/null 2>&1 || brew install ruff", Installing ruff]
- [
"command -v shellcheck >/dev/null 2>&1 || brew install shellcheck",
Expand Down Expand Up @@ -216,3 +220,7 @@
"command -v harlequin >/dev/null 2>&1 || pipx install harlequin",
Installing harlequin,
]
- [
"command -v justpath >/dev/null 2>&1 || pipx install justpath",
Installing justpath,
]
10 changes: 8 additions & 2 deletions ipython/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@
TimedeltaIndex,
Timestamp,
bdate_range,
date_range,
qcut,
read_pickle,
read_sql,
Expand Down Expand Up @@ -765,7 +764,6 @@
Week,
assert_index_equal,
bdate_range,
date_range,
pandas,
pd,
qcut,
Expand Down Expand Up @@ -824,7 +822,10 @@
Utf8,
col,
concat,
date_range,
datetime_range,
int_range,
int_ranges,
lit,
read_avro,
read_csv,
Expand Down Expand Up @@ -856,6 +857,7 @@
DataFrame,
Series,
concat,
date_range,
read_csv,
read_excel,
read_parquet,
Expand All @@ -873,6 +875,7 @@
assert_frame_equal,
assert_series_equal,
concat,
date_range,
read_csv,
read_excel,
read_parquet,
Expand Down Expand Up @@ -917,7 +920,10 @@
assert_series_not_equal,
col,
concat,
date_range,
datetime_range,
int_range,
int_ranges,
lit,
pl,
polars,
Expand Down
16 changes: 8 additions & 8 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"fzf-lua": {
"branch": "main",
"commit": "235119b859d1d3dc136a5dbfd24b626b5af72130"
"commit": "1ec6eeda11c3a3dcd544e1c61ad4b8c9b49903c4"
},
"gitsigns.nvim": {
"branch": "main",
Expand All @@ -65,15 +65,15 @@
},
"indent-blankline.nvim": {
"branch": "master",
"commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f"
"commit": "4036c8ae9cc29faf8e6443fa5b23e679db055d24"
},
"iswap.nvim": {
"branch": "master",
"commit": "e02cc91f2a8feb5c5a595767d208c54b6e3258ec"
},
"lazy.nvim": {
"branch": "main",
"commit": "bc620783663ab09d16bff9fdecc07da65b2a1528"
"commit": "4ea9fe060042f345960ad0c01aa7bca91405e10a"
},
"leap.nvim": {
"branch": "main",
Expand Down Expand Up @@ -149,7 +149,7 @@
},
"nvim-lspconfig": {
"branch": "master",
"commit": "f43135c38a37c588053ad5e209c7460f43f6340c"
"commit": "9c9eb07fecc578e25e28db8dc9002b43fff2ed79"
},
"nvim-neoclip.lua": {
"branch": "main",
Expand All @@ -169,11 +169,11 @@
},
"nvim-tree.lua": {
"branch": "master",
"commit": "2086e564c4d23fea714e8a6d63b881e551af2f41"
"commit": "8b2c5c678be4b49dff6a2df794877000113fd77b"
},
"nvim-treesitter": {
"branch": "master",
"commit": "b967bbc27b564001c3d3b8ea93444cf6d0b21d23"
"commit": "9d80c1497ec343f81c0c5800b65f2e73ca569025"
},
"nvim-treesitter-context": {
"branch": "master",
Expand Down Expand Up @@ -225,7 +225,7 @@
},
"trouble.nvim": {
"branch": "main",
"commit": "2d8610a07033f2b367e71230ab128f8b89c2639d"
"commit": "57761ba7148164f0315ed203e714ac242329abd4"
},
"vim-caser": {
"branch": "master",
Expand All @@ -237,7 +237,7 @@
},
"vim-just": {
"branch": "main",
"commit": "5ad2c6b625d40d929d58cddeca9c459d5f380755"
"commit": "c771fb5f00fd219833600c8164e6befe3c163b9a"
},
"vim-mergetool": {
"branch": "master",
Expand Down
24 changes: 23 additions & 1 deletion nvim/lua/snippets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ ls.add_snippets("python", {
s("cl-command", { t({ "from click import command", "" }) }),
s("cl-option", { t({ "from click import option", "" }) }),

-- collections
s("co-iterable", { t({ "from collections.abc import Iterable", "" }) }),
s("co-iterator", { t({ "from collections.abc import Iterator", "" }) }),
s("co-mapping", { t({ "from collections.abc import Mapping", "" }) }),

-- contextlib
s("co-suppress", { t({ "from contextlib import suppress", "" }) }),

Expand Down Expand Up @@ -51,6 +56,10 @@ ls.add_snippets("python", {
s("fu-partial", { t({ "from functools import partial", "" }) }),
s("fu-reduce", { t({ "from functools import reduce", "" }) }),

-- humanize
s("hu-naturaldelta", { t({ "from humanize import naturaldelta", "" }) }),
s("hu-naturaltime", { t({ "from humanize import naturaltime", "" }) }),

-- hypothesis
s("hy-assume", { t({ "from hypothesis import assume", "" }) }),
s("hy-data", { t({ "from hypothesis.strategies import data, DataObject", "" }) }),
Expand Down Expand Up @@ -88,17 +97,23 @@ ls.add_snippets("python", {
s("po-assert-series-equal", { t({ "from polars.testing import assert_series_equal", "" }) }),
s("po-boolean", { t({ "from polars import Boolean", "" }) }),
s("po-col", { t({ "from polars import col", "" }) }),
s("po-concat", { t({ "from polars import concat", "" }) }),
s("po-dataframe", { t({ "from polars import DataFrame", "" }) }),
s("po-date-range", { t({ "from polars import date_range", "" }) }),
s("po-date-ranges", { t({ "from polars import date_ranges", "" }) }),
s("po-datetime", { t({ "from polars import Datetime", "" }) }),
s("po-enum", { t({ "from polars import Enum", "" }) }),
s("po-expr", { t({ "from polars import Expr", "" }) }),
s("po-float64", { t({ "from polars import Float64", "" }) }),
s("po-int-range", { t({ "from polars import int_range", "" }) }),
s("po-int-ranges", { t({ "from polars import int_ranges", "" }) }),
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-series", { t({ "from polars import Series", "" }) }),
s("po-struct", { t({ "from polars import struct", "" }) }),
s("po-utf8", { t({ "from polars import Utf8", "" }) }),
s("po-when", { t({ "from polars import when", "" }) }),

-- pytest
s("mark-only", { t({ "@mark.only", "" }) }),
Expand All @@ -125,7 +140,10 @@ ls.add_snippets("python", {
s("re-search", { t({ "from re import search", "" }) }),

-- rich
s("ri-print", { t({ "from rich import print", "" }) }),
s("ri-print", { t({ "from rich import print", "" }), t({ "" }), t({ "print(" }), i(1, "Values"), t({ ")", "" }) }),

-- shutil
s("sh-rmtree", { t({ "from shutil import rmtree", "" }) }),

-- sqlalchemy
s("sq-func", { t({ "from sqlalchemy import func", "" }) }),
Expand All @@ -137,6 +155,9 @@ ls.add_snippets("python", {
s("su-check-output", { t({ "from subprocess import check_output", "" }) }),
s("su-run", { t({ "from subprocess import run", "" }) }),

-- tempfile
s("te-temporary-directory", { t({ "from utilities.tempfile import TemporaryDirectory", "" }) }),

-- time
s("ti-sleep", { t({ "from time import sleep", "" }) }),

Expand Down Expand Up @@ -184,6 +205,7 @@ ls.add_snippets("python", {
s("ut-select-to-dataframe", { t({ "from utilities.sqlalchemy_polars import select_to_dataframe", "" }) }),
s("ut-strip-and-dedent", { t({ "from utilities.text import strip_and_dedent", "" }) }),
s("ut-take", { t({ "from utilities.iterables import take", "" }) }),
s("ut-timer", { t({ "from utilities.timer import Timer", "" }) }),
s("ut-throttle", { t({ "from utilities.pytest import throttle", "" }) }),
s("ut-tokyo", { t({ "from utilities.zoneinfo import TOKYO", "" }) }),
s("ut-write-pickle", { t({ "from utilities.pickle import write_pickle", "" }) }),
Expand Down
6 changes: 3 additions & 3 deletions shell/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ if command -v nvim >/dev/null 2>&1; then
lua_snippets() { ${EDITOR} "${HOME}"/dotfiles/nvim/lua/snippets.lua; }
fi

# path
alias echo-path='sed '"'"'s/:/\n/g'"'"' <<< "${PATH}"'

# pip
pi() { pip install "$@"; }
pie() { pi --editable .; }
Expand Down Expand Up @@ -184,6 +181,9 @@ fi
# python
pyproject() { ${EDITOR} "$(groot)"/pyproject.toml; }

# q
start_q() { QHOME="${HOME}"/q rlwrap -r "$HOME"/q/m64/q "$@"; }

# rm
alias rmr='rm -r'
alias rmf='rm -f'
Expand Down
10 changes: 10 additions & 0 deletions shell/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ case ":${PATH}:" in
;;
esac

# kdb
export QHOME="${HOME}"/q
__dir="${QHOME}/m64"
case ":${PATH}:" in
*:"${__dir}":*) ;;
*)
export PATH="${__dir}:${PATH}"
;;
esac

# neovim
if command -v nvim >/dev/null 2>&1; then
export EDITOR=nvim
Expand Down
15 changes: 15 additions & 0 deletions zsh/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,18 @@ eval "$(direnv hook zsh)"
for _file in "$HOME"/work/dts/scripts/completions/zsh/*.zsh; do
source "$_file"
done

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/derekwan/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/derekwan/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/derekwan/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/derekwan/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

0 comments on commit 1570314

Please sign in to comment.