1
0

Initial commit

This commit is contained in:
CronyAkatsuki 2022-11-29 14:28:24 +01:00
commit 369b027c8f
6 changed files with 301 additions and 0 deletions

103
.aliasrc Executable file
View File

@ -0,0 +1,103 @@
#!/bin/sh
# Adding colours to some of the regulas shit
alias grep='grep --color=auto'
alias ls='ls -Alh --color=always --group-directories-first'
alias tree='tree -C'
alias less='less -R'
# Humna readable + better output
alias df='df -h -x devtmpfs -x tmpfs -x usbfs -x loop'
alias free='free -m -h'
# Quickly see the hogger in the directory
alias dust='du -hd1 | sort -hr | sed "s/.\///g" | sed "/\.$/d"'
# Who want to remember this long ass commands
alias yta='yt-dlp -x -f bestaudio --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --audio-format vorbis -o "%(title)s.%(ext)s"'
alias ytvb='yt-dlp --merge-output-format mp4 -f "bestvideo+bestaudio[ext=m4a]/best" --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s"'
alias ytvf='yt-dlp --merge-output-format mp4 --format best --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s"'
# Nice
alias dl='aria2c -j 16 -s 16 -x 16 -k 5M --file-allocation=none'
# Functions
# Cd into a directory using fzf
fcd () {
dir=$(fd -a --type d --hidden --exclude ".git|.github" | fzf --prompt "Choose directory: ")
[ -z $dir ] && return 1
cd $dir
}
# Remove choosed stuff
frm () {
remove=$(fd --hidden --maxdepth 1 | fzf -m --prompt "Choose to delete: ")
[ -z $remove ] && return 1
rm -rf $(printf '%s' $remove)
}
# Quicly choose stuff to add using fzf
fga () {
git add $(git status -s | awk '{ print $2 }' | fzf -m)
}
# Open a script in path with vim quicly
vish () {
nvim $(which $1)
}
# Create a directory and change into it
md () {
mkdir -p "$@" && cd "$@"
}
# Move a file and create a link in it's place
mvln () {
from=$(readlink -f $1)
to=$(readlink -f $2)
mv $from $to
ln -s $to $from
}
# Find my script and let me edit them
se() {
fd . ~/bin -L --type f --color=never | fzf --prompt "Choose script to edit: " \
--preview 'bat --color=always --style=plain --pager=never {}' | xargs -r $EDITOR
}
# List my config and open the dir in a editor
ce() {
fd . ~/.config -L --maxdepth 1 --color=never | fzf --prompt \
"Choose config to edit: " --preview 'tree -a -C {}' | xargs -r $EDITOR
}
# List files in a directory and edit choosen one
vf(){
fd -L --maxdepth 1 --type f --color=never --hidden | fzf --prompt "Choose script to edit: " \
--preview 'bat --color=always --style=plain --pager=never {}' | xargs -r $EDITOR
}
# Install packages using paru
i() {
pkg list-all | fzf -q "$1" -m --preview 'pkg show {1}'| xargs -ro pkg install
}
# Remove installed packages
r() {
pkg list-installed | fzf -q "$1" -m --preview 'pkg show {1}' | xargs -ro pkg uninstall
}
# history search
h() {
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g')
}
# Copy current working directory
cpdir() {
pwd | tr -d "\r\n" | xclip -sel c
}
# Copy content of a file.
cf() {
cat $1 | xclip -sel c
}

128
.config/lf/lfrc Normal file
View File

