Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
about-neovim-0.4.0-floating-window
Search
Linda_pp
May 15, 2019
Programming
3
2.2k
about-neovim-0.4.0-floating-window
gorilla.vim #4 at Akatsuki on 2019/5/15
Linda_pp
May 15, 2019
Tweet
Share
More Decks by Linda_pp
See All by Linda_pp
actionlint の Linter 設計
rhysd
6
3.6k
ripgrep をライブラリとして使う
rhysd
0
410
port-monolith-to-wasm-for-chrome-extension
rhysd
0
450
Fuzzing Rust Text Editor
rhysd
1
2.9k
Vim compiled to WebAssembly
rhysd
5
2.1k
reply.vim
rhysd
0
1.2k
Vim ported to WebAssembly (VimConf 2018)
rhysd
4
3.3k
go-selfupdate-github で ツールを自己アップデートする
rhysd
5
4.3k
小さく始めて育てるコンパイラ
rhysd
13
4.9k
Other Decks in Programming
See All in Programming
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
Beyond ORM
77web
7
870
testcontainers のススメ
sgash708
1
120
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
Recoilを剥がしている話
kirik
5
6.8k
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
790
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
Haze - Real time background blurring
chrisbanes
1
510
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
useSyncExternalStoreを使いまくる
ssssota
6
1.1k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Scaling GitHub
holman
458
140k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Into the Great Unknown - MozCon
thekraken
33
1.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Code Review Best Practice
trishagee
65
17k
It's Worth the Effort
3n
183
28k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Transcript
Neovim 0.4.0 ৽ػೳ ϑϩʔτΟϯυʹ͍ͭͯ gorilla.vim #4, 2019/05/14
About Me @Linda_pp @rhysd ࠷ۙ git-messenger.vim ͱ͔ͭͬͯ͘·͢
ϑϩʔτΟϯυΛͬͨ ϓϥάΠϯ
coc.nvim https://github.com/neoclide/coc.nvim
LanguageClient-neovim https://github.com/autozimu/LanguageClient- neovim
git-messenger.vim https://github.com/rhysd/git-messenger.vim
vim-iced https://github.com/liquidz/vim-iced
Neovim ϑϩʔτΟϯυ API
ϑϩʔτΟϯυͱʁ λΠϧܕͰͳ͍ɼ৽͍͠ܗࣜͷΟϯυɽ Neovim 0.4.0 ͰՃ͞ΕΔ CSS Ͱ͍͏ position: absolute; ͳͲͷΑ͏
ʹɼطଘͷΟϯυͷ্ʹΦʔόʔϥοϓ ͨ͠ΟϯυΛͭ͘Δ͜ͱ͕Ͱ͖Δ
call nvim_open_win(bufnr('%'), v:true, { \ 'relative': 'cursor', \ 'anchor': 'NW',
\ 'row': 4, \ 'col': 4, \ 'width': 10, \ 'height': 10, \ })
call nvim_open_win(bufnr('%'), v:true, { \ 'relative': 'cursor', \ 'anchor': 'NW',
\ 'row': 4, \ 'col': 4, \ 'width': 10, \ 'height': 10, \ }) ࠷ॳʹ։͘όοϑΝ ΟϯυΛ։͍ͨޙ ͦͷதʹΧʔιϧΛҠ ಈ͢Δ͔Ͳ͏͔ ϑϩʔτΟϯυΛ Ͳ͏։͔͘Λࢦఆ͢Δ $POpHࣙॻ ʢޙड़ʣ ։͍ͨϑϩʔτΟϯυ ͷ8JOEPX*%Λฦ͢
Config ࣙॻ Ωʔ આ໌ σϑΥϧτ SFMBUJWF FEJUPS DVSTPS
XJOͷ͏ͪͷ͍ ͣΕ͔ Οϯυͷى ͷҐஔʢޙड़ʣ FEJUPS BODIPS /& /8 4& 48ͷ͍ͣΕ͔ ىʹͯ͠ํͷ Ͳ͜ʹΟϯυ Λग़͔͢ʢޙड़ʣ /8 GPDVTBCMF CPPMFBO Ϣʔβ͕Οϯυ ʹΧʔιϧΛ ҠಈͰ͖Δ͔ WUSVF FYUFSOBM CPPMFBO (6*ଆ͕ϑϩʔτ ΟϯυΛදࣔ ͢Δ͔ WGBMTF
"relative" (row: 2, col: 3 ͷͱ͖ʣ • "editor" εΫϦʔϯ
• "cursor" Χʔιϧ Οϯυׂ • "relative" ˞ରΟϯυ XJOΩʔͰࢦఆ͢Δ "row": 2, "col": 3 ͷͱ͖ ϑϩʔτΟϯυ
"anchor" "relative": "cursor", "row": 0, "col": 0 ͷͱ͖ Χʔιϧ •
"NE" • "NW" • "SW" • "SE" Χʔιϧ Χʔιϧ Χʔιϧ
։͘Ҏ֎ͷૢ࡞ • ด͡Δ → ී௨ͷ Vim ͷΟϯυͱಉ ͡ɽ:close :wincmd
c nvim_close_win() ͳͲ͖ʹด͡ΒΕΔ • αΠζมߋɾҠಈ → nvim_win_set_config(win_id, config) Ͱίϯ ϑΟάࣙॻΛηοτ͠ͳ͓͢͜ͱͰө͞ΕΔ
ϑϩʔτΟϯυͷ࣮ • ࣮ऀɿ@bfredl ͞Μ • ֻ͚2͔͚࣮ͯ 1. ϑϩʔτΟϯυͷΈΛ࣮ɽnvim_open_win() ͳͲͰϓϥάΠϯ͔Β ࣗ༝ʹ͑ΔΑ͏ʹ͢Δʢ#6619ʣ
2. ΈࠐΈͷิΟϯυΛϑϩʔτΟϯυͰ࠶࣮͠ɼϑϦοΧϦϯά Λܰݮ͢Δʢ#9530ʣ 3. ίϚϯυϥΠϯϞʔυͷϙοϓΞοϓิ wildoptions=pum Λ࣮ʢ#9607ʣ 4. ॏͳ͍ͬͯΔΟϯυͷ৭ΛϒϨϯυ͢Δػೳͷ࣮ͳͲվળதʢ#9923ʣ • ϕʔεͱͳΔΈΛ࣮͠ɼͦΕΛͬͯ෦ΛϦϑΝΫλϦϯάɾϢʔβ͔Β ར༻Ͱ͖ΔΑ͏ʹ͍ͯ͠Δ
ϑϩʔτΟϯυͲ͕͜ ྑ͍ͷ͔
৽نػೳΛΟϯυͷϨΠΞτͷΈʹߜ Γɼैདྷͷ Vim Οϯυͱಉʹ͑Δ • Οϯυͷதී௨ͷ Vim ͷόοϑΝ • ৭Λ͚͚ͨΕߏจϋΠϥΠτΛॻ͍ͯ
filetype ΛΟϯυͰηοτ͢Εྑ͍ • ดͨ͡ΓΧʔιϧҠಈͨ͠Γ :wincmd ͳͲ ͷैདྷͷΓํͰͰ͖Δ
ଥڠ͠ͳ͍࣮ • ΟϯυͷαΠζ 1x1 ͔ΒࢦఆͰ͖Δ • ͍ͭ͘ͰੜͰ͖Δʢz-index ޙউͪʣ • ϑϩʔτΟϯυ͕εΫϦʔϯ͔ΒΈग़
Δ࣌ࣗಈͰௐͯ͘͠ΕΔͷͰϓϥάΠϯ ࡞ऀؾʹ͠ͳͯ͘ྑ͍
ϓϥάΠϯ࡞ऀ͜ΕΛʹ༷ʑͳ UI ΛߏஙͰ͖Δ • ΠϯλϥΫςΟϒͳϙοϓΞοϓϝχϡʔ • ิϝχϡʔࣗ࡞ • υΩϡϝϯτͳͲͷϓϨϏϡʔΟϯυπʔϧνοϓ •
ςΩετϥϕϧʢEasyMotion ͷΑ͏ͳʣ • ௨ • ...
ϑϩʔτΟϯυҙ • ΟϯυΛ͍ऴΘͬͨΒϓϥάΠϯଆͰ࣮֬ʹด͡Δɽಛʹ "enter": v:false ʹ͢ΔͱϢʔβ͔Β༰қʹด͡ΒΕͳ͍ • git-messenger.vim ͰόοϑΝͰΧʔιϧ͕ಈ͍ͨΓ৽͍͠Οϯυʹ Ҡಈ͢ΔλΠϛϯάΛϑοΫͯ͠ด͍ͯ͡Δ
• σϑΥϧτͰ NormalFloat ͱ͍͏ϋΠϥΠτ͕ Normal ͷΘΓʹΘΕΔʢม ߋ͢Δʹ 'winhightlight' ΦϓγϣϯΛ͏ʣ • ίϯςϯπ͕Οϯυʹऩ·ΔΑ͏ʹ͢Δɽऩ·Γ͖Βͳ͍߹Ϣʔβ͕ εΫϩʔϧͰ͖ΔΑ͏ʹ͢ΔͳͲ͢Δ • Vim ͱͷޓੑΛอͭʹɼVim ͰϓϨϏϡʔΟϯυΛ͏Α͏ʹ͢Δͱ ͏·͍͘͘߹͕͋Δʢgit-messenger.vimʣ
·ͱΊ • ϑϩʔτΟϯυඇৗʹ 'ے͕ྑ͍' ػೳ • ϓϥάΠϯ࡞ऀࠓ·Ͱʹ࣮ݱ͕ࠔͩͬ ͨ UI ΛߏஙͰ͖Δ
• Neovim ϓϥάΠϯΛ͍ͭͬͯ͘Δํੋඇར ༻Λݕ౼ͯ͠Έ͍ͯͩ͘͞