Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kamecha committed Aug 30, 2024
1 parent a98b49e commit 23c7e16
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions doc/traqvim.jax
Original file line number Diff line number Diff line change
Expand Up @@ -271,19 +271,31 @@ bellow.
https://github.com/gw31415/denops-sixel-view.vim

>
" Clear the image like <C-l>
function s:clear() abort
call sixel_view#clear()
endfunction
function s:preview_img(fileId) abort
let file = denops#request("traqvim", "getFile", [a:fileId])
call sixel_view#view_sixel(file['data'], 0, 0)
" download the file and convert it to sixel data
let sixel = denops#request("traqvim", "getFile", [a:fileId])
call sixel_view#view_sixel(sixel['data'], 0, 0)
endfunction
function s:preview_cursor_img() abort
let cursor_url = getline('.')
let fileId = matchstr(cursor_url, 'https://q.trap.jp/files/\zs.*')
call s:preview_img(fileId)
" Close the image by moving the cursor
autocmd CursorMoved,BufLeave <buffer> ++once call s:clear()
endfunction
function s:traqvim_setting()
nnoremap <buffer><silent> K
\ <Cmd>call <SID>preview_cursor_img()<CR>
endfunction
nnoremap <buffer><silent> K
\ <Cmd>call <SID>preview_cursor_img()<CR>
autocmd FileType traqvim call s:traqvim_setting()
<

==============================================================================
Expand Down

0 comments on commit 23c7e16

Please sign in to comment.