Compare commits
2 Commits
82ca9fa328
...
6d448e865e
Author | SHA1 | Date | |
---|---|---|---|
6d448e865e | |||
cf9d94351f |
40
home-manager/modules/scripts/pblog
Executable file
40
home-manager/modules/scripts/pblog
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
cd "$SECOND_BRAIN"/blog || exit 1
|
||||||
|
nvim
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
open_file() {
|
||||||
|
cd "$SECOND_BRAIN"/blog || exit 1
|
||||||
|
nvim "${1}.md"
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_file() {
|
||||||
|
cd "$SECOND_BRAIN"/blog || exit 1
|
||||||
|
if [ -f "${1}.md" ]; then
|
||||||
|
rm "${1}.md"
|
||||||
|
else
|
||||||
|
echo "File didn't exist"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
echo "You need to provide action and file name."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
edit)
|
||||||
|
open_file "$2"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
rm)
|
||||||
|
remove_file "$2"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
@ -6,7 +6,13 @@
|
|||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
history.path = "${config.xdg.dataHome}/zsh/history";
|
history.path = "${config.xdg.dataHome}/zsh/history";
|
||||||
dotDir = ".config/zsh";
|
dotDir = ".config/zsh";
|
||||||
shellAliases = { lg = "lazygit"; };
|
shellAliases = {
|
||||||
|
lg = "lazygit";
|
||||||
|
j =
|
||||||
|
"cd $(zoxide query --list | fzf --prompt 'Directory: ' -i --reverse --layout=reverse --border=rounded --info=inline --preview 'eza -A --tree -L 1 {}')";
|
||||||
|
gj = ''
|
||||||
|
cd $(find ${config.home.homeDirectory} -name .git -type d -exec dirname {} \; -prune | fzf --prompt "Directory: " -i --reverse --layout=reverse --border=rounded --info=inline --preview "eza -A --tree -L 1 {}")'';
|
||||||
|
};
|
||||||
envExtra = ''
|
envExtra = ''
|
||||||
# NNN settings
|
# NNN settings
|
||||||
export NNN_FIFO="/tmp/nnn.fifo"
|
export NNN_FIFO="/tmp/nnn.fifo"
|
||||||
|
Loading…
Reference in New Issue
Block a user