Add a pandoc compile script

This commit is contained in:
FollieHiyuki 2021-03-16 02:37:35 +03:00
parent e0a3568cb5
commit 8b9c2a2d30
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
7 changed files with 67 additions and 47 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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
View 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"