From f6fc1d4bdfe1ae5f990bd2220738cc019b5ae541 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Tue, 17 Aug 2021 17:43:30 +0300 Subject: [PATCH] Switch from nvimpager to just nvim as pager --- home/.config/zsh/01-env.zsh | 5 +++-- home/.config/zsh/03-aliases.zsh | 11 ++--------- home/.gitconfig | 4 ++++ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/home/.config/zsh/01-env.zsh b/home/.config/zsh/01-env.zsh index 2658b0d..b7e8540 100644 --- a/home/.config/zsh/01-env.zsh +++ b/home/.config/zsh/01-env.zsh @@ -22,7 +22,7 @@ export FZF_ALT_C_COMMAND='fd -Ht d' export FZF_DEFAULT_OPTS='-m --bind ctrl-a:select-all,ctrl-d:deselect-all,ctrl-t:toggle-all' export FZF_COMPLETION_TRIGGER='**' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" -export FZF_CTRL_T_OPTS='--preview "/usr/bin/cat {} | nvimpager -c "' +export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"' # use lesspipe with less export LESSOPEN="|lesspipe.sh %s" @@ -32,8 +32,9 @@ export DOTREPO="$HOME/git/dotfiles" # nvim ftw! export EDITOR=nvim -export PAGER="nvimpager -p" +export PAGER="sed 's/\x1b\[[0-9;]*m//g' | nvim -R" export AUR_PAGER=$PAGER +export MANPAGER="nvim -c 'set ft=man' -R" # Use GPG for SSH authentication export GPG_TTY="$(tty)" diff --git a/home/.config/zsh/03-aliases.zsh b/home/.config/zsh/03-aliases.zsh index 7341da1..56001b2 100644 --- a/home/.config/zsh/03-aliases.zsh +++ b/home/.config/zsh/03-aliases.zsh @@ -6,15 +6,8 @@ alias gpush='git push' alias mutt='neomutt' -# Syntax highlighting cat if output is a terminal -cat() { - # Check if output is a terminal, else use regular cat - if [ -t 1 ]; then - nvimpager $@ - else - /usr/bin/cat $@ - fi -} +# Syntax highlighting cat +alias cat='bat' rip() { abcde diff --git a/home/.gitconfig b/home/.gitconfig index 7e7a12e..fb3d29c 100644 --- a/home/.gitconfig +++ b/home/.gitconfig @@ -21,6 +21,7 @@ [merge] prompt = false tool = nvim-merge + [mergetool "nvim-merge"] cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' @@ -36,3 +37,6 @@ [alias] mergetest = !git switch test && git pull && git merge --no-ff -m \"Merge $1 features to test\" $1 && git push + +[color] + pager = no