Skip to content

Commit eb0b0e8

Browse files
committed
Add dockerfile for test container
1 parent 3bc0340 commit eb0b0e8

File tree

4 files changed

+61
-29
lines changed

4 files changed

+61
-29
lines changed

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM debian:stable
2+
3+
WORKDIR /root
4+
5+
# install some packages
6+
RUN apt-get update \
7+
&& apt-get install -y \
8+
locales \
9+
fzf fzy pick \
10+
gawk git sed ripgrep jq curl \
11+
apparix isoquery figlet boxes \
12+
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
13+
ENV LANG en_US.utf8
14+
15+
# install cz
16+
COPY bin/cz /usr/bin/cz
17+
RUN chmod +x /usr/bin/cz
18+
19+
# install bash configuration
20+
COPY conf/cz.bashrc ./.bashrc
21+
COPY conf/cz.bash_profile ./.bash_profile
22+
23+
# grab cz repository
24+
RUN git clone https://github.com/apathor/cz.git src
25+
26+
ENTRYPOINT /bin/bash -l

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ www/:
2828
gif:
2929
gifcut -b1 "$$(capture -W)" "www/img/window-$$(date +%s).gif"
3030

31-
push:
32-
git push github
31+
docker: docker-build
32+
docker run -i -t cz
3333

34-
.PHONY: gif lint push test unit www
34+
docker-build:
35+
docker build -t cz .
36+
37+
.PHONY: gif docker docker-build lint test unit www

conf/cz.bash_profile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- sh-mode -*-
2+
. "$HOME"/.bashrc
3+
4+
# configure cz
5+
export CZ_BINS="fzf fzy pick"
6+
7+
# dump keybinds
8+
awk -F# '/^bind/ { print "#" $2 "\n" $1 "\n" }' "$HOME"/.bashrc >&2

conf/cz.bashrc

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,32 @@ export CZ_GUI=0
1212
# export CZ_DMENU_FONT="Unifont:normal:pixelsize=14"
1313

1414
# Core Functionality
15-
# Insert selected cz plugin output into the readline buffer at cursor
16-
bind -x '"\C-xx":rleval cz meta -q' # insert field(s)
17-
bind -x '"\C-xX":rleval cz meta -p' # insert line
18-
bind -x '"\C-xz":rleval cz meta -r' # insert command output
19-
bind -x '"\C-xZ":rleval cz meta -s' # insert command string
20-
bind -x '"\C-xc":cz meta -r' # just run command
15+
bind -x '"\C-xx":rleval cz meta -q' # insert cz plugin selection at cursor
16+
bind -x '"\C-xX":rleval cz meta -p' # insert cz plugin line at cursor
17+
bind -x '"\C-xz":rleval cz meta -r' # insert cz plugin command output at cursor
18+
bind -x '"\C-xZ":rleval cz meta -s' # insert cz plugin command string at cursor
19+
bind -x '"\C-xc":cz meta -r' # just run cz plugin in command mode
2120

2221
# Shell Utilities
23-
# Insert text useful in the shell
24-
bind -x '"\C-xr":rleval -i cz -q bash history {0}' # insert selected line from bash history matching current word
25-
bind -x '"\C-x!":rleval -i cz -q argv {0:}' # insert word selected from current readline buffer
26-
bind -x '"\C-xu":rleval -i cz -u unicode character' # insert selected unicode character
27-
bind -x '"\C-xU":rleval -i cz -u unicode symbol' # insert selected unicode symbol
28-
bind -x '"\C-x,":rleval -w cz -q whence {0}' # replace word with matching command path
22+
bind -x '"\C-xr":rleval -i cz -q bash history {0}' # insert selected line from bash history matching current word at cursor
23+
bind -x '"\C-x!":rleval -i cz -q argv {0:}' # insert word selected from current readline buffer at cursor
24+
bind -x '"\C-xu":rleval -i cz -u unicode character' # insert selected unicode character at cursor
25+
bind -x '"\C-xU":rleval -i cz -u unicode symbol' # insert selected unicode symbol at cursor
26+
bind -x '"\C-x,":rleval -w cz -q whence {0}' # replace word under cursor with matching command path
2927

3028
# Directory Navigation
31-
# Change directory to selected directory above or below current directory
32-
bind -x '"\C-x<":cz -re "cd {0}" ancestor'
33-
bind -x '"\C-x>":cz -re "cd {0}" descendant'
29+
bind -x '"\C-x<":cz -re "cd {0}" ancestor' # cd to ancestory directory
30+
bind -x '"\C-x>":cz -re "cd {0}" descendant' # cd to descendant directory
3431

3532
# Git
36-
# Insert selected paths from git repo in the current directory into the readline buffer
37-
bind -x '"\C-xg":rleval cz -q git status' # insert path of selected modified file
38-
bind -x '"\C-xG":rleval cz -q git file' # insert path of selected git tracked file
33+
bind -x '"\C-xg":rleval cz -q git status' # insert path of selected modified file at cursor
34+
bind -x '"\C-xG":rleval cz -q git file' # insert path of selected git tracked file at cursor
3935

4036
# File Lookup
41-
# Replace the word under readline cursor with a selected file
42-
bind -x '"\C-xd":rleval -w cz -q find dir {0}' # find dir under directory at cursor
43-
bind -x '"\C-xD":rleval -w cz -q find dir . {0}' # find dir matching word at cursor
44-
bind -x '"\C-xf":rleval -w cz -q find file {0}' # find file under directory at cursor
45-
bind -x '"\C-xF":rleval -w cz -q find file . {0}' # replace word at cursor with find file matching word at cursor
46-
bind -x '"\C-xl":rleval -w cz -q locate {0}' # replace word at cursor with name of file from locate database matching it
47-
bind -x '"\C-xe":rleval -w cz -q grep {0}' # replace word at cursor with name of selected file matching it
48-
bind -x '"\C-xE":rleval -r cz -r grep {0}' # edit the line matching the pattern at cursor
37+
bind -x '"\C-xd":rleval -w cz -q find dir {0}' # find dir under directory at cursor
38+
bind -x '"\C-xD":rleval -w cz -q find dir . {0}' # find dir matching word at cursor
39+
bind -x '"\C-xf":rleval -w cz -q find file {0}' # find file under directory at cursor
40+
bind -x '"\C-xF":rleval -w cz -q find file . {0}' # replace word at cursor with find file matching word at cursor
41+
bind -x '"\C-xl":rleval -w cz -q locate {0}' # replace word at cursor with name of file from locate database matching it
42+
bind -x '"\C-xe":rleval -w cz -q grep {0}' # replace word at cursor with name of selected file matching it
43+
bind -x '"\C-xE":rleval -r cz -r grep {0}' # edit the line matching the pattern at cursor

0 commit comments

Comments
 (0)