-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic configuration of bash and zellij
- Loading branch information
1 parent
6d29dd7
commit e77444c
Showing
3 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ pkgs, config, ...}: | ||
|
||
{ | ||
programs.bash = { | ||
enable = true; | ||
|
||
shellAliases = { | ||
# Basic | ||
l = "ls -Alh --color=auto"; | ||
".." = "cd .."; | ||
"..." = "cd ..."; | ||
|
||
# Fast scroll back buffer clearing, like `clear` | ||
rst = "tput reset"; | ||
}; | ||
|
||
initExtra = '' | ||
# Create every dir along the path and cd to the path | ||
mkcd() { | ||
mkdir -p "$@" && cd "$_" | ||
} | ||
# cd up a number of directories | ||
up() { | ||
local d="" | ||
local limit="$1" | ||
# Default to limit of 1 | ||
if [ -z "$limit" ] || [ "$limit" -le 0 ]; then | ||
limit=1 | ||
fi | ||
for ((i=1;i<=limit;i++)); do | ||
d="../$d" | ||
done | ||
# perform cd. Show error if cd fails | ||
if ! cd "$d"; then | ||
echo "Can't move up $limit directories."; | ||
fi | ||
} | ||
''; | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
programs.zellij = { | ||
enable = true; | ||
enableBashIntegration = true; | ||
}; | ||
} |