- Moved existing functions from dotfiles over to this repo.
- Made pnew() loop till a valid name is given. - Made bootstrap script to symlink all scripts to ~/.config/shell
This commit is contained in:
99
.gitignore
vendored
Normal file
99
.gitignore
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
# ---- KDE Neon ----
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# ---- macOS ----
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# ---- IDE ----
|
||||
# Vim Artifacts
|
||||
**.swp
|
||||
lazy-lock.json
|
||||
.luarc.json
|
||||
|
||||
# VS Code Artifacts
|
||||
/.vscode/
|
||||
**state.vscdb
|
||||
**state.vscdb.backup
|
||||
.vscode/extensions/** # Ignore all Files under .vscode/extensions/
|
||||
!.vscode/extensions/**/*.json # Only json files inside the .vscode/extensions/ folder
|
||||
|
||||
# Intellij IDE Artifacts
|
||||
.idea/
|
||||
*.imi
|
||||
*.jar
|
||||
*.tar
|
||||
resharper-host/
|
||||
tasks/
|
||||
|
||||
# ---- Programming Languages ----
|
||||
# Ignore all downloaded node modules
|
||||
node_modules/*
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
# Ignore all minified js files
|
||||
*.min.js
|
||||
|
||||
# Log files
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Other Files to ignore
|
||||
**app_stat_v2.db
|
||||
.ssh/*.pub
|
||||
**/Package Control.cache
|
||||
**Cache
|
||||
*.db
|
||||
*.qmlc
|
||||
*.qml
|
||||
*.jsc
|
||||
**/contents/images
|
||||
**/contents/fonts
|
||||
*kpluginindex.json
|
||||
7
10x_generic_programming.sh
Normal file
7
10x_generic_programming.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
url_encode(){
|
||||
python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1"
|
||||
}
|
||||
|
||||
alias gicp="cp ~/.gitignore ."
|
||||
17
10x_nvim.sh
Normal file
17
10x_nvim.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Nvim Distro-Switcher
|
||||
alias nvim-lazy="NVIM_APPNAME=nvim-lazy nvim"
|
||||
alias OldConfig="NVIM_APPNAME=oldconfig nvim"
|
||||
nvims() {
|
||||
items=$(find -L "$HOME"/.config -maxdepth 2 -name "init.lua" -type f -execdir sh -c 'pwd | xargs basename' \;)
|
||||
config=$(printf "%s\n" "${items[@]}" | fzf --prompt=" Neovim Config " --height=~50% --layout=reverse --border --exit-0)
|
||||
if [ -z "$config" ]; then
|
||||
echo "Nothing selected"
|
||||
return 0
|
||||
elif [ "$config" = "default" ]; then
|
||||
config=""
|
||||
fi
|
||||
NVIM_APPNAME=$config nvim "$@"
|
||||
}
|
||||
|
||||
17
10x_project_access.sh
Normal file → Executable file
17
10x_project_access.sh
Normal file → Executable file
@@ -1,5 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# TODO: Alias to quickly add my template .gitignore file to any location
|
||||
# - Create fuzzy finder for cht.sh & tldr
|
||||
# - Move all dev prod scripts to its own project
|
||||
|
||||
op() {
|
||||
local chosen_project
|
||||
chosen_project="$(find -L ~/Code -mindepth 2 -maxdepth 2 -not -path '*/.*' -printf "%T@ %p\n" | sort -nr | cut -d ' ' -f 2- | fzf --prompt='Select a project: ')"
|
||||
@@ -23,6 +27,9 @@ pnew(){
|
||||
fi
|
||||
|
||||
local project_name
|
||||
|
||||
# Until user provides a good directory name or cancels out
|
||||
while [ -d "$directory/$project_name" ]; do
|
||||
if [ -n "$1" ]; then
|
||||
project_name="$1"
|
||||
else
|
||||
@@ -30,16 +37,14 @@ pnew(){
|
||||
fi
|
||||
|
||||
if [ -z "$project_name" ]; then
|
||||
echo "You did not chose a project name!!!"
|
||||
return 1
|
||||
echo "Cancelling..."
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -d "$directory/$project_name" ]; then
|
||||
echo "$directory/$project_name project already exists"
|
||||
echo "Try again"
|
||||
return 1
|
||||
# TODO: Should allow to reenter the name
|
||||
echo "'$directory/$project_name' already exists"
|
||||
fi
|
||||
done
|
||||
|
||||
[ -d "$directory/$project_name" ] || mkdir -p "$directory/$project_name" || return
|
||||
|
||||
|
||||
@@ -10,3 +10,7 @@
|
||||
- Keep them as portable as possible
|
||||
1. Across all *nic OS
|
||||
2. Across sh, bash, zsh
|
||||
|
||||
## Todo
|
||||
|
||||
- [ ] Make a bootstrap file that symlinks new files to $XDG_CONFIG_HOME/shell/
|
||||
12
bootstrap.sh
Executable file
12
bootstrap.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$XDG_CONFIG_HOME" ]; then
|
||||
echo "Config directory (shell variable XDG_CONFIG_HOME) not setup in the computer"
|
||||
return 1
|
||||
fi
|
||||
|
||||
[ -d "$XDG_CONFIG_HOME/shell/" ] || mkdir "$XDG_CONFIG_HOME/shell/" || return
|
||||
|
||||
for x_10 in "$PWD"/10x*.sh; do
|
||||
ln -sf "$x_10" "$XDG_CONFIG_HOME/shell/"
|
||||
done
|
||||
Reference in New Issue
Block a user