Skip to content

Commit

Permalink
Feat(powershell): add head,nvp utils;update FZFcmd
Browse files Browse the repository at this point in the history
tags:
    fzf, bat, truecolors, git-utils, head
  • Loading branch information
PrashanthaTP committed Dec 4, 2021
1 parent c5ad0ed commit 78823a0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@ function cd_proj_dir{
cd $env:PROJ_DIR
}
set-alias -name cdp -value cd_proj_dir
$env:FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --no-ignore-vcs'

<#
# TRUE colors with COLORTERM option for bat
# Discussions related to True colors
# - https://github.com/junegunn/fzf.vim/issues/1179
# - https://github.com/macvim-dev/macvim/issues/1177
# - https://github.com/sharkdp/bat/issues/634
##>
$env:FZF_DEFAULT_COMMAND = 'COLORTERM=truecolor rg --files --hidden --follow --ignore-vcs'

$env:FZF_DEFAULT_OPTS='--height 40% --layout=reverse --ansi --border --preview "bat --color=always {1}"'

function open_wiki{
Expand All @@ -70,6 +79,9 @@ function open_wiki{

nvim $(& $cmd $dir -type f -name '\*.md' -not -path '\*/.git/\*'| fzf)
}
function nvp{
nvim $PROFILE
}
###########################################################
# FZY
#set-alias -name fzy -value $env:ProgramFiles/Git/usr/bin/fzy.exe
Expand All @@ -96,6 +108,10 @@ function lsg{
run_git_utility "ls" $args
}

function head{
run_git_utility "head" $args
}

function grep{
run_git_utility "grep" $args
}
Expand Down

0 comments on commit 78823a0

Please sign in to comment.