Skip to content

Deterministic colorization for strings e.g. file paths

Notifications You must be signed in to change notification settings

FilipHarald/rstrt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rstrt

Installation

Build from source

Requires Rust.

git clone [email protected]:FilipHarald/rstrt.git
cd rstrt
cargo build --release
cp ./target/release/rstrt $HOME/bin/rstrt

($HOME/bin needs to be in your PATH)

Usage

bash-prompt

Use this in your .bashrc.

promptFunc() {
  if [[ -x $(realpath "$HOME/bin/rstrt") ]]
  then
    WD=`pwd | $HOME/bin/rstrt --ps1-escape`
    COLORIZED_DIR=`echo "${WD}" | awk -F/ '{print $NF}'`
    PS1="\`echo -e \"\[\a\]\[\033[01;32m\]\h\[\033[01;34m\] ${COLORIZED_DIR} \$ \"\`"
  else
    PS1='\[\a\]\[\033[01;32m\]\h\[\033[01;34m\] \W \$ \[\033[00m\]'
  fi
}
PROMPT_COMMAND="promptFunc"

listing files

find ~/* | rstrt

with fzf

find ~/* | rstrt | fzf --ansi

with fzf in nvim

let cwd = getcwd()
let $FZF_DEFAULT_COMMAND =  'find '.cwd.' -type f | rstrt'
let $FZF_DEFAULT_OPTS = '--ansi'

statusline in nvim

rstrt.nvim

About

Deterministic colorization for strings e.g. file paths

Resources

Stars

Watchers

Forks

Languages