Skip to content

Instantly share code, notes, and snippets.

@soraxas
Created June 5, 2020 14:47
Show Gist options
  • Select an option

  • Save soraxas/00b7e3f8342e81d2b1908e91c0eb2a9d to your computer and use it in GitHub Desktop.

Select an option

Save soraxas/00b7e3f8342e81d2b1908e91c0eb2a9d to your computer and use it in GitHub Desktop.

Revisions

  1. soraxas revised this gist Jun 5, 2020. No changes.
  2. soraxas revised this gist Jun 5, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tldr.fish
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@
    #complete -x -c tldr -a '(__fish_tldr_complete_available_pages)'

    # it is faster to find everything and use a single sed command to replace it to the correct format.
    complete -x -c tldr -a '(printf "%s\n" ~/.local/share/tldr/pages/**/*.md | sed -r "s:^.*/([^/]*)/([^/]*)\.md:\2\t\1:")'
    complete -x -c tldr -a '(printf "%s\n" ~/.local/share/tldr/pages/**/*.md | sed -r "s:^.*/([^/]*)/([^/]*)\.md:\2\t\1:")'
  3. soraxas revised this gist Jun 5, 2020. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion tldr.fish
    Original file line number Diff line number Diff line change
    @@ -1 +1,11 @@
    ‎‎​
    # This is slower, to echo everything one by one.
    #
    # function __fish_tldr_complete_available_pages
    # for f in ~/.local/share/tldr/pages/**/*.md
    # echo (string replace -r '.*/([^/]*)\.md' '$1' $f)
    # end
    # end
    #complete -x -c tldr -a '(__fish_tldr_complete_available_pages)'

    # it is faster to find everything and use a single sed command to replace it to the correct format.
    complete -x -c tldr -a '(printf "%s\n" ~/.local/share/tldr/pages/**/*.md | sed -r "s:^.*/([^/]*)/([^/]*)\.md:\2\t\1:")'
  4. soraxas created this gist Jun 5, 2020.
    1 change: 1 addition & 0 deletions tldr.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​