@ -0,0 +1,128 @@
# Basic Settings
set preview true
set drawbox true
set icons true
set ignorecase true
set ratios 1:2:3
set scrolloff 10
set shell zsh
set shellopts '-euy'
set ifs "\n"
# remove some of the default bindings
map n
map m
map o
map "'"
map '"'
map d
map c
map e
map f
# Basic Functions
map . set hidden!
map <delete> delete
map p paste
map d cut
map y copy
map r rename
map R reload
map C clear
map U unselect
cmd open ${{
$HOME/.config/lf/opener "$f"
}}
map o open
# Different file openings
map ee $$EDITOR "$f"
map er $$READER "$f"
map eb $$BOOK_READER "$f"
# Execute current file
map x $$f
map X !$f
# make directory
cmd mkdir ${{
printf "Directory Name: "
read ans
mkdir "$ans"
}}
map md mkdir
# make file
cmd mkfile ${{
printf "File Name: "
read ans
$EDITOR "$ans"
}}
map mf mkfile
# make programs executable
cmd chmod ${{
printf "Mode Bits: "
read ans
for file in "$fx"
do
chmod $ans "$file"
done
}}
map ch chmod
# Archive
cmd unarchive ${{
printf "Extracting:"
for file in "$fx"
do
7z x "$file"
done
}}
map au unarchive
# Fzf to the rescue
cmd fzf_jump ${{
res="$(find . -maxdepth 1 -type d | fzf --reverse --header='Jump to location' | sed 's/\\/\\\\/g;s/"/\\"/g')"
if [ -d "$res" ] ; then
cmd="cd"
elif [ -f "$res" ] ; then
cmd="select"
else
exit 0
fi
lf -remote "send $id $cmd \"$res\""
}}
map <c-f> :fzf_jump
# SYMLINKING
# y (select for copy) and P to paste soft-link
# d (select for cut) and P to paste hard-link
cmd link %{{
set -- $(cat ~/.local/share/lf/files)
mode="$1"
shift
if [ "$#" -lt 1 ]; then
lf -remote "send $id echo no files to link"
exit 0
fi
case "$mode" in
# symbolically copy mode is indicating a soft link
copy) ln -sr -t . -- "$@";;
# while a move mode is indicating a hard link
move) ln -t . -- "$@";;
esac
rm ~/.local/share/lf/files
lf -remote "send clear"
}}
map P :link

13
.config/starship.toml Normal file
View File

@ -0,0 +1,13 @@
# Inserts a blank line between shell prompts
add_newline = false
# Replace the "" symbol in the prompt with "➜"
[character] # The name of the module we are configuring is "character"
success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
# Disable the package module, hiding it from the prompt completely
[package]
disabled = false
[cmd_duration]
min_time = 500

12
.zshenv Normal file
View File

@ -0,0 +1,12 @@
typeset -U PATH path
path=("$HOME/.local/bin" "$HOME/bin/misc/" "$path[@]")
export PATH
export EDITOR=nvim
export FZF_DEFAULT_OPTS=" --reverse \
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8"
export FZF_DEFAULT_COMMAND='fd --type f --color=never --hidden --exclude ".git"'

24
.zshrc Normal file
View File

@ -0,0 +1,24 @@
eval "$(starship init zsh)"
[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"
zstyle ':completion:*' rehash true
# Plugins
plug "hlissner/zsh-autopair"
plug "zap-zsh/supercharge"
plug "zap-zsh/completions"
plug "zap-zsh/vim"
plug "zsh-users/zsh-autosuggestions"
plug "zsh-users/zsh-completions"
plug "zsh-users/zsh-syntax-highlighting"
# Local source
plug "$HOME/.aliasrc"
# History settings
setopt appendhistory
setopt INC_APPEND_HISTORY
export HISTTIMEFORMAT="[%F %T]"
HISTSIZE=10000
SAVEHIST=5000

21
install.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# My termux setup script
pkg upgrade
pkg install openssh neovim zsh starship termux-api git coreutils nodejs clang fzf fd tree p7zip
[ ! -d "$HOME/.config" ] && mkdir -p "$HOME/.config"
[ ! -d "$HOME/.config/nvim" ] && git clone https://gitlab.com/cronyakatsuki/nvim-conf.git $HOME/.config/nvim
[ ! -d "$HOME/repos" ] && mkdir -p "$HOME/repos"
[ ! -d "$HOME/repos/ia-downloader" ] && git clone https://gitlab.com/cronyakatsuki/ia-downloader.git $HOME/repos/ia-downloader
[ ! -d "$HOME/.local/bin" ] && mkdir -p "$HOME/.local/bin"
[ ! -f "$HOME/.local/bin/ia-downloader" ] && ln -s $HOME/repos/ia-downloader/ia-downloader $HOME/.local/bin/ia-downloader
chsh -s zsh