mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-28 18:28:35 -05:00
Add a pandoc compile script
This commit is contained in:
parent
e0a3568cb5
commit
8b9c2a2d30
@ -396,7 +396,7 @@ alias ncdu="ncdu --color=dark"
|
||||
alias ip="ip -color=always"
|
||||
# vim
|
||||
alias v="nvim"
|
||||
alias vi='nvim -o "$(fzf)"'
|
||||
alias vi='fzf | xargs nvim -o'
|
||||
# emacs
|
||||
alias doom="$HOME/.config/emacs/bin/doom"
|
||||
alias e="emacs -nw"
|
||||
|
@ -29,7 +29,7 @@ alias ncdu='ncdu --color=dark'
|
||||
alias ip='ip -color=always'
|
||||
# vim
|
||||
abbr v nvim
|
||||
abbr vi 'nvim -o (fzf)'
|
||||
abbr vi 'fzf | xargs nvim -o'
|
||||
# emacs
|
||||
alias doom='$HOME/.config/emacs/bin/doom'
|
||||
abbr e 'emacs -nw'
|
||||
@ -43,8 +43,49 @@ abbr youflac 'youtube-dl --extract-audio --audio-format flac'
|
||||
abbr youbest 'youtube-dl -f bestvideo+bestaudio'
|
||||
abbr youlist 'youtube-dl -f bestvideo+bestaudio --yes-playlist'
|
||||
# nnn
|
||||
abbr nnn 'nnn -Hc'
|
||||
alias ncp="cat $XDG_CONFIG_HOME/nnn/.selection | tr '\0' '\n'"
|
||||
if command -v nnn >/dev/null
|
||||
abbr nnn 'nnn -Hc'
|
||||
alias ncp="cat $XDG_CONFIG_HOME/nnn/.selection | tr '\0' '\n'"
|
||||
|
||||
function n --wraps nnn --description 'support nnn quit and change directory'
|
||||
# Block nesting of nnn in subshells
|
||||
if test -n "$NNNLVL"
|
||||
if [ (expr $NNNLVL + 0) -ge 1 ]
|
||||
echo "nnn is already running"
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||
# To cd on quit only on ^G, remove the "-x" as in:
|
||||
# set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
||||
if test -n "$XDG_CONFIG_HOME"
|
||||
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||
else
|
||||
set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
|
||||
end
|
||||
|
||||
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
||||
# stty start undef
|
||||
# stty stop undef
|
||||
# stty lwrap undef
|
||||
# stty lnext undef
|
||||
|
||||
nnn $argv
|
||||
|
||||
if test -e $NNN_TMPFILE
|
||||
source $NNN_TMPFILE
|
||||
rm $NNN_TMPFILE
|
||||
end
|
||||
end
|
||||
|
||||
function n2 -d "Start nnn in dual pane (tmux)"
|
||||
tmux new-session -d -s nnn -n nnn "nnn -Hc"
|
||||
tmux split-window -h "nnn -Hc"
|
||||
TERM=screen-256color command tmux attach -t nnn:nnn
|
||||
end
|
||||
end
|
||||
|
||||
# Lazy cd-ing
|
||||
function .. ; cd .. ; end
|
||||
|
@ -1,36 +0,0 @@
|
||||
# Rename this file to match the name of the function
|
||||
# e.g. ~/.config/fish/functions/n.fish
|
||||
# or, add the lines to the 'config.fish' file.
|
||||
|
||||
function n --wraps nnn --description 'support nnn quit and change directory'
|
||||
# Block nesting of nnn in subshells
|
||||
if test -n "$NNNLVL"
|
||||
if [ (expr $NNNLVL + 0) -ge 1 ]
|
||||
echo "nnn is already running"
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||
# To cd on quit only on ^G, remove the "-x" as in:
|
||||
# set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
||||
if test -n "$XDG_CONFIG_HOME"
|
||||
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||
else
|
||||
set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
|
||||
end
|
||||
|
||||
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
||||
# stty start undef
|
||||
# stty stop undef
|
||||
# stty lwrap undef
|
||||
# stty lnext undef
|
||||
|
||||
nnn $argv
|
||||
|
||||
if test -e $NNN_TMPFILE
|
||||
source $NNN_TMPFILE
|
||||
rm $NNN_TMPFILE
|
||||
end
|
||||
end
|
@ -1,5 +0,0 @@
|
||||
function n2 -d "Start nnn in dual pane (tmux)"
|
||||
tmux new-session -d -s nnn -n nnn "nnn -Hc"
|
||||
tmux split-window -h "nnn -Hc"
|
||||
TERM=screen-256color command tmux attach -t nnn:nnn
|
||||
end
|
@ -23,7 +23,7 @@ alias ncdu="ncdu --color=dark"
|
||||
alias ip="ip -color=always"
|
||||
# vim
|
||||
alias v="nvim"
|
||||
alias vi='nvim -o "$(fzf)"'
|
||||
alias vi='fzf | xargs nvim -o'
|
||||
# emacs
|
||||
alias doom="$HOME/.config/emacs/bin/doom"
|
||||
alias e="emacs -nw"
|
||||
|
@ -5,7 +5,7 @@ mimetype=$(file -b --mime-type "$selected")
|
||||
|
||||
case "$mimetype" in
|
||||
*.doc|*.docx|*.odt|*.ott|*.xls|*.xlsx|*.xlsmx|*.ods|*.odp|*.sxc|*.ppt|*.pptx) libreoffice "$selected" & ;;
|
||||
*.pdf) zathura "$selected" & ;;
|
||||
*.pdf|*.cbz|*.cbr|*.cbt|*.cba|*.djvu) zathura "$selected" & ;;
|
||||
text/* | */xml) $EDITOR "$selected" ;;
|
||||
*) xdg-open "$selected" >/dev/null 2>&1 & ;;
|
||||
esac
|
||||
|
20
home/.local/bin/pancomp
Executable file
20
home/.local/bin/pancomp
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "-h" ]; then
|
||||
echo "Usage: pancomp [input_format] [input_file] [output_format] [output_file]"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -ne 4 ]; then
|
||||
echo "Bruh, I need 4 arguments."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pandoc \
|
||||
--pdf-engine=xelatex \
|
||||
-V 'mainfont:Iosevka Slab' \
|
||||
-V 'sansfont:Iosevka Aile' \
|
||||
-V 'monofont:Iosevka' \
|
||||
-V 'geometry:margin=1in' \
|
||||
-f "$1" -t "$3" \
|
||||
-o "$4" "$2"
|
Loading…
Reference in New Issue
Block a user