-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_bashrc
More file actions
44 lines (36 loc) · 1.45 KB
/
dot_bashrc
File metadata and controls
44 lines (36 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
export EDITOR='nvim'
export BAT_THEME="gruvbox-dark"
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_DEFAULT_OPTS='--preview "bat --style=numbers --color=always {}"'
export GOROOT=$(brew --prefix go)/libexec
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH
export PATH="$PATH:$HOME/.local/bin"
export PATH="$PATH:/opt/mssql-tools18/bin"
eval "$(starship init bash)"
# Fabric
# Define the base directory for Obsidian notes
obsidian_base="/Users/n3ddu8/Library/Mobile Documents/iCloud~md~obsidian/Documents/n3ddu8/0 - Inbox/0 - Fabric"
# Loop through all files in the ~/.config/fabric/patterns directory
for pattern_file in ~/.config/fabric/patterns/*; do
# Get the base name of the file (i.e., remove the directory path)
pattern_name=$(basename "$pattern_file")
# Remove any existing alias with the same name
unalias "$pattern_name" 2>/dev/null
# Define a function dynamically for each pattern
eval "
$pattern_name() {
local title=\$1
local date_stamp=\$(date +'%Y-%m-%d')
local output_path=\"\$obsidian_base/\${date_stamp}-\${title}.md\"
# Check if a title was provided
if [ -n \"\$title\" ]; then
# If a title is provided, use the output path
fabric --pattern \"$pattern_name\" -o \"\$output_path\"
else
# If no title is provided, use --stream
fabric --pattern \"$pattern_name\" --stream
fi
}
"
done