mirror of
https://gitlab.com/sagidayan/linux-config.git
synced 2024-11-21 14:55:26 +00:00
Added a short <prefix>-i for cheat sheet (cht.sh) lookup
This commit is contained in:
parent
3d9a798812
commit
f17255a377
7 changed files with 106 additions and 2 deletions
20
files/dotfiles/shellconfig/cheat.sh
Executable file
20
files/dotfiles/shellconfig/cheat.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
########################################################
|
||||
# DO NOT EDIT - WILL BE DISCARDED IN NEXT PLAYBOOK RUN #
|
||||
########################################################
|
||||
|
||||
# Get docs fast
|
||||
selected=`/bin/cat ~/.shellconfig/cheat/languages ~/.shellconfig/cheat/commands | fzf --header="Select a topic"`
|
||||
if [[ -z $selected ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
read -p "Enter Query: " query
|
||||
|
||||
if grep -qs "$selected" ~/.shellconfig/cheat/languages; then
|
||||
query=`echo $query | tr ' ' '+'`
|
||||
tmux neww bash -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done"
|
||||
else
|
||||
tmux neww bash -c "curl -s cht.sh/$selected~$query | less"
|
||||
fi
|
||||
|
35
files/dotfiles/shellconfig/cheat/commands
Normal file
35
files/dotfiles/shellconfig/cheat/commands
Normal file
|
@ -0,0 +1,35 @@
|
|||
find
|
||||
fzf
|
||||
man
|
||||
tldr
|
||||
sed
|
||||
awk
|
||||
tr
|
||||
cp
|
||||
ls
|
||||
grep
|
||||
xargs
|
||||
ps
|
||||
mv
|
||||
kill
|
||||
lsof
|
||||
less
|
||||
head
|
||||
tail
|
||||
tar
|
||||
rm
|
||||
jq
|
||||
cat
|
||||
ssh
|
||||
cargo
|
||||
git
|
||||
podman
|
||||
docker
|
||||
docker-compose
|
||||
chmod
|
||||
chown
|
||||
make
|
||||
kubectl
|
||||
oc
|
||||
ocp
|
||||
systemctl
|
15
files/dotfiles/shellconfig/cheat/languages
Normal file
15
files/dotfiles/shellconfig/cheat/languages
Normal file
|
@ -0,0 +1,15 @@
|
|||
golang
|
||||
nodejs
|
||||
yaml
|
||||
javascript
|
||||
tmux
|
||||
typescript
|
||||
zsh
|
||||
cpp
|
||||
c
|
||||
rust
|
||||
python
|
||||
bash
|
||||
css
|
||||
markdown
|
||||
ansible
|
|
@ -12,7 +12,6 @@ alias :Q=exit
|
|||
|
||||
alias ls='lsd'
|
||||
alias f='printf "\033c"'
|
||||
alias cat=bat
|
||||
alias top=btm
|
||||
|
||||
alias t=tmux
|
||||
|
|
|
@ -33,6 +33,9 @@ bind-key j send-keys Down
|
|||
|
||||
# Easy config reload
|
||||
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
|
||||
|
||||
# Lookup the cheat sheet <prefix>-i
|
||||
bind-key i run-shell "tmux neww ~/.shellconfig/cheat.sh"
|
||||
############################
|
||||
# Themes
|
||||
###########################
|
||||
|
|
8
playbooks/self-managed-unix-update.yml
Normal file
8
playbooks/self-managed-unix-update.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
- hosts: localhost
|
||||
vars:
|
||||
# Theme options: monokai, gruvbox, nord, tomorrow-night
|
||||
theme: tomorrow-night
|
||||
# The running user
|
||||
running_user: "{{ ansible_user_id }}"
|
||||
roles:
|
||||
- modern_unix_tools
|
|
@ -70,6 +70,11 @@
|
|||
path: ~/.shellconfig/autocomplete
|
||||
state: directory
|
||||
|
||||
- name: Verifying shell cheat config folder
|
||||
file:
|
||||
path: ~/.shellconfig/cheat
|
||||
state: directory
|
||||
|
||||
- name: Sync Common shell settings...
|
||||
changed_when: false
|
||||
copy:
|
||||
|
@ -77,6 +82,14 @@
|
|||
dest: ~/.shellconfig/common.sh
|
||||
force: yes
|
||||
|
||||
- name: Sync Cheat script
|
||||
changed_when: false
|
||||
copy:
|
||||
src: dotfiles/shellconfig/cheat.sh
|
||||
dest: ~/.shellconfig/cheat.sh
|
||||
force: yes
|
||||
mode: u+rx,g-rx,o-rwx
|
||||
|
||||
- name: Copy shell aliases
|
||||
copy:
|
||||
src: dotfiles/shellconfig/aliases.sh
|
||||
|
@ -95,6 +108,17 @@
|
|||
dest: ~/.shellconfig/environment.sh
|
||||
force: no
|
||||
|
||||
- name: Copy languages cheat sheet list
|
||||
copy:
|
||||
src: dotfiles/shellconfig/cheat/languages
|
||||
dest: ~/.shellconfig/cheat/languages
|
||||
force: yes
|
||||
|
||||
- name: Copy commands cheat sheet list
|
||||
copy:
|
||||
src: dotfiles/shellconfig/cheat/commands
|
||||
dest: ~/.shellconfig/cheat/commands
|
||||
force: yes
|
||||
|
||||
- name: Install modern UNIX tools
|
||||
include_role:
|
||||
|
|
Loading…
Reference in a new issue