mirror of
https://gitlab.com/sagidayan/linux-config.git
synced 2024-11-16 20:35:25 +00:00
Merge branch 'cheat-sheet-function' into 'main'
Added a short <prefix>-i for cheat sheet (cht.sh) lookup See merge request sagidayan/linux-config!7
This commit is contained in:
commit
dae8430053
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 ls='lsd'
|
||||||
alias f='printf "\033c"'
|
alias f='printf "\033c"'
|
||||||
alias cat=bat
|
|
||||||
alias top=btm
|
alias top=btm
|
||||||
|
|
||||||
alias t=tmux
|
alias t=tmux
|
||||||
|
|
|
@ -33,6 +33,9 @@ bind-key j send-keys Down
|
||||||
|
|
||||||
# Easy config reload
|
# Easy config reload
|
||||||
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
|
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
|
# 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
|
path: ~/.shellconfig/autocomplete
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
- name: Verifying shell cheat config folder
|
||||||
|
file:
|
||||||
|
path: ~/.shellconfig/cheat
|
||||||
|
state: directory
|
||||||
|
|
||||||
- name: Sync Common shell settings...
|
- name: Sync Common shell settings...
|
||||||
changed_when: false
|
changed_when: false
|
||||||
copy:
|
copy:
|
||||||
|
@ -77,6 +82,14 @@
|
||||||
dest: ~/.shellconfig/common.sh
|
dest: ~/.shellconfig/common.sh
|
||||||
force: yes
|
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
|
- name: Copy shell aliases
|
||||||
copy:
|
copy:
|
||||||
src: dotfiles/shellconfig/aliases.sh
|
src: dotfiles/shellconfig/aliases.sh
|
||||||
|
@ -95,7 +108,18 @@
|
||||||
dest: ~/.shellconfig/environment.sh
|
dest: ~/.shellconfig/environment.sh
|
||||||
force: no
|
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
|
- name: Install modern UNIX tools
|
||||||
include_role:
|
include_role:
|
||||||
name: modern_unix_tools
|
name: modern_unix_tools
|
||||||
|
|
Loading…
Reference in a new issue