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

vimconf-2014-f

Linda_pp
November 08, 2014

 vimconf-2014-f

About 'f' mapping in Vim. The introduction to the mapping and plugins which extend 'f'.

Linda_pp

November 08, 2014
Tweet

More Decks by Linda_pp

Other Decks in Technology

Transcript

  1. Vim ͷ f{char} Ϛοϐϯά • [count]f{char} • ݱࡏͷΧʔιϧҐஔ͔Β [count] ൪໨ʹݱΕΔ

    จࣈ {char} ʹΧʔιϧΛδϟϯϓ͢Δ • ; ͰҎલͷݕࡧΛલํʹ܁Γฦ͠ɼ, Ͱޙํʹ܁ Γฦ͢ • ٯํ޲ʹݕࡧ͍ͨ͠ͱ͖͸ [count]F{char} 
  2. Vim ͷ t{char} Ϛοϐϯά • [count]t{char} • ݱࡏͷΧʔιϧҐஔ͔Β [count] ൪໨ʹݱΕΔ

    จࣈ {char} ͷ௚લʹΧʔιϧΛδϟϯϓ͢Δ • ; ͰҎલͷݕࡧΛલํʹ܁Γฦ͠ɼ, Ͱޙํʹ܁ Γฦ͢ • ٯํ޲ʹݕࡧ͍ͨ͠ͱ͖͸ [count]T{char} 
  3. bar omap ΋ศར • _ ·Ͱফ͍ͨ͠ → df_ ! •

    {aaa: 1+2} Ͱ value ͚ͩফ͍ͨ͠ → dt} ! • dd ΍ yy ͷΑ͏ʹɼyf_ɼyt: ͳͲ΋Մೳ foo_bar f b EG@ {aaa: } {aaa: 1+2} } EU^  1
  4. vim-shot-f f ೖྗ࣌఺ͰҰൃͰඈ΂Δจࣈ͕ϋΠϥΠτ ͞ΕΔ IUUQTHJUIVCDPNEFSJTWJNTIPUG No, Vim is a text

    editor. No, Vim s a G tex d r. No, Vim is a text editor. N d GE ϋΠϥΠτ 
  5. improvedft • f ͷޙʹ {char} ΛೖΕͯݱࡏߦͷதͷҐஔΛߜΓࠐΜ Ͱ͍͘ • ީิ͕1Օॴʹͳͬͨ࣌఺Ͱδϟϯϓɼ΋͘͠͸ <Enter>ೖྗͰ࠷ॳͷީิ΁δϟϯϓ

    • ඈͼ͍ͨ৔ॴͷςΩετΛೖྗ͍ͯ͘͠ײ͡ • e.g.ɹfoo bar baz Ͱ baz ͷҐஔʹඈͼ͍ͨͳΒ baz ͱೖྗ͢Ε͹ྑ͍  IUUQTHJUIVCDPNDISJTCSBJNQSPWFEGU
  6. clever-f.vim • f{char} Ͱݕࡧͨ͠ͱ͖ͷ੎͍Ͱͦͷ·· ff.. ͱδϟϯ ϓ͍͚ͯ͠Δ • ܁Γฦ͠Ҡಈ͸λʔήοτͷจࣈͷ্ʹ͍ΔؒͷΈ༗ ޮ

    • ; ͱ , ͕ෆཁʢf ΍ t ͚ͩͰ܁Γฦ͠ݕࡧͰ͖Δ • ϋΠϥΠτɼߦΛލ͛Δɼsmart-caseɼmigemoɼetc  IUUQTHJUIVCDPNSIZTEDMFWFSGWJN
  7. growshi-ft.vim • f{char} ͰλʔήοτΛܾΊͨΒޙ͸ l ͱ h Ͱ ௚ײతʹࠨӈʹҠಈ •

    l ͱ h ʹΑΔҠಈ͸λʔήοτͷจࣈͷ্ʹ͍ Δ͚ؒͩ༗ޮ • ܁Γฦ͠ʹ ; ͱ , ͕ཁΒͳ͍  IUUQTHJUIVCDPNTBJIPPPPPPPPHMPXTIJGUWJN
  8. vim-sneak • s{char}{char} ͷ2จࣈͰδϟϯϓ͢ΔͷͰɼೖ ྗจࣈ͸ଟ͍͕ΑΓਫ਼౓͕ߴ͍ • clever-f.vim ͷΑ͏ʹॳճݕࡧޙ s ͱ

    S Ͱݕࡧ ީิؒΛҠಈͰ͖Δઃఆ΋͋Δ • ଞʹ΋1จࣈͰδϟϯϓͰ͖Δػೳ΍ vim- easymotion ͬΆ͍ػೳͳͲ৭ʑ͋Δ  IUUQTHJUIVCDPNHPMEGFMEWJNTFFL
  9. vim-easymotion <Plug>(easymotion-s2) Most of the manuals assume that Vim has

    been properly installed. If you didn't do that yet, or if Vim doesn't run properly first read the chapter on. IUUQTHJUIVCDPN-PLBMUPHWJNFBTZNPUJPO ߦ͖͍ͨՕॴͷ2จࣈೖྗͰը໘্ʹϥϕϧ Λදࣔ͠ɼೖྗͨ͠ϥϕϧʹδϟϯϓ͢Δ M 
  10. vim-easymotion <Plug>(easymotion-s2) Most of the manuals assume that Vim has

    been properly installed. If you didn't do that yet, or if Vim doesn't run properly first read the chapter on. ߦ͖͍ͨՕॴͷ2จࣈೖྗͰը໘্ʹϥϕϧ Λදࣔ͠ɼೖྗͨ͠ϥϕϧʹδϟϯϓ͢Δ ೖྗɿTUI B T E H ϥϕϧ M  IUUQTHJUIVCDPN-PLBMUPHWJNFBTZNPUJPO
  11. vim-easymotion <Plug>(easymotion-s2) Most of the manuals assume that Vim has

    been properly installed. If you didn't do that yet, or if Vim doesn't run properly first read the chapter on. ߦ͖͍ͨՕॴͷ2จࣈೖྗͰը໘্ʹϥϕϧ Λදࣔ͠ɼೖྗͨ͠ϥϕϧʹδϟϯϓ͢Δ ೖྗɿTUIH t  IUUQTHJUIVCDPN-PLBMUPHWJNFBTZNPUJPO
  12. ·ͱΊ • Vim ͷ f Ϛοϐϯάͱͦͷ֦ுϓϥάΠϯʹ ͍ͭͯ঺հͨ͠ • ීஈ l

    ΍ w Λ࿈ଧͯ͠Ҡಈ͍ͯ͠Δਓ΋ɼੋ ඇҰ౓ࢼͯ͠Έͯ΄͍͠ • ΧʔιϧͷԣҠಈ͸සൃ͢ΔͷͰɼ͜Ε͔Β ΋վળ͍͖͍ͯͨ͠