$30 off During Our Annual Pro Sale. View Details »

about-neovim-0.4.0-floating-window

 about-neovim-0.4.0-floating-window

gorilla.vim #4 at Akatsuki on 2019/5/15

Linda_pp

May 15, 2019
Tweet

More Decks by Linda_pp

Other Decks in Programming

Transcript

  1. call nvim_open_win(bufnr('%'), v:true, { \ 'relative': 'cursor', \ 'anchor': 'NW',

    \ 'row': 4, \ 'col': 4, \ 'width': 10, \ 'height': 10, \ })  
  2. call nvim_open_win(bufnr('%'), v:true, { \ 'relative': 'cursor', \ 'anchor': 'NW',

    \ 'row': 4, \ 'col': 4, \ 'width': 10, \ 'height': 10, \ }) ࠷ॳʹ։͘όοϑΝ ΢Οϯυ΢Λ։͍ͨޙ ͦͷதʹΧʔιϧΛҠ ಈ͢Δ͔Ͳ͏͔ ϑϩʔτ΢Οϯυ΢Λ Ͳ͏։͔͘Λࢦఆ͢Δ $POpHࣙॻ ʢޙड़ʣ ։͍ͨϑϩʔτ΢Οϯυ΢ ͷ8JOEPX*%Λฦ͢  
  3. Config ࣙॻ Ωʔ ஋ આ໌ σϑΥϧτ஋ SFMBUJWF FEJUPS DVSTPS 

    XJOͷ͏ͪͷ͍ ͣΕ͔ ΢Οϯυ΢ͷى఺ ͷҐஔʢޙड़ʣ FEJUPS BODIPS /& /8 4&  48ͷ͍ͣΕ͔ ى఺ʹͯ͠ํ޲ͷ Ͳ͜ʹ΢Οϯυ΢ Λग़͔͢ʢޙड़ʣ /8 GPDVTBCMF CPPMFBO Ϣʔβ͕΢Οϯυ ΢಺ʹΧʔιϧΛ ҠಈͰ͖Δ͔ WUSVF FYUFSOBM CPPMFBO (6*ଆ͕ϑϩʔτ ΢Οϯυ΢Λදࣔ ͢Δ͔ WGBMTF  
  4. "relative" (row: 2, col: 3 ͷͱ͖ʣ • "editor" εΫϦʔϯ 

       • "cursor" Χʔιϧ   ΢Οϯυ΢෼ׂ • "relative" ˞ର৅΢Οϯυ΢͸ XJOΩʔͰࢦఆ͢Δ "row": 2, "col": 3 ͷͱ͖ ϑϩʔτ΢Οϯυ΢  
  5. "anchor" "relative": "cursor", "row": 0, "col": 0 ͷͱ͖ Χʔιϧ •

    "NE" • "NW" • "SW" • "SE" Χʔιϧ Χʔιϧ Χʔιϧ  
  6. ։͘Ҏ֎ͷૢ࡞ • ด͡Δ → ී௨ͷ Vim ͷ΢Οϯυ΢ͱಉ ͡ɽ:close ΍ :wincmd

    c ΍ nvim_close_win() ͳͲ޷͖ʹด͡ΒΕΔ • αΠζมߋɾҠಈ → nvim_win_set_config(win_id, config) Ͱίϯ ϑΟάࣙॻΛηοτ͠ͳ͓͢͜ͱͰ൓ө͞ΕΔ  
  7. ϑϩʔτ΢Οϯυ΢ͷ࣮૷ • ࣮૷ऀɿ@bfredl ͞Μ • ଍ֻ͚໿2೥͔͚࣮ͯ૷ 1. ϑϩʔτ΢Οϯυ΢ͷ࢓૊ΈΛ࣮૷ɽnvim_open_win() ͳͲͰϓϥάΠϯ͔Β ΋ࣗ༝ʹ࢖͑ΔΑ͏ʹ͢Δʢ#6619ʣ

    2. ૊ΈࠐΈͷิ׬΢Οϯυ΢Λϑϩʔτ΢Οϯυ΢Ͱ࠶࣮૷͠ɼϑϦοΧϦϯά Λܰݮ͢Δʢ#9530ʣ 3. ίϚϯυϥΠϯϞʔυͷϙοϓΞοϓิ׬ wildoptions=pum Λ࣮૷ʢ#9607ʣ 4. ॏͳ͍ͬͯΔ΢Οϯυ΢ͷ৭ΛϒϨϯυ͢Δػೳͷ࣮૷ͳͲվળதʢ#9923ʣ • ϕʔεͱͳΔ࢓૊ΈΛ࣮૷͠ɼͦΕΛ࢖ͬͯ಺෦ΛϦϑΝΫλϦϯάɾϢʔβ͔Β΋ ར༻Ͱ͖ΔΑ͏ʹ͍ͯ͠Δ  
  8. ৽نػೳΛ΢Οϯυ΢ͷϨΠΞ΢τͷΈʹߜ Γɼैདྷͷ Vim ΢Οϯυ΢ͱಉ౳ʹ࢖͑Δ • ΢Οϯυ΢ͷத਎͸ී௨ͷ Vim ͷόοϑΝ • ৭Λ෇͚͚ͨΕ͹ߏจϋΠϥΠτΛॻ͍ͯ

    filetype Λ΢Οϯυ΢಺Ͱηοτ͢Ε͹ྑ͍ • ดͨ͡ΓΧʔιϧҠಈͨ͠Γ΋ :wincmd ͳͲ ͷैདྷͷ΍ΓํͰͰ͖Δ  
  9. ϑϩʔτ΢Οϯυ΢஫ҙ఺ • ΢Οϯυ΢Λ࢖͍ऴΘͬͨΒϓϥάΠϯଆͰ࣮֬ʹด͡Δɽಛʹ "enter": v:false ʹ͢ΔͱϢʔβ͔Β͸༰қʹด͡ΒΕͳ͍ • git-messenger.vim Ͱ͸όοϑΝ಺ͰΧʔιϧ͕ಈ͍ͨΓ৽͍͠΢Οϯυ΢ʹ Ҡಈ͢ΔλΠϛϯάΛϑοΫͯ͠ด͍ͯ͡Δ

    • σϑΥϧτͰ NormalFloat ͱ͍͏ϋΠϥΠτ͕ Normal ͷ୅ΘΓʹ࢖ΘΕΔʢม ߋ͢Δʹ͸ 'winhightlight' ΦϓγϣϯΛ࢖͏ʣ • ίϯςϯπ͕΢Οϯυ΢಺ʹऩ·ΔΑ͏ʹ͢Δɽऩ·Γ͖Βͳ͍৔߹͸Ϣʔβ͕ εΫϩʔϧͰ͖ΔΑ͏ʹ͢ΔͳͲ޻෉͢Δ • Vim ͱͷޓ׵ੑΛอͭʹ͸ɼVim Ͱ͸ϓϨϏϡʔ΢Οϯυ΢Λ࢖͏Α͏ʹ͢Δͱ ͏·͍͘͘৔߹͕͋Δʢgit-messenger.vimʣ