Skip to content

Commit

Permalink
Update todoist_functions_fzf.sh
Browse files Browse the repository at this point in the history
add --ansi option to fzf will solve color and styling related issues like sachaos#243
  • Loading branch information
ronscho authored Jul 24, 2024
1 parent 7d31f4b commit 944b2f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions todoist_functions_fzf.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
select_items_command="todoist --namespace --project-namespace list | fzf | cut -d ' ' -f 1 | tr '\n' ' '"
select_items_command="todoist --namespace --project-namespace list | fzf --ansi | cut -d ' ' -f 1 | tr '\n' ' '"

function insert-in-buffer () {
if [ -n "$1" ]; then
Expand All @@ -25,15 +25,15 @@ bindkey "^xtt" fzf-todoist-item

# todoist find project
function fzf-todoist-project () {
local SELECTED_PROJECT="$(todoist --project-namespace projects | fzf | head -n1 | cut -d ' ' -f 1)"
local SELECTED_PROJECT="$(todoist --project-namespace projects | fzf --ansi | head -n1 | cut -d ' ' -f 1)"
insert-in-buffer "${SELECTED_PROJECT}" "-P"
}
zle -N fzf-todoist-project
bindkey "^xtp" fzf-todoist-project

# todoist find labels
function fzf-todoist-labels () {
local SELECTED_LABELS="$(todoist labels | fzf | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
local SELECTED_LABELS="$(todoist labels | fzf --ansi | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
insert-in-buffer "${SELECTED_LABELS}" "-L"
}
zle -N fzf-todoist-labels
Expand All @@ -50,7 +50,7 @@ function fzf-todoist-date () {
OPTION="-d # day"
fi

local SELECTED_DATE="$(seq 0 30 | xargs -I# date $OPTION '+%d/%m/%Y %a' | fzf | cut -d ' ' -f 1)"
local SELECTED_DATE="$(seq 0 30 | xargs -I# date $OPTION '+%d/%m/%Y %a' | fzf --ansi | cut -d ' ' -f 1)"
insert-in-buffer "'${SELECTED_DATE}'" "-d"
}
zle -N fzf-todoist-date
Expand Down

0 comments on commit 944b2f1

Please sign in to comment.