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

作ってわかる現代のVimのAutoComplete ~そしてVimConf2019へ~

作ってわかる現代のVimのAutoComplete ~そしてVimConf2019へ~

Toshikazu Ohashi

October 24, 2019
Tweet

More Decks by Toshikazu Ohashi

Other Decks in Programming

Transcript

  1. ࡞ͬͯΘ͔Δ ݱ୅ͷVimͷAutoComplete ~ͦͯ͠VimConf2019΁~ gorilla.vim #9 @lighttiger2505

  2. ࣗݾ঺հ • lighttiger2505(Toshikazu Ohashi) • αʔόαΠυΤϯδχΞ@iRidge • Vimྺ3೥͘Β͍ • झຯ

    • CLIίϚϯυͱVim͍͡Γ
  3. AutoCompleteͯ͠·͔͢ʁ

  4. AutoComplete͕ Ͳ͏ಈ͘ͷ͔ؾʹͳͬͯ ໷΋຾Ε·ͤΜ͔ʁ

  5. ΞδΣϯμ • [ΠϯτϩμΫγϣϯ] Auto Completeͱ͸ʁ • Auto CompleteΛ࡞ͬͯΈΑ͏ • ݱ୅ͷVimͷAuto

    Completeͱ͸ • એ఻
  6. AutoCompleteͱ͸ʁ

  7. AutoCompleteͱ͸ • Ϣʔβ͕ΤσΟλʹೖྗͨ͠಺༰ʹԠͯ͡ Ϛον͢ΔީิΛҰཡදࣔ͠ɺೖྗΛิॿ͢ Δػೳ

  8. ͳ͓Vimʹ͸(खಈ)ิ׬͕͋Δ • `:help ins-completion` • `CTRL-X`Λى఺ʹ༷ʑͳछྨͷิ׬͕͋Δ • ϑΝΠϧ಺ͷΩʔϫʔυิ׬ • ΦϜχิ׬

  9. VimConf2018Ͱൃද͞Εͨ ࢀߟʹͳΔεϥΠυ • https://speakerdeck.com/daisuzu/migrating- plugins-to-standard-features

  10. VimͷAutoComplete͸ ϓϥάΠϯʹΑ࣮ͬͯݱ • ϓϥάΠϯͰ࣮ݱͰ͖Δͱ͍͏͜ͱ͸ • Πίʔϧࣗ෼Ͱ࡞ΕΔ • ࡞ͬͯΈΑ͏

  11. AutoCompleteΛ ࡞ͬͯΈΑ͏

  12. ຊεςοϓͷΰʔϧ • lookcomplete.nvim

  13. શ̒εςοϓͰ࡞੒ 1. ࠷খͷิ׬ 2. ิ׬ͷڍಈΛௐ੔ 3. ࣗಈͰิ׬ 4. ӳ୯ޠΛิ׬ 5.

    ඇಉظͰิ׬ީิΛऔಘ 6. ίʔϧόοΫͷνΣοΫ
  14. ຊσϞͰར༻͢Δίʔυ • GitHubͰެ։͞Ε͍ͯ·͢ • https://github.com/lighttiger2505/ lookcomplete.nvim

  15. 1. ࠷খͷิ׬ • `:help complete` • ૊ࠐΈؔ਺Ͱิ׬ީิΛදࣔ

  16. 2. ิ׬ͷڍಈΛௐ੔ • F5Λ͓ͨ͠ॠؒʹิ׬ީิ͕Πϯαʔτ • `:help completeopt`Λมߋ • ೖྗࡁΈ಺༰ʹॏෳͯ͠ૠೖ •

    `complete`ͷ`startcol`Λࢦఆ
  17. 3. ࣗಈͰิ׬ • `TextChangedI`͝ͱʹpumΛߋ৽ • `InsertEnter/Leave`ͰΧʔιϧߦΛอ࣋ • ΠϯαʔτϞʔυʹͳͬͨॠؒʹදࣔ͞ΕΔ • ೖྗ͕ͳ͍৔߹ʹީิදࣔΛແޮԽ

  18. 4. ӳ୯ޠΛิ׬ • lookίϚϯυ

  19. 5. ඇಉظͰิ׬ީิΛऔಘ • lookίϚϯυ࣮ߦதVim͕ϒϩοΫ • `:help jobstart(in NeoVim)`

  20. 6. ίʔϧόοΫͷνΣοΫ • lookίϚϯυ͕஗͔ͬͨ৔߹͓͔͠ͳڍಈ • lookίϚϯυͷίʔϧͨ͠ঢ়گ(Context)ͱ ิ׬දࣔͷঢ়گͱҰகͨ͠ͱ͖͚ͩදࣔ

  21. ࡞ͬͯΘ͔ͬͨAutoComplete • ΤσΟλͷ֩Ͱ͋ΔςΩετมߋΛϑοΫ͢ ΔͷͰɺ΋ͷ͘͢͝ؾΛ͔ͭ͏ • Ϣʔβ͕৺஍ྑ͍λΠϛϯάͰิ׬Λग़͢ • ࡉ͔͍ௐ੔/νΣοΫॲཧ͕ෆՄܽ

  22. ࡞ͬͯΘ͔ͬͨAutoComplete • ςΩετฤूΛϒϩοΫͯ͠͸ͳΒͳ͍ • ߴ଎ॲཧɺඇಉظॲཧ͕ඞਢ

  23. ݱ୅ͷVimͷ AutoCompleteͱ͸

  24. Αࣗ͠෼΋AutoComplete ϓϥΪϯΛ࡞Ζ͏ʂ • ͪΐͬͱ·ͬͯ • ଞͷAutoCompleteͱׯব • ϓϥάΠϯ͝ͱʹॏෳͨ͠ॲཧ • VimͷΠϕϯτϑοΫ/ίϯςΩετऔಘ/֤छνΣοΫ

    • ඇಉظιʔεऔಘͷࠔ೉͞ • VimͱNeoVimͷ྆ରԠ͸ͭΒͦ͏...
  25. Completion Manager • ΠϕϯττϥοΩϯά͔Βิ׬ιʔεऔಘɺ ϙοϓΞοϓ੍ޚͳͲΛߦ͏ิ׬ϑϨʔϜϫʔ Ϋ

  26. Completion Manager • ίΞͷิ׬ػೳͱิ׬ιʔεΛΠϯλϑΣʔ εܦ༝Ͱૄ݁߹ʹ • ิ׬ιʔεΛϓϥάΠϯՄೳ͔ͭݸผ։ൃ͕ Մೳ • ิ׬ιʔε։ൃऀ͸ΠϯλϑΣʔεʹै͑

    ͹ൺֱత؆୯ʹߴ଎ͳิ׬ͷԸܙΛड͚Δ
  27. Completion Managerͷߏ੒ $PNQMFUJPO.BOBHFS 4PVSDF ΠϕϯττϥοΩϯά ิ׬ιʔεґཔ ิ׬ީิදࣔ ิ׬ιʔεऔಘ ิ׬ιʔε ίʔϧόοΫ

    BTZOD DUY
  28. ۩ମྫ • deoplete.nvim • https://github.com/Shougo/deoplete.nvim/wiki/Completion- Sources • asyncomplete.vim • https://github.com/prabirshrestha/

    asyncomplete.vim#sources • coc.nvim • https://github.com/neoclide/coc.nvim#completion-sources
  29. Completion ManagerͰ շదͳੜ׆Λ

  30. એ఻

  31. 2019/11/03

  32. None
  33. Keynote speaker • Prabir Shrestha • asyncomplete.vim • lookcomplete.nvim͸΄΅͜Εͷ؆қ൛ •

    async.vim • vim-lsp
  34. Speaker • Shougo(҉ࠇඒແԦ) • deoplete.nvim • Completion Manager࠷ڧͷ֦ுੑ • ϦϞʔτϓϥάΠϯͷ୅ද֨

  35. Keynote speaker • Justin M. Keyes • NeoVim • Ϧʔυϝϯςφʔ

  36. Lightning Talk • lighttiger2505 • deoplete-vim-lsp • deoplete.vimͱvim-lspʹ͓ΜͿʹͩͬ͜

  37. Let's enjoy VimConf2019