From a91a3d393217a6e45f83635f402ac22dd0909df3 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Mon, 30 May 2022 16:44:20 +0200 Subject: [PATCH] fd also should check for a local config. Plus some cleaning. --- install.sh | 5 ++--- zsh/.zshrc | 2 -- zsh/aliases.zsh | 18 ++++++++++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index a5e1641..8bc0b51 100644 --- a/install.sh +++ b/install.sh @@ -1,9 +1,9 @@ #!/bin/sh # clean + prepare local dirs -rm -rf ~/.cache /tmp/${USER}-cache ~/.config/_cache +rm -rf ~/.cache ~/.config/_cache /tmp/${USER}-cache rm -rf ~/.fdignore ~/.fzf.bash ~/.fzf.zsh ~/.gitconfig ~/.gitignore ~/.history ~/.tmux.conf ~/.vim* ~/.zcomp* ~/.zsh* -mkdir -p /tmp/${USER}-cache/ ~/.config ~/.local/bin ~/.local/share ~/.local/config +mkdir -p /tmp/${USER}-cache/ ~/.config ~/.local/bin ~/.local/share chmod 700 /tmp/${USER}-cache # prepare global variables @@ -29,7 +29,6 @@ ln -sf $XDG_DATA_HOME/repos/dotfiles/nvim ~/.config/ ## fdignore rm -rf ~/.config/fd ln -sf $XDG_DATA_HOME/repos/dotfiles/fd ~/.config/ -touch ~/.local/config/fd ## tmux rm -rf ~/.config/tmux diff --git a/zsh/.zshrc b/zsh/.zshrc index c43ba65..243ab3d 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -10,8 +10,6 @@ setopt HIST_REDUCE_BLANKS setopt SHARE_HISTORY export PATH=~/.local/bin:$PATH -export EDITOR=nvim -export MANPAGER="nvim +Man!" tabs 2 mkdir -p $XDG_DATA_HOME/zsh diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index d044ca7..2bd4d53 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -10,9 +10,23 @@ else esac alias ll='ls -l' fi + [ $(command -v bat) ] && alias cat='bat -pp --color=always --tabs=2 --theme=Monokai\ Extended\ Bright' -[ $(command -v fd) ] && alias fd='fd -H -L --ignore-file ~/.local/config/fd' -[ $(command -v nvim) ] && alias vim=nvim && alias vimdiff="nvim -d" + +if [ $(command -v fd) ]; then + [ -f ~/.local/config/fd ] && alias fd='fd -H -L --ignore-file ~/.local/config/fd' || alias fd='fd -H -L' +fi + +if [ $(command -v nvim) ]; then + export EDITOR=nvim + export MANPAGER="nvim +Man!" + alias vim=nvim + alias vimdiff="nvim -d" +elif [ $(command -v vim) ] ; then + export EDITOR=vim +else + export EDITOR=vi +fi function ud() { wd dots && git pull