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

Neovim hearts Ruby

Neovim hearts Ruby

110cd4dcaed019b3bd9809e541afdeb6?s=128

Masafumi Okura

May 13, 2022
Tweet

More Decks by Masafumi Okura

Other Decks in Programming

Transcript

  1. Neovim :hearts: Ruby OKURA Masafumi, Fukuoka.rb 0x100 ճ LT େձ,

    2022-05-11
  2. 100000000ճ։࠵ ͓ΊͰͱ͏͍͟͝·͢ʂʂʂ ʢೋਐ਺ʣ

  3. ࠷ۙͷRubyͷ࿩Λฉ͍͍ͯΔͱ

  4. ͜Μͳ࿩͕ଟ͍Ͱ͢Ͷ • typeprof͕VSCodeʹରԠͨ͠Αʂ • Steep΋ରԠ͍ͯ͠ΔΑʂ • σόοΨ΋VSCode্Ͱಈ͘Αʂ

  5. શ෦VSCode͡ΌΜʂ

  6. ԶͨͪʢVimʣʹ໌೔͸ͳ͍…ʁ

  7. None
  8. Neovimͱ͸ • VimͷϑΥʔΫ • ݱ୅తͳػೳʹ਺ଟ͘ରԠ • VimͷϓϥάΠϯ͸͍͍ͩͨͦͷ··࢖͑Δ • VimͰ࢖͑ΔϓϥάΠϯͷվྑ൛͕LuaͰॻ͔Ε͍ͯΔ͜ͱ͕ଟ͍ •

    ඇৗʹ׆ൃͳ։ൃʢຊମɾϓϥάΠϯͱ΋ʹʣ
  9. ͍͔ͭ͘ͷศརͳϓϥάΠϯΛ͝঺հ

  10. neovim/nvim-lspcon fi g

  11. neovim/nvim-lspcon fi g • LSPʢVSCodeൃ঵ͷิ׬ػೳͱ͔ʹؔ͢ΔϓϩτίϧʣΛ࢖͏ͨΊ ʹ΄΅ඞਢ • ࣄલʹొ࿥͞ΕͨLSPαʔόʔͰ͋Ε͹ɺઃఆϑΝΠϧΛ1ߦॻ͚ͩ͘ ͰNeovimͰ࢖͑ΔΑ͏ʹͳΔ •

    ઌ೔SteepରԠͷύονΛ౤͛ͨʢએ఻ʣ • https://github.com/neovim/nvim-lspcon fi g/pull/1842
  12. nvim-treesitter/nvim-treesitter

  13. nvim-treesitter/nvim-treesitter • TreeSitterͱ͍͏ύʔαʔ͕Neovim͔Β࢖͑ΔΑ͏ʹͳΔ • ૊ΈࠐΈͷϋΠϥΠτΑΓ΋ΧϥϑϧʹͳΔ • ࢹ֮తʹจ๏ཁૉΛ೺ѲͰ͖ΔͷͰศར • ͨͩݱঢ়ɺRubyͰ͸TreeSitterͷΈͩͱΠϯσϯτ͕յΕΔͨΊɺ syntax΋༗ޮʹ͢Δඞཁ͕͋Δ

  14. Before

  15. After

  16. hrsh7th/nvim-cmp

  17. hrsh7th/nvim-cmp • ࣗಈิ׬ϓϥάΠϯͰଟ෼Ұ൪ྑ͘Ͱ͖͍ͯΔ • ιʔεΛ௥Ճ͢Δ͜ͱͰ৭ʑͳީิ͔Βิ׬Ͱ͖Δ • LSP͔Β΋ิ׬͕Մೳ • ίϚϯυϥΠϯ΍ݕࡧ΋ิ׬ର৅ •

    Ruby͸ΤσΟλͷิ׬पΓ͕ऑ͍͕ɺকདྷతʹ͸ܕϕʔεͷิ׬΋༗ ޮʹͰ͖ΔͷͩΖ͏͔
  18. mfussenegger/nvim-dap

  19. mfussenegger/nvim-dap • Debug Adapter Protocol ( https://microsoft.github.io/debug- adapter-protocol/ ) ͕NeovimͰಈ࡞͢ΔΑ͏ʹͳΔ

    • rcarriga/nvim-dap-ui Λ࢖͏͜ͱͰIDEͬΆ͍ϦονͳUI΋࢖͑Δ • suketa/nvim-dap-ruby Λ࢖͑͹debug.gemͱ΋࿈ܞͰ͖Δ • …͸͕ͣͩɺݱ࣌఺Ͱ͸ԿΒ͔ͷཧ༝ʹΑΓ͏·͘ಈ࡞͠ͳ͍
  20. ͓·͚ʢNeovimઐ༻Ͱ͸ͳ͍ͷͰʣ

  21. tpope/vim-rails

  22. tpope/vim-rails • 10೥Ҏ্લ͔Βଘࡏ͢ΔݹయతͳVimϓϥάΠϯ • `:Emodel`ίϚϯυͳͲɺRailsͷߏ੒Λલఏͱͨ͠ίϚϯυମܥ • લड़ͷnvim-cmpͰίϚϯυิ׬͕Ͱ͖Δͷ͕ڧྗͰɺ`:Emodel u`ͱ ೖྗ͢Δ͚ͩͰޙ͸ิ׬ͰUserϞσϧΛ։͘͜ͱ͕Ͱ͖Δ •

    Railsͷ৔߹ɺ”User”Ͱ࢝·ΔϑΝΠϧ͕ଟ͍ͨΊ୯ͳΔϑΝδʔ ϑΝΠϯμʔΑΓ΋༗ޮͳ৔߹͕ଟ͍
  23. ·ͱΊ

  24. NeovimΛRubyͷ։ൃ؀ڥͱͯ͠࢖͏͜ͱ • ద੾ͳϓϥάΠϯΛೖΕͯઃఆ͢Ε͹े෼࢖͑Δ • ٯʹݴ͏ͱɺσϑΥϧτͷঢ়ଶͰ͸ੜ࢈ੑΛߴΊΔͷ͸೉͍͠ • ໽հͳͷ͸ɺ࠷దͳϓϥάΠϯ͸೔ʑมΘ͍ͬͯΔ͜ͱ • ͞Βʹ͍͏ͱׂͱߴ֬཰Ͱಥવಈ࡞͠ͳ͘ͳͬͨΓ͢Δ •

    VimϓϥάΠϯͷੈքʹ͸ʮϦϦʔεʯʮόʔδϣϯʯͷ֓೦͕ͳ ͍ͷͰ…
  25. NeovimΛ࢖͏ϝϦοτ • λʔϛφϧ͚ͩͰ։ൃ͕׬݁͢Δ • ๛෋ͳϓϥάΠϯ • ωΠςΟϒͷVimΩʔόΠϯυ

  26. Neovim͕޲͍͍ͯΔਓ • ࣗ෼Ͱ৘ใऩू͕Ͱ͖Δ • vim-jpͱ͍͏ίϛϡχςΟ͕͋ͬͯ೔ຊޠ͕࢖͑ΔͷͰͰ͖Δ͸ͣ • ࣗ෼Ͱൺֱɾऔࣺબ୒Ͱ͖Δ • ಉ͡ػೳΛ࣋ͭϓϥάΠϯ͕ෳ਺͋Δ͜ͱ͕ଟ͍ •

    ઃఆΛࢼߦࡨޡͰ͖Δ • READMEͷ௨Γʹͨ͠ͷʹͳΜ͔มɺͱ͔΋Α͋͘Δ
  27. Neovim Ruby

  28. pp self • ໊લɿେ૔խ࢙ʢ͓͓͘Β·͞;Έʣ • ॴଐɿϑϦʔϥϯε • ͦͷଞɿKaigi on RailsͷνʔϑΦʔΨφΠβʔɺGrow.rbͷओ࠵ऀɺ

    Albaͷ࡞ऀ • ޷͖ͳςΩετΤσΟλɿVim
  29. ࢀߟ • https://github.com/okuramasafumi/dot fi les/tree/master/vim