Upgrade to Pro — share decks privately, control downloads, hide ads and more …

黒画面が最高のしごと道具である3つの理由

 黒画面が最高のしごと道具である3つの理由

Toshikazu Ohashi

February 17, 2023
Tweet

More Decks by Toshikazu Ohashi

Other Decks in Programming

Transcript

  1. ࠇը໘͕࠷ߴͷ࢓ࣄಓ۩Ͱ͋Δ


    3ͭͷཧ༝
    backo
    ff
    ice lt/Toshikazu.Ohashi

    View full-size slide

  2. ΞδΣϯμ
    1. ૢ࡞ͷ࠶ݱ౓͕ߴ͍


    2. ύΠϓͰڊਓͷݞʹ৐ΕΔ


    3. ແ͍ͳΒ࡞ΕΔ؆୯ʹ

    View full-size slide

  3. 1.ૢ࡞ͷ࠶ݱੑ͕ߴ͍

    View full-size slide

  4. ࠇը໘Λ࢖͍࢝Ίͨਓ͕ݴ͏ϫʔυ
    ίϚϯυͳΜ͍͍֮ͯͪͪ͑ͯΒΕͳ͍Α

    View full-size slide

  5. Ohashiᐌ͘
    ࡉ͔͍ίϚϯυ͍͍֮ͪͪ͑ͯͳ͍Ͱ͢

    View full-size slide

  6. ࠇը໘ʹ͓͚Δૢ࡞ͱ͸ʁ
    • ࠇը໘Ͱߦ͏ૢ࡞͸͢΂ͯίϚϯυ


    • ίϚϯυʹจࣈྻ


    • จࣈྻʹ؆୯ʹอଘͰ͖Δ


    • ؆୯ʹอଘͰ͖Δʹ؆୯ʹ࠶ݱͰ͖Δ

    View full-size slide

  7. ໰୊
    GitϦϙδτϦͷαϒϞδϡʔϧͷόʔδϣϯΛϦϞʔτͱҰகͤ͞Αɻ


    ͳ͓αϒϞδϡʔϧ಺ͷαϒϞδϡʔϧ΋ର৅ͱ͢Δɻ


    • ౴͑


    • git submodule update --init --recursive --remote


    • σϞ

    View full-size slide

  8. ࠇը໘ͷૢ࡞͸͢΂ͯ࠶ݱͰ͖Δ
    • ٯʹ͍͑͹GUIͷૢ࡞͸࠶ݱͰ͖ͳ͍


    • աڈͷૢ࡞͸͢΂ͯཤྺϑΝΠϧʹ͋Δ


    • zshͳΒ.zsh_history


    • bashͳΒ.bash_history


    • աڈͷૢ࡞͸͢΂ͯCtrl-PͱCtrl-NͰݟΕΔ

    View full-size slide

  9. ޻෉̍ લํҰக
    autoload history-search-end


    zle -N history-beginning-search-backward-end history-search-end


    zle -N history-beginning-search-forward-end history-search-end


    bindkey "^P" history-beginning-search-backward-end


    bindkey "^N" history-beginning-search-forward-end


    View full-size slide

  10. ޻෉2 αδΣετ
    • zsh-autosuggestions


    • https://github.com/zsh-users/zsh-autosuggestions

    View full-size slide

  11. 2.ύΠϓͰڊਓͷํʹ৐ΕΔ

    View full-size slide

  12. VimΛ਺೥࢖͍ଓ͚ͨਓ͕ݴ͏ϫʔυ
    ςΩετฤू͢Δͱ͖VimҎ֎Λ࢖͏ͷͬͯ


    ۤ௧Ͱ͔͠ͳ͍ΜͰ͢Α

    View full-size slide

  13. ίϚϯυͷ࣮ߦ݁Ռͱ͸ʁ
    • ίϚϯυͷ݁Ռ͸͓͓ΑͦจࣈྻʹͳΔ


    • จࣈྻʹ؆୯ʹଞͷίϚϯυʹ౉ͤΔ


    • ؆୯ʹଞͷίϚϯυʹ౉ͤΔʹՄೳੑͷ्(Ϣχίʔϯ)

    View full-size slide

  14. Vimͷ۩ମྫ
    • git commitͨ͠ͱ͖


    • γΣϧ্ͷϫϯϥΠϯΤσΟλͰฤू͍ͨ͠ͱ͖

    View full-size slide

  15. ΠϯλϥΫςΟϒϑΟϧλʔ
    fzf
    • fzf


    • https://github.com/junegunn/fzf


    • ԿͰ΋ΠϯλϥΫςΟϒʹϑΟϧλʔͰ͖Δ͍͢͝΍ͭ


    • GitϦϙδτϦҰཡ͔ΒͷҠಈ


    • GitϒϥϯνҰཡ͔Βͷ੾Γସ͑


    • σΟϨΫτϦ֊૚Ұׅද͔ࣔΒͷҠಈ

    View full-size slide

  16. ΤΠϦΞεఆٛ
    cd-fzf-
    f
    ind() {


    local dir


    DIR=$(
    f
    ind ./ -path '*/\.*' -name .git -prune -o -type d -print 2> /dev/null | fzf +m --ansi --
    preview 'ls -al --color=always {}')


    if [ -n "$DIR" ]; then


    cd $DIR


    f
    i


    }


    alias fd=cd-fzf-
    f
    ind


    View full-size slide

  17. 3.ແ͍ͳΒ࡞ΕΔ؆୯ʹ

    View full-size slide

  18. ͍ͭ·Ͱܦͬͯ΋ࣗ෼͕΄͍͠


    ίϚϯυ͕࡞ΒΕͳ͍ਓ͕ݴ͏ϫʔυ
    ࣗ෼͕ཉ͍͠ίϚϯυ͕ͳ͍ͳΒ࡞Ε͹͍͍

    View full-size slide

  19. ͍͍ͩͨͷίϚϯυ͸୳ͤ͹͋Δ͚Ͳ
    • ͍͍ͩͨͷ΋ͷ͸طଘͷίϚϯυΛύΠϓͰͭͳ͗߹ΘͤΔͱ࡞ΕΔ


    • CLIͰ΍Γ͍ͨ͜ͱΛ΍Δͱ͖ͷ̏εςοϓ


    1. ࣗ෼ͷ΍Γ͍ͨ͜ͱΛ΍ͬͯ͘ΕΔίϚϯυΛ୳͢


    2. طଘͷίϚϯυΛύΠϓͰͭͳ͗߹ΘͤͯɺίϚϯυΛ࡞Δ


    3. ࣗ෼ͰίϚϯυΛ࡞Δ

    View full-size slide

  20. ೔ใΛVimͰॻ͖͍ͨ
    • liary


    • https://github.com/lighttiger2505/liary

    View full-size slide

  21. ࠇը໘ͰDB઀ଓΛ؅ཧ͍ͨ͠
    • mcm


    • https://github.com/lighttiger2505/mcm

    View full-size slide

  22. ࠇը໘ͷίϚϯυ͸࡞Δͷ௒؆୯
    • UI͕จࣈྻ͚ͩͳͷͰUIσβΠϯΛߟ͑Δίετ͕θϩ


    • ୯ػೳͰܗʹͳΔͷͰεϞʔϧελʔτ͠΍͍͢


    • Ҡ২ੑ͕ਆϨϕϧʹߴ͍


    • 10೥࢖͑Δ

    View full-size slide