Wikia

Vim Tips Wiki

Script:40

Talk0
1,610pages on
this wiki
Revision as of 21:49, June 18, 2012 by 2.97.121.207 (Talk)

Use this page to discuss script 40 DrawIt: Ascii drawing plugin: lines, ellipses, arrows, fills, and more

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Shift + arrow key support in Mac OS X's Terminal

To have the shift + arrow key input (to move the cursor without drawing lines) work correctly in Terminal.app in OS X, it's necessary to add the following to Terminal's Preferences -> Settings -> Keyboard section:

shift cursor up:     \033[1;2A

shift cursor down:   \033[1;2B

shift cursor left:   \033[1;2D

shift cursor right:  \033[1;2C

Note that \033 is generated by typing Esc

Toolbar buttons

I've just been playing around with ToolBar button(s) and custom right mouse click menus for DrawIt. Maybe of interest to someone else:

amenu ]VlsDrawIt.Toggle\ Erase\ Mode<tab><space>   <space>
amenu ]VlsDrawIt.Make\ Blank\ Zone<tab>\\c         <Leader>c
amenu ]VlsDrawIt.Draw\ Flood<tab>\\e               <Leader>f

amenu ]VlsDrawItV.Draw\ Arrow<tab>\\a              gv<Leader>a
amenu ]VlsDrawItV.Draw\ Box<tab>\\b                gv<Leader>b
amenu ]VlsDrawItV.Draw\ Ellipse<tab>\\e            gv<Leader>e
amenu ]VlsDrawItV.Draw\ Line<tab>\\l               gv<Leader>l
amenu ]VlsDrawItV.Append\ Blanks<tab>\\s           gv<Leader>s

fun! s:StartDrawIt()
  aun ToolBar.DrawIt
  an <silent>icon=DrawItOff 1.16 ToolBar.DrawIt :call <SID>StopDrawIt()<CR>
  tm ToolBar.DrawIt               Stop drawing with DrawIt	\ds
  set lz
  call DrawIt#StartDrawIt()
  set nolz
  vunmap <buffer> <rightmouse>
  vnoremap <silent><buffer> <rightmouse> :<C-U>popup! ]VlsDrawItV<cr>gv
  nnoremap <silent><buffer> <rightmouse> :<C-U>popup! ]VlsDrawIt<cr>
endfun

fun! s:StopDrawIt()
  aun ToolBar.DrawIt
  an <silent> 1.16 ToolBar.DrawIt :call <SID>StartDrawIt()<CR>
  tm ToolBar.DrawIt               Start drawing with DrawIt	\di
  set lz
  call DrawIt#StopDrawIt()
  set nolz
  vunmap <buffer> <rightmouse>
  nunmap <buffer> <rightmouse>
endfun
an 1.16 ToolBar.DrawIt :call <SID>StartDrawIt()<CR>
tm ToolBar.DrawIt      Start drawing with DrawIt	\di

Comments

Around Wikia's network

Random Wiki