.bashrc added FZF
[dotfiles/.git] / .bashrc
diff --git a/.bashrc b/.bashrc
index 9d92077ac12424bb4b4088eaf32d38abc0fc95a5..d7f9406bc330a0ffd8040e824dea416baac65c91 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -2,7 +2,7 @@
 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
 # for examples
 export EDITOR=vim;
-export VISUAL=vim; #Nano is the main editor
+export VISUAL=nvim; #Nano is the main editor
 # If not running interactively, don't do anything
 case $- in
     *i*) ;;
@@ -33,13 +33,13 @@ shopt -s checkwinsize
 
 
 # If this is an xterm set the title to user@host:dir
-case "$TERM" in
-xterm*|rxvt*|alacritty)
-    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
-    ;;
-*)
-    ;;
-esac
+#case "$TERM" in
+#xterm*|rxvt*|alacritty)
+    #PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
+    #;;
+#*)
+    #;;
+#esac
 
 # enable color support of ls and also add handy aliases
 if [ -x /usr/bin/dircolors ]; then
@@ -99,16 +99,33 @@ alias ccat='highlight --out-format=ansi'
 # activates the autocd mode
 shopt -s autocd
 # wifi available
-alias wifi='nmcli d wifi'
-# personalized ps1
-export PS1="\[\033[38;5;247m\][\$?]\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;40m\]\u@\h\[$(tput sgr0)\]:\[$(tput sgr0)\]\[\033[38;5;45m\]\w\[$(tput sgr0)\]\n\\$\[$(tput sgr0)\]"
+alias wifi='nmcli d wifi';
+edit () { du -a -L "$1" | awk '{print $2}' | fzf | xargs -r "$VISUAL" ;}
+# personalized ps1 #################################################################################
+# .bashrc (or .bash_profile)
+
+# declares an array with the emojis we want to support
+EMOJIS=(👻 💀 👽 👾 🎃 😎 🧠 🦘 🦍 🎻)
+
+# selects a random element from the EMOJIS set
+SELECTED_EMOJI=${EMOJIS[$RANDOM % ${#EMOJIS[@]}]};
+# declare the terminal prompt format
+#export PS1='${SELECTED_EMOJI}  [\u@\h \W]$ '
+#export PS1="\e[1;90m[\$?]\e[m\e[1;92m\[$(tput bold)\]\u@\h\e[m\[$(tput sgr0)\]:\e[0;36m\w\e[m\n\\$";
+export PS1="\e[1;90m[\$?]\e[m\e[1;92m\[$(tput bold)\]\u@\h\e[m\[$(tput sgr0)\]:\e[0;36m\w\e[m\n${SELECTED_EMOJI}";
+
+
+####################################################################################################
+
+cat ~/.cache/wal/sequences & #This imports the theme from the last pywal
+
+
+#export PS1="\[\033[38;5;247m\][\$?]\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;40m\]\u@\h\[$(tput sgr0)\]:\[$(tput sgr0)\]\[\033[38;5;45m\]\w\[$(tput sgr0)\]\n\\$\[$(tput sgr0)\]"
 
 alias autowal='wal --iterative -i /usr/share/backgrounds/ > /dev/null'
 #figlet de mi nombre
 whoami | figlet Josuer08 | lolcat -F 0.25;
 #whoami | figlet Josuer08 | lolcat;
-# agragando el comando gitdotfiles para manejar los dotfiles
-alias gitdotfiles='/usr/bin/git --git-dir=$HOME/Documents/dotfiles/ --work-tree=$HOME';
 
 function cdls() {
     DIR="$*";
@@ -278,3 +295,14 @@ export PATH="$HOME/.gem/ruby/2.7.0/bin:$PATH";
 source /usr/share/bash-completion/bash_completion; #this is just for better completion
 bind 'set show-all-if-ambiguous on';
 bind 'TAB:menu-complete';
+source /usr/share/fzf/completion.bash
+source /usr/share/fzf/key-bindings.bash
+pacget () { pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S ;}
+pacdel () { pacman -Qq | fzf --multi --preview 'pacman -Qi {1}' | xargs -ro sudo pacman -Rns ;}
+#############OK NEXT TIME YOU SEE THIS REMEMBER TO ORGANIZE IN MULTIPLE FILES AND CLEAN
+
+## HERE I'LL EXPORT SOME STUFF TO CLEAN MY HOME DIR
+export GEM_HOME="$XDG_DATA_HOME"/gem;
+export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem;
+export KDEHOME="$XDG_CONFIG_HOME"/kde;
+export MPLAYER_HOME="$XDG_CONFIG_HOME"/mplayer;