Commits

esaurito committed a45db3a

First commit

Comments (0)

Files changed (90)

+loremipsum.vba: call delete('/home/alex/.vim/autoload/loremipsum.vim')|call delete('/home/alex/.vim/autoload/loremipsum.txt')|call delete('/home/alex/.vim/plugin/loremipsum.vim')|call delete('/home/alex/.vim/doc/loremipsum.txt')
+bexec-v0.3.vba: call delete('/home/alex/.vim/plugin/bexec.vim')|call delete('/home/alex/.vim/doc/bexec.txt')
+conque_1.1.vba: call delete('/home/alex/.vim/autoload/conque_term.vim')|call delete('/home/alex/.vim/doc/conque_term.txt')|call delete('/home/alex/.vim/plugin/conque_term.vim')|call delete('/home/alex/.vim/syntax/conque_term.vim')
+# use glob syntax.
+syntax: glob
+
+*.pyc
+*~
+let g:netrw_dirhistmax  =10
+let g:netrw_dirhist_cnt =3
+let g:netrw_dirhist_1='/home/alex'
+let g:netrw_dirhist_2='/home/alex/Desktop'
+let g:netrw_dirhist_3='/boot/grub'

MangleImageTag.vim

+" MangleImageTag() - updates an <IMG>'s width and height tags.
+"
+" Requirements:
+"       VIM 7 or later
+"
+" Copyright (C) 2004-2008 Christian J. Robinson <infynity@onewest.net>
+"
+" Based on "mangleImageTag" by Devin Weaver <ktohg@tritarget.com>
+"
+" This program is free software; you can  redistribute  it  and/or  modify  it
+" under the terms of the GNU General Public License as published by  the  Free
+" Software Foundation; either version 2 of the License, or  (at  your  option)
+" any later version.
+"
+" This program is distributed in the hope that it will be useful, but  WITHOUT
+" ANY WARRANTY; without  even  the  implied  warranty  of  MERCHANTABILITY  or
+" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General  Public  License  for
+" more details.
+"
+" You should have received a copy of the GNU General Public License along with
+" this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+" Place - Suite 330, Boston, MA 02111-1307, USA.
+"
+" RCS info: -------------------------------------------------------------- {{{
+" $Id: MangleImageTag.vim,v 1.12 2008/05/30 00:53:28 infynity Exp $
+" $Log: MangleImageTag.vim,v $
+" Revision 1.12  2008/05/30 00:53:28  infynity
+" - Clarify an error message
+" - Don't move the cursor when updating the tag
+"
+" Revision 1.11  2008/05/26 01:11:25  infynity
+" *** empty log message ***
+"
+" Revision 1.10  2008/05/01 05:01:02  infynity
+" Code changed for Vim 7:
+"  - Computed sizes should always be correct now
+"  - Code is a bit cleaner, but unfortunately slower
+"
+" Revision 1.9  2007/05/04 02:03:42  infynity
+" Computed sizes were very wrong when 'encoding' was set to UTF8 or similar
+"
+" Revision 1.8  2007/05/04 01:32:27  infynity
+" Missing quotes
+"
+" Revision 1.7  2007/01/04 04:29:55  infynity
+" Enclose the values of the width/height in quotes by default
+"
+" Revision 1.6  2006/09/22 06:25:14  infynity
+" Search for the image file in the current directory and the buffer's directory.
+"
+" Revision 1.5  2006/06/09 07:56:08  infynity
+" Was resetting 'autoindent' globally, switch it to locally.
+"
+" Revision 1.4  2006/06/08 04:16:17  infynity
+" Temporarily reset 'autoindent' (required for Vim7)
+"
+" Revision 1.3  2005/05/19 18:31:31  infynity
+" SizeGif was returning width as height and vice-versa.
+"
+" Revision 1.2  2004/03/22 10:04:24  infynity
+" Update the right tag if more than one IMG tag appears on the line.
+"
+" Revision 1.1  2004/03/22 05:58:34  infynity
+" Initial revision
+" ------------------------------------------------------------------------ }}}
+
+if v:version < 700 || exists("*MangleImageTag")
+	finish
+endif
+
+function! MangleImageTag() "{{{1
+	let start_linenr = line('.')
+	let end_linenr = start_linenr
+	let col = col('.') - 1
+	let line = getline(start_linenr)
+
+	if line !~? '<img'
+		echohl ErrorMsg
+		echomsg "The current line does not contain an image tag (see :help ;mi)."
+		echohl None
+
+		return
+	endif
+
+	" Get the rest of the tag if we have a partial tag:
+	while line =~? '<img\_[^>]*$'
+		let end_linenr = end_linenr + 1
+		let line = line . "\n" . getline(end_linenr)
+	endwhile
+
+	" Make sure we modify the right tag if more than one is on the line:
+	if line[col] != '<'
+		let tmp = strpart(line, 0, col)
+		let tagstart = strridx(tmp, '<')
+	else
+		let tagstart = col
+	endif
+	let savestart = strpart(line, 0, tagstart)
+	let tag = strpart(line, tagstart)
+	let tagend = stridx(tag, '>') + 1
+	let saveend = strpart(tag, tagend)
+	let tag = strpart(tag, 0, tagend)
+
+	if tag[0] != '<' || col > strlen(savestart . tag) - 1
+		echohl ErrorMsg
+		echomsg "Cursor isn't on an IMG tag."
+		echohl None
+
+		return
+	endif
+
+	if tag =~? "src=\\(\".\\{-}\"\\|'.\\{-}\'\\)"
+		let src = substitute(tag, ".\\{-}src=\\([\"']\\)\\(.\\{-}\\)\\1.*", '\2', '')
+		if tag =~# 'src'
+			let case = 0
+		else
+			let case = 1
+		endif
+	else
+		echohl ErrorMsg
+		echomsg "Image src not specified in the tag."
+		echohl None
+
+		return
+	endif
+
+	if ! filereadable(src)
+		if filereadable(expand("%:p:h") . '/' . src)
+			let src = expand("%:p:h") . '/' . src
+		else
+			echohl ErrorMsg
+			echomsg "Can't find image file: " . src
+			echohl None
+
+			return
+		endif
+	endif
+
+	let size = s:ImageSize(src)
+	if len(size) != 2
+		return
+	endif
+
+	if tag =~? "height=\\(\"\\d\\+\"\\|'\\d\\+\'\\|\\d\\+\\)"
+		let tag = substitute(tag,
+			\ "\\c\\(height=\\)\\([\"']\\=\\)\\(\\d\\+\\)\\(\\2\\)",
+			\ '\1\2' . size[1] . '\4', '')
+	else
+		let tag = substitute(tag,
+			\ "\\csrc=\\([\"']\\)\\(.\\{-}\\|.\\{-}\\)\\1",
+			\ '\0 ' . (case ? 'HEIGHT' : 'height') . '="' . size[1] . '"', '')
+	endif
+
+	if tag =~? "width=\\(\"\\d\\+\"\\|'\\d\\+\'\\|\\d\\+\\)"
+		let tag = substitute(tag,
+			\ "\\c\\(width=\\)\\([\"']\\=\\)\\(\\d\\+\\)\\(\\2\\)",
+			\ '\1\2' . size[0] . '\4', '')
+	else
+		let tag = substitute(tag,
+			\ "\\csrc=\\([\"']\\)\\(.\\{-}\\|.\\{-}\\)\\1",
+			\ '\0 ' . (case ? 'WIDTH' : 'width') . '="' . size[0] . '"', '')
+	endif
+
+	let line = savestart . tag . saveend
+
+	let saveautoindent=&autoindent
+	let &l:autoindent=0
+
+	call setline(start_linenr, split(line, "\n"))
+
+	let &l:autoindent=saveautoindent
+endfunction
+
+function! s:ImageSize(image) "{{{1
+	let ext = fnamemodify(a:image, ':e')
+
+	if ext !~? 'png\|gif\|jpe\?g'
+		echohl ErrorMsg
+		echomsg "Image type not recognized: " . tolower(ext)
+		echohl None
+
+		return
+	endif
+
+	if filereadable(a:image)
+		let ldsave=&lazyredraw
+		set lazyredraw
+
+		let buf=readfile(a:image, 'b', 1024)
+		let buf2=[]
+
+		let i=0
+		for l in buf
+			let string = split(l, '\zs')
+			for c in string
+				let char = char2nr(c)
+				call add(buf2, (char == 10 ? '0' : char))
+
+				" Keep the script from being too slow, but could cause a JPG
+				" (and GIF/PNG?) to return as "malformed":
+				let i+=1
+				if i > 1024 * 4
+					break
+				endif
+			endfor
+			call add(buf2, '10')
+		endfor
+
+		if ext ==? 'png'
+			let size = s:SizePng(buf2)
+		elseif ext ==? 'gif'
+			let size = s:SizeGif(buf2)
+		elseif ext ==? 'jpg' || ext ==? 'jpeg'
+			let size = s:SizeJpg(buf2)
+		endif
+	else
+		echohl ErrorMsg
+		echomsg "Can't read file: " . a:image
+		echohl None
+
+		return
+	endif
+
+	return size
+endfunction
+
+function! s:SizeGif(lines) "{{{1
+	let i=0
+	let len=len(a:lines)
+	while i <= len
+		if join(a:lines[i : i+9], ' ') =~ '^71 73 70\( \d\+\)\{7}'
+			let width=s:Vec(reverse(a:lines[i+6 : i+7]))
+			let height=s:Vec(reverse(a:lines[i+8 : i+9]))
+
+			return [width, height]
+		endif
+		let i+=1
+	endwhile
+
+	echohl ErrorMsg
+	echomsg "Malformed GIF file."
+	echohl None
+
+	return
+endfunction
+
+function! s:SizeJpg(lines) "{{{1
+	let i=0
+	let len=len(a:lines)
+	while i <= len
+		if join(a:lines[i : i+8], ' ') =~ '^255 192\( \d\+\)\{7}'
+			let height = s:Vec(a:lines[i+5 : i+6])
+			let width = s:Vec(a:lines[i+7 : i+8])
+
+			return [width, height]
+		endif
+		let i+=1
+	endwhile
+
+	echohl ErrorMsg
+	echomsg "Malformed JPEG file."
+	echohl None
+
+	return
+endfunction
+
+function! s:SizePng(lines) "{{{1
+	let i=0
+	let len=len(a:lines)
+	while i <= len
+		if join(a:lines[i : i+11], ' ') =~ '^73 72 68 82\( \d\+\)\{8}'
+			let width = s:Vec(a:lines[i+4 : i+7])
+			let height = s:Vec(a:lines[i+8 : i+11])
+
+			return [width, height]
+		endif
+		let i+=1
+	endwhile
+
+	echohl ErrorMsg
+	echomsg "Malformed PNG file."
+	echohl None
+
+	return
+endfunction
+
+function! s:Vec(nums) "{{{1
+	let n = 0
+	for i in a:nums
+		let n = n * 256 + i
+	endfor
+	return n
+endfunction
+
+" vim:ts=4:sw=4:
+" vim600:fdm=marker:fdc=2:cms=\ \"%s:

autoload/conque_term.vim

+" FILE:     plugin/conque_term.vim {{{
+"
+" AUTHOR:   Nico Raffo <nicoraffo@gmail.com>
+" MODIFIED: 2010-05-27
+" VERSION:  1.1, for Vim 7.0
+" LICENSE:
+" Conque - pty interaction in Vim
+" Copyright (C) 2009-2010 Nico Raffo 
+"
+" MIT License
+" 
+" Permission is hereby granted, free of charge, to any person obtaining a copy
+" of this software and associated documentation files (the "Software"), to deal
+" in the Software without restriction, including without limitation the rights
+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+" copies of the Software, and to permit persons to whom the Software is
+" furnished to do so, subject to the following conditions:
+" 
+" The above copyright notice and this permission notice shall be included in
+" all copies or substantial portions of the Software.
+" 
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+" THE SOFTWARE.
+" }}}
+
+
+" **********************************************************************************************************
+" **** VIM FUNCTIONS ***************************************************************************************
+" **********************************************************************************************************
+
+" launch conque
+function! conque_term#open(...) "{{{
+    let command = get(a:000, 0, '')
+    let hooks   = get(a:000, 1, [])
+
+    " bare minimum validation
+    if has('python') != 1
+        echohl WarningMsg | echomsg "Conque requires the Python interface to be installed" | echohl None
+        return 0
+    endif
+    if empty(command)
+        echohl WarningMsg | echomsg "No command found" | echohl None
+        return 0
+    else
+        let l:cargs = split(command, '\s')
+        if !executable(l:cargs[0])
+            echohl WarningMsg | echomsg "Not an executable: " . l:cargs[0] | echohl None
+            return 0
+        endif
+    endif
+
+    " set buffer window options
+    let g:ConqueTerm_BufName = substitute(command, ' ', '\\ ', 'g') . "\\ -\\ " . g:ConqueTerm_Idx
+    call conque_term#set_buffer_settings(command, hooks)
+    let b:ConqueTerm_Var = 'ConqueTerm_' . g:ConqueTerm_Idx
+    let g:ConqueTerm_Var = 'ConqueTerm_' . g:ConqueTerm_Idx
+    let g:ConqueTerm_Idx += 1
+
+    " open command
+    try
+        let l:config = '{"color":' . string(g:ConqueTerm_Color) . ',"TERM":"' . g:ConqueTerm_TERM . '"}'
+        execute 'python ' . b:ConqueTerm_Var . ' = Conque()'
+        execute "python " . b:ConqueTerm_Var . ".open('" . conque_term#python_escape(command) . "', " . l:config . ")"
+    catch 
+        echohl WarningMsg | echomsg "Unable to open command: " . command | echohl None
+        return 0
+    endtry
+
+    " set buffer mappings and auto commands 
+    call conque_term#set_mappings('start')
+
+    startinsert!
+    return 1
+endfunction "}}}
+
+" set buffer options
+function! conque_term#set_buffer_settings(command, pre_hooks) "{{{
+
+    " optional hooks to execute, e.g. 'split'
+    for h in a:pre_hooks
+        sil exe h
+    endfor
+    sil exe "edit " . g:ConqueTerm_BufName
+
+    " buffer settings 
+    setlocal nocompatible      " conque won't work in compatible mode
+    setlocal nopaste           " conque won't work in paste mode
+    setlocal buftype=nofile    " this buffer is not a file, you can't save it
+    setlocal nonumber          " hide line numbers
+    setlocal foldcolumn=0      " reasonable left margin
+    setlocal nowrap            " default to no wrap (esp with MySQL)
+    setlocal noswapfile        " don't bother creating a .swp file
+    setlocal updatetime=50     " trigger cursorhold event after 50ms / XXX - global
+    setlocal scrolloff=0       " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal sidescrolloff=0   " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal sidescroll=1      " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal foldmethod=manual " don't fold on {{{}}} and stuff
+    setlocal bufhidden=hide    " when buffer is no longer displayed, don't wipe it out
+    setfiletype conque_term    " useful
+    sil exe "setlocal syntax=" . g:ConqueTerm_Syntax
+
+endfunction " }}}
+
+" set key mappings and auto commands
+function! conque_term#set_mappings(action) "{{{
+
+    " set action
+    if a:action == 'toggle'
+        if exists('b:conque_on') && b:conque_on == 1
+            let l:action = 'stop'
+            echohl WarningMsg | echomsg "Terminal is paused" | echohl None
+        else
+            let l:action = 'start'
+            echohl WarningMsg | echomsg "Terminal is resumed" | echohl None
+        endif
+    else
+        let l:action = a:action
+    endif
+
+    " if mappings are being removed, add 'un'
+    let map_modifier = 'nore'
+    if l:action == 'stop'
+        let map_modifier = 'un'
+    endif
+
+    " remove all auto commands
+    if l:action == 'stop'
+        execute 'autocmd! ' . b:ConqueTerm_Var
+
+    else
+        execute 'augroup ' . b:ConqueTerm_Var
+
+        " handle unexpected closing of shell, passes HUP to parent and all child processes
+        execute 'autocmd ' . b:ConqueTerm_Var . ' BufUnload <buffer> python ' . b:ConqueTerm_Var . '.proc.signal(1)'
+
+        " check for resized/scrolled buffer when entering buffer
+        execute 'autocmd ' . b:ConqueTerm_Var . ' BufEnter <buffer> python ' . b:ConqueTerm_Var . '.update_window_size()'
+        execute 'autocmd ' . b:ConqueTerm_Var . ' VimResized python ' . b:ConqueTerm_Var . '.update_window_size()'
+
+        " set/reset updatetime on entering/exiting buffer
+        autocmd BufEnter <buffer> set updatetime=50
+        autocmd BufLeave <buffer> set updatetime=2000
+
+        " check for resized/scrolled buffer when entering insert mode
+        " XXX - messed up since we enter insert mode at each updatetime
+        "execute 'autocmd InsertEnter <buffer> python ' . b:ConqueTerm_Var . '.screen.align()'
+
+        " read more output when this isn't the current buffer
+        if g:ConqueTerm_ReadUnfocused == 1
+            execute 'autocmd ' . b:ConqueTerm_Var . ' CursorHold * call conque_term#read_all()'
+        endif
+
+        " poll for more output
+        sil execute 'autocmd ' . b:ConqueTerm_Var . ' CursorHoldI <buffer> python ' .  b:ConqueTerm_Var . '.auto_read()'
+    endif
+
+    " use F22 key to get more input
+    if l:action == 'start'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F22> "\<left>\<right>"'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F23> "\<right>\<left>"'
+    else
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F22>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F23>'
+    endif
+
+    " map ASCII 1-31
+    for c in range(1, 31)
+        " <Esc>
+        if c == 27
+            continue
+        endif
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <C-' . nr2char(64 + c) . '> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(' . c . '))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <C-' . nr2char(64 + c) . '>'
+        endif
+    endfor
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> <C-c> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(3))<CR>'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> <C-c>'
+    endif
+
+    " leave insert mode
+    if !exists('g:ConqueTerm_EscKey') || g:ConqueTerm_EscKey == '<Esc>'
+        " use <Esc><Esc> to send <Esc> to terminal
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc><Esc> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(27))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc><Esc>'
+        endif
+    else
+        " use <Esc> to send <Esc> to terminal
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> ' . g:ConqueTerm_EscKey . ' <Esc>'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(27))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> ' . g:ConqueTerm_EscKey
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc>'
+        endif
+    endif
+
+    " Map <C-w> in insert mode
+    if exists('g:ConqueTerm_CWInsert') && g:ConqueTerm_CWInsert == 1
+        inoremap <silent> <buffer> <C-w>j <Esc><C-w>j
+        inoremap <silent> <buffer> <C-w>k <Esc><C-w>k
+        inoremap <silent> <buffer> <C-w>h <Esc><C-w>h
+        inoremap <silent> <buffer> <C-w>l <Esc><C-w>l
+        inoremap <silent> <buffer> <C-w>w <Esc><C-w>w
+    endif
+
+    " map ASCII 33-127
+    for i in range(33, 127)
+        " <Bar>
+        if i == 124
+            if l:action == 'start'
+                sil exe "i" . map_modifier . "map <silent> <buffer> <Bar> <C-o>:python " . b:ConqueTerm_Var . ".write(chr(124))<CR>"
+            else
+                sil exe "i" . map_modifier . "map <silent> <buffer> <Bar>"
+            endif
+            continue
+        endif
+        if l:action == 'start'
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i) . " <C-o>:python " . b:ConqueTerm_Var . ".write(chr(" . i . "))<CR>"
+        else
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i)
+        endif
+    endfor
+
+    " map ASCII 128-255
+    for i in range(128, 255)
+        if l:action == 'start'
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i) . " <C-o>:python " . b:ConqueTerm_Var . ".write('" . nr2char(i) . "')<CR>"
+        else
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i)
+        endif
+    endfor
+
+    " Special cases
+    if l:action == 'start'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u0008")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space> <C-o>:python ' . b:ConqueTerm_Var . '.write(" ")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[A")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[B")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[C")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Left> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[D")<CR>'
+    else
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Left>'
+    endif
+
+    " send selected text into conque
+    if l:action == 'start'
+        sil exe 'v' . map_modifier . 'map <silent> <F9> :<C-u>call conque_term#send_selected(visualmode())<CR>'
+    else
+        sil exe 'v' . map_modifier . 'map <silent> <F9>'
+    endif
+
+    " remap paste keys
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> P :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> ]p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> [p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> p'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> P'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> ]p'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> [p'
+    endif
+    if has('gui_running')
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <buffer> <S-Insert> <Esc>:<C-u>python ' . b:ConqueTerm_Var . ".write(vim.eval('@+'))<CR>a"
+        else
+            sil exe 'i' . map_modifier . 'map <buffer> <S-Insert>'
+        endif
+    endif
+
+    " disable other normal mode keys which insert text
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> r :echo "Replace mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> R :echo "Replace mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> c :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> C :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> s :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> S :echo "Change mode disabled in shell."<CR>'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> r'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> R'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> c'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> C'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> s'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> S'
+    endif
+
+    " set conque as on or off
+    if l:action == 'start'
+        let b:conque_on = 1
+    else
+        let b:conque_on = 0
+    endif
+
+    " map command to start stop the shell
+    if a:action == 'start'
+        nnoremap <F5> :<C-u>call conque_term#set_mappings('toggle')<CR>
+    endif
+
+endfunction " }}}
+
+
+" send selected text from another buffer
+function! conque_term#send_selected(type) "{{{
+    let reg_save = @@
+
+    " save user's sb settings
+    let sb_save = &switchbuf
+    set switchbuf=usetab
+
+    " yank current selection
+    sil exe "normal! `<" . a:type . "`>y"
+
+    " format yanked text
+    let @@ = substitute(@@, '^[\r\n]*', '', '')
+    let @@ = substitute(@@, '[\r\n]*$', '', '')
+
+    " execute yanked text
+    sil exe ":sb " . g:ConqueTerm_BufName
+    sil exe 'python ' . g:ConqueTerm_Var . '.paste_selection()'
+
+    " reset original values
+    let @@ = reg_save
+    sil exe 'set switchbuf=' . sb_save
+
+    " scroll buffer left
+    startinsert!
+    normal 0zH
+endfunction "}}}
+
+" read from all known conque buffers
+function! conque_term#read_all() "{{{
+    " don't run this if we're in a conque buffer
+    if exists('b:ConqueTerm_Var')
+        return
+    endif
+
+    try
+        for i in range(1, g:ConqueTerm_Idx - 1)
+            execute 'python ConqueTerm_' . string(i) . '.read(1)'
+        endfor
+    catch
+        " probably a deleted buffer
+    endtry
+
+    " restart updatetime
+    call feedkeys("f\e")
+endfunction "}}}
+
+" util function to add enough \s to pass a string to python
+function! conque_term#python_escape(input) "{{{
+    let l:cleaned = a:input
+    let l:cleaned = substitute(l:cleaned, '\\', '\\\\', 'g')
+    let l:cleaned = substitute(l:cleaned, '\n', '\\n', 'g')
+    let l:cleaned = substitute(l:cleaned, '\r', '\\r', 'g')
+    let l:cleaned = substitute(l:cleaned, "'", "\\\\'", 'g')
+    return l:cleaned
+endfunction "}}}
+
+" **********************************************************************************************************
+" **** PYTHON **********************************************************************************************
+" **********************************************************************************************************
+
+if has('python')
+
+python << EOF
+
+import vim, re, time, math
+
+# CONFIG CONSTANTS  {{{
+
+CONQUE_CTL = {
+     7:'bel', # bell
+     8:'bs',  # backspace
+     9:'tab', # tab
+    10:'nl',  # new line
+    13:'cr'   # carriage return
+}
+#    11 : 'vt',  # vertical tab
+#    12 : 'ff',  # form feed
+#    14 : 'so',  # shift out
+#    15 : 'si'   # shift in
+
+# Escape sequences 
+CONQUE_ESCAPE = { 
+    'm':'font',
+    'J':'clear_screen',
+    'K':'clear_line',
+    '@':'add_spaces',
+    'A':'cursor_up',
+    'B':'cursor_down',
+    'C':'cursor_right',
+    'D':'cursor_left',
+    'G':'cursor_to_column',
+    'H':'cursor',
+    'P':'delete_chars',
+    'f':'cursor',
+    'g':'tab_clear',
+    'r':'set_coords',
+    'h':'set',
+    'l':'reset'
+}
+#    'L':'insert_lines',
+#    'M':'delete_lines',
+#    'd':'cusor_vpos',
+
+# Alternate escape sequences, no [
+CONQUE_ESCAPE_PLAIN = {
+    'D':'scroll_up',
+    'E':'next_line',
+    'H':'set_tab',
+    'M':'scroll_down'
+}
+#    'N':'single_shift_2',
+#    'O':'single_shift_3',
+#    '=':'alternate_keypad',
+#    '>':'numeric_keypad',
+#    '7':'save_cursor',
+#    '8':'restore_cursor',
+
+# Uber alternate escape sequences, with # or ?
+CONQUE_ESCAPE_QUESTION = {
+    '1h':'new_line_mode',
+    '3h':'132_cols',
+    '4h':'smooth_scrolling',
+    '5h':'reverse_video',
+    '6h':'relative_origin',
+    '7h':'set_auto_wrap',
+    '8h':'set_auto_repeat',
+    '9h':'set_interlacing_mode',
+    '1l':'set_cursor_key',
+    '2l':'set_vt52',
+    '3l':'80_cols',
+    '4l':'set_jump_scrolling',
+    '5l':'normal_video',
+    '6l':'absolute_origin',
+    '7l':'reset_auto_wrap',
+    '8l':'reset_auto_repeat',
+    '9l':'reset_interlacing_mode'
+}
+
+CONQUE_ESCAPE_HASH = {
+    '8':'screen_alignment_test'
+} 
+#    '3':'double_height_top',
+#    '4':'double_height_bottom',
+#    '5':'single_height_single_width',
+#    '6':'single_height_double_width',
+
+# Font codes {{{
+CONQUE_FONT = {
+    0: {'description':'Normal (default)', 'attributes': {'cterm':'NONE','ctermfg':'NONE','ctermbg':'NONE','gui':'NONE','guifg':'NONE','guibg':'NONE'}, 'normal':True},
+    1: {'description':'Bold', 'attributes': {'cterm':'BOLD','gui':'BOLD'}, 'normal':False},
+    4: {'description':'Underlined', 'attributes': {'cterm':'UNDERLINE','gui':'UNDERLINE'}, 'normal':False},
+    5: {'description':'Blink (appears as Bold)', 'attributes': {'cterm':'BOLD','gui':'BOLD'}, 'normal':False},
+    7: {'description':'Inverse', 'attributes': {'cterm':'REVERSE','gui':'REVERSE'}, 'normal':False},
+    8: {'description':'Invisible (hidden)', 'attributes': {'ctermfg':'0','ctermbg':'0','guifg':'#000000','guibg':'#000000'}, 'normal':False},
+    22: {'description':'Normal (neither bold nor faint)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    24: {'description':'Not underlined', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    25: {'description':'Steady (not blinking)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    27: {'description':'Positive (not inverse)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    28: {'description':'Visible (not hidden)', 'attributes': {'ctermfg':'NONE','ctermbg':'NONE','guifg':'NONE','guibg':'NONE'}, 'normal':True},
+    30: {'description':'Set foreground color to Black', 'attributes': {'ctermfg':'16','guifg':'#000000'}, 'normal':False},
+    31: {'description':'Set foreground color to Red', 'attributes': {'ctermfg':'1','guifg':'#ff0000'}, 'normal':False},
+    32: {'description':'Set foreground color to Green', 'attributes': {'ctermfg':'2','guifg':'#00ff00'}, 'normal':False},
+    33: {'description':'Set foreground color to Yellow', 'attributes': {'ctermfg':'3','guifg':'#ffff00'}, 'normal':False},
+    34: {'description':'Set foreground color to Blue', 'attributes': {'ctermfg':'4','guifg':'#0000ff'}, 'normal':False},
+    35: {'description':'Set foreground color to Magenta', 'attributes': {'ctermfg':'5','guifg':'#990099'}, 'normal':False},
+    36: {'description':'Set foreground color to Cyan', 'attributes': {'ctermfg':'6','guifg':'#009999'}, 'normal':False},
+    37: {'description':'Set foreground color to White', 'attributes': {'ctermfg':'7','guifg':'#ffffff'}, 'normal':False},
+    39: {'description':'Set foreground color to default (original)', 'attributes': {'ctermfg':'NONE','guifg':'NONE'}, 'normal':True},
+    40: {'description':'Set background color to Black', 'attributes': {'ctermbg':'16','guibg':'#000000'}, 'normal':False},
+    41: {'description':'Set background color to Red', 'attributes': {'ctermbg':'1','guibg':'#ff0000'}, 'normal':False},
+    42: {'description':'Set background color to Green', 'attributes': {'ctermbg':'2','guibg':'#00ff00'}, 'normal':False},
+    43: {'description':'Set background color to Yellow', 'attributes': {'ctermbg':'3','guibg':'#ffff00'}, 'normal':False},
+    44: {'description':'Set background color to Blue', 'attributes': {'ctermbg':'4','guibg':'#0000ff'}, 'normal':False},
+    45: {'description':'Set background color to Magenta', 'attributes': {'ctermbg':'5','guibg':'#990099'}, 'normal':False},
+    46: {'description':'Set background color to Cyan', 'attributes': {'ctermbg':'6','guibg':'#009999'}, 'normal':False},
+    47: {'description':'Set background color to White', 'attributes': {'ctermbg':'7','guibg':'#ffffff'}, 'normal':False},
+    49: {'description':'Set background color to default (original).', 'attributes': {'ctermbg':'NONE','guibg':'NONE'}, 'normal':True},
+    90: {'description':'Set foreground color to Black', 'attributes': {'ctermfg':'8','guifg':'#000000'}, 'normal':False},
+    91: {'description':'Set foreground color to Red', 'attributes': {'ctermfg':'9','guifg':'#ff0000'}, 'normal':False},
+    92: {'description':'Set foreground color to Green', 'attributes': {'ctermfg':'10','guifg':'#00ff00'}, 'normal':False},
+    93: {'description':'Set foreground color to Yellow', 'attributes': {'ctermfg':'11','guifg':'#ffff00'}, 'normal':False},
+    94: {'description':'Set foreground color to Blue', 'attributes': {'ctermfg':'12','guifg':'#0000ff'}, 'normal':False},
+    95: {'description':'Set foreground color to Magenta', 'attributes': {'ctermfg':'13','guifg':'#990099'}, 'normal':False},
+    96: {'description':'Set foreground color to Cyan', 'attributes': {'ctermfg':'14','guifg':'#009999'}, 'normal':False},
+    97: {'description':'Set foreground color to White', 'attributes': {'ctermfg':'15','guifg':'#ffffff'}, 'normal':False},
+    100: {'description':'Set background color to Black', 'attributes': {'ctermbg':'8','guibg':'#000000'}, 'normal':False},
+    101: {'description':'Set background color to Red', 'attributes': {'ctermbg':'9','guibg':'#ff0000'}, 'normal':False},
+    102: {'description':'Set background color to Green', 'attributes': {'ctermbg':'10','guibg':'#00ff00'}, 'normal':False},
+    103: {'description':'Set background color to Yellow', 'attributes': {'ctermbg':'11','guibg':'#ffff00'}, 'normal':False},
+    104: {'description':'Set background color to Blue', 'attributes': {'ctermbg':'12','guibg':'#0000ff'}, 'normal':False},
+    105: {'description':'Set background color to Magenta', 'attributes': {'ctermbg':'13','guibg':'#990099'}, 'normal':False},
+    106: {'description':'Set background color to Cyan', 'attributes': {'ctermbg':'14','guibg':'#009999'}, 'normal':False},
+    107: {'description':'Set background color to White', 'attributes': {'ctermbg':'15','guibg':'#ffffff'}, 'normal':False}
+} 
+# }}}
+
+# regular expression matching (almost) all control sequences
+CONQUE_SEQ_REGEX       = re.compile(ur"(\u001b\[?\??#?[0-9;]*[a-zA-Z@]|\u001b\][0-9];.*?\u0007|[\u0007-\u000f])", re.UNICODE)
+CONQUE_SEQ_REGEX_CTL   = re.compile(ur"^[\u0007-\u000f]$", re.UNICODE)
+CONQUE_SEQ_REGEX_CSI   = re.compile(ur"^\u001b\[", re.UNICODE)
+CONQUE_SEQ_REGEX_TITLE = re.compile(ur"^\u001b\]", re.UNICODE)
+CONQUE_SEQ_REGEX_HASH  = re.compile(ur"^\u001b#", re.UNICODE)
+CONQUE_SEQ_REGEX_ESC   = re.compile(ur"^\u001b", re.UNICODE)
+
+# match table output
+CONQUE_TABLE_OUTPUT   = re.compile("^\s*\|\s.*\s\|\s*$|^\s*\+[=+-]+\+\s*$")
+
+# }}}
+
+###################################################################################################
+class Conque:
+
+    # CLASS PROPERTIES {{{ 
+
+    # screen object
+    screen          = None
+
+    # subprocess object
+    proc            = None
+
+    # terminal dimensions and scrolling region
+    columns         = 80 # same as $COLUMNS
+    lines           = 24 # same as $LINES
+    working_columns = 80 # can be changed by CSI ? 3 l/h
+    working_lines   = 24 # can be changed by CSI r
+
+    # top/bottom of the scroll region
+    top             = 1  # relative to top of screen
+    bottom          = 24 # relative to top of screen
+
+    # cursor position
+    l               = 1  # current cursor line
+    c               = 1  # current cursor column
+
+    # autowrap mode
+    autowrap        = True
+
+    # absolute coordinate mode
+    absolute_coords = True
+
+    # tabstop positions
+    tabstops        = []
+
+    # enable colors
+    enable_colors = True
+
+    # color changes
+    color_changes = {}
+
+    # color history
+    color_history = {}
+
+    # don't wrap table output
+    unwrap_tables = True
+
+    # wrap CUF/CUB around line breaks
+    wrap_cursor = False
+
+    # }}}
+
+    # constructor
+    def __init__(self): # {{{
+        self.screen = ConqueScreen()
+        # }}}
+
+    # start program and initialize this instance
+    def open(self, command, options): # {{{
+
+        # int vars
+        self.columns = vim.current.window.width
+        self.lines = vim.current.window.height
+        self.working_columns = vim.current.window.width
+        self.working_lines = vim.current.window.height
+        self.bottom = vim.current.window.height
+
+        # init color
+        self.enable_colors = options['color']
+
+        # init tabstops
+        self.init_tabstops()
+
+        # open command
+        self.proc = ConqueSubprocess()
+        self.proc.open(command, { 'TERM' : options['TERM'], 'CONQUE' : '1', 'LINES' : str(self.lines), 'COLUMNS' : str(self.columns)})
+        # }}}
+
+    # write to pty
+    def write(self, input): # {{{
+
+
+        # check if window size has changed
+        self.update_window_size()
+
+        # write and read
+        self.proc.write(input)
+        self.read(1)
+        # }}}
+
+    # read from pty, and update buffer
+    def read(self, timeout = 1): # {{{
+        # read from subprocess
+        output = self.proc.read(timeout)
+        # and strip null chars
+        output = output.replace(chr(0), '')
+
+        if output == '':
+            return
+
+
+
+
+
+        chunks = CONQUE_SEQ_REGEX.split(output)
+
+
+
+
+
+        # don't go through all the csi regex if length is one (no matches)
+        if len(chunks) == 1:
+
+            self.plain_text(chunks[0])
+
+        else:
+            for s in chunks:
+                if s == '':
+                    continue
+
+
+
+
+
+
+                # Check for control character match {{{
+                if CONQUE_SEQ_REGEX_CTL.match(s[0]):
+
+                    nr = ord(s[0])
+                    if nr in CONQUE_CTL:
+                        getattr(self, 'ctl_' + CONQUE_CTL[nr])()
+                    else:
+
+                        pass
+                    # }}}
+
+                # check for escape sequence match {{{
+                elif CONQUE_SEQ_REGEX_CSI.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE:
+                        csi = self.parse_csi(s[2:])
+
+                        getattr(self, 'csi_' + CONQUE_ESCAPE[s[-1]])(csi)
+                    else:
+
+                        pass
+                    # }}}
+        
+                # check for title match {{{
+                elif CONQUE_SEQ_REGEX_TITLE.match(s):
+
+                    self.change_title(s[2], s[4:-1])
+                    # }}}
+        
+                # check for hash match {{{
+                elif CONQUE_SEQ_REGEX_HASH.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE_HASH:
+                        getattr(self, 'hash_' + CONQUE_ESCAPE_HASH[s[-1]])()
+                    else:
+
+                        pass
+                    # }}}
+                
+                # check for other escape match {{{
+                elif CONQUE_SEQ_REGEX_ESC.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE_PLAIN:
+                        getattr(self, 'esc_' + CONQUE_ESCAPE_PLAIN[s[-1]])()
+                    else:
+
+                        pass
+                    # }}}
+                
+                # else process plain text {{{
+                else:
+                    self.plain_text(s)
+                    # }}}
+
+        # set cursor position
+        self.screen.set_cursor(self.l, self.c)
+
+        vim.command('redraw')
+
+
+    # }}}
+
+    # for polling
+    def auto_read(self): # {{{
+        self.read(1)
+        if self.c == 1:
+            vim.command('call feedkeys("\<F23>", "t")')
+        else:
+            vim.command('call feedkeys("\<F22>", "t")')
+        self.screen.set_cursor(self.l, self.c)
+    # }}}
+
+    ###############################################################################################
+    # Plain text # {{{
+
+    def plain_text(self, input):
+
+        current_line = self.screen[self.l]
+
+        if len(current_line) < self.working_columns:
+            current_line = current_line + ' ' * (self.c - len(current_line))
+
+        # if line is wider than screen
+        if self.c + len(input) - 1 > self.working_columns:
+            # Table formatting hack
+            if self.unwrap_tables and CONQUE_TABLE_OUTPUT.match(input):
+                self.screen[self.l] = current_line[ : self.c - 1] + input + current_line[ self.c + len(input) - 1 : ]
+                self.apply_color(self.c, self.c + len(input))
+                self.c += len(input)
+                return
+
+            diff = self.c + len(input) - self.working_columns - 1
+            # if autowrap is enabled
+            if self.autowrap:
+                self.screen[self.l] = current_line[ : self.c - 1] + input[ : -1 * diff ]
+                self.apply_color(self.c, self.working_columns)
+                self.ctl_nl()
+                self.ctl_cr()
+                remaining = input[ -1 * diff : ]
+
+                self.plain_text(remaining)
+            else:
+                self.screen[self.l] = current_line[ : self.c - 1] + input[ : -1 * diff - 1 ] + input[-1]
+                self.apply_color(self.c, self.working_columns)
+                self.c = self.working_columns
+
+        # no autowrap
+        else:
+            self.screen[self.l] = current_line[ : self.c - 1] + input + current_line[ self.c + len(input) - 1 : ]
+            self.apply_color(self.c, self.c + len(input))
+            self.c += len(input)
+
+    def apply_color(self, start, end):
+
+
+        # stop here if coloration is disabled
+        if not self.enable_colors:
+            return
+
+        real_line = self.screen.get_real_line(self.l)
+
+        # check for previous overlapping coloration
+
+        to_del = []
+        if self.color_history.has_key(real_line):
+            for i in range(len(self.color_history[real_line])):
+                syn = self.color_history[real_line][i]
+
+                if syn['start'] >= start and syn['start'] < end:
+
+                    vim.command('syn clear ' + syn['name'])
+                    to_del.append(i)
+                    # outside
+                    if syn['end'] > end:
+
+                        self.exec_highlight(real_line, end, syn['end'], syn['highlight'])
+                elif syn['end'] > start and syn['end'] <= end:
+
+                    vim.command('syn clear ' + syn['name'])
+                    to_del.append(i)
+                    # outside
+                    if syn['start'] < start:
+
+                        self.exec_highlight(real_line, syn['start'], start, syn['highlight'])
+
+        if len(to_del) > 0:
+            to_del.reverse()
+            for di in to_del:
+                del self.color_history[real_line][di]
+
+        # if there are no new colors
+        if len(self.color_changes) == 0:
+            return
+
+        highlight = ''
+        for attr in self.color_changes.keys():
+            highlight = highlight + ' ' + attr + '=' + self.color_changes[attr]
+
+        # execute the highlight
+        self.exec_highlight(real_line, start, end, highlight)
+
+    def exec_highlight(self, real_line, start, end, highlight):
+        unique_key = str(self.proc.pid)
+
+        syntax_name = 'EscapeSequenceAt_' + unique_key + '_' + str(self.l) + '_' + str(start) + '_' + str(len(self.color_history) + 1)
+        syntax_options = ' contains=ALLBUT,ConqueString,MySQLString,MySQLKeyword oneline'
+        syntax_region = 'syntax match ' + syntax_name + ' /\%' + str(real_line) + 'l\%>' + str(start - 1) + 'c.*\%<' + str(end + 1) + 'c/' + syntax_options
+        syntax_highlight = 'highlight ' + syntax_name + highlight
+
+        vim.command(syntax_region)
+        vim.command(syntax_highlight)
+
+        # add syntax name to history
+        if not self.color_history.has_key(real_line):
+            self.color_history[real_line] = []
+
+        self.color_history[real_line].append({'name':syntax_name, 'start':start, 'end':end, 'highlight':highlight})
+
+    # }}}
+
+    ###############################################################################################
+    # Control functions {{{
+
+    def ctl_nl(self):
+        # if we're in a scrolling region, scroll instead of moving cursor down
+        if self.lines != self.working_lines and self.l == self.bottom:
+            del self.screen[self.top]
+            self.screen.insert(self.bottom, '')
+        elif self.l == self.bottom:
+            self.screen.append('')
+        else:
+            self.l += 1
+
+        self.color_changes = {}
+
+    def ctl_cr(self):
+        self.c = 1
+
+        self.color_changes = {}
+
+    def ctl_bs(self):
+        if self.c > 1:
+            self.c += -1
+
+    def ctl_bel(self):
+        print 'BELL'
+
+    def ctl_tab(self):
+        # default tabstop location
+        ts = self.working_columns
+
+        # check set tabstops
+        for i in range(self.c, len(self.tabstops)):
+            if self.tabstops[i]:
+                ts = i + 1
+                break
+
+
+
+        self.c = ts
+
+    # }}}
+
+    ###############################################################################################
+    # CSI functions {{{
+
+    def csi_font(self, csi): # {{{
+        if not self.enable_colors:
+            return
+        
+        # defaults to 0
+        if len(csi['vals']) == 0:
+            csi['vals'] = [0]
+
+        # 256 xterm color foreground
+        if len(csi['vals']) == 3 and csi['vals'][0] == 38 and csi['vals'][1] == 5:
+            self.color_changes['ctermfg'] = str(csi['vals'][2])
+            self.color_changes['guifg'] = '#' + self.xterm_to_rgb(csi['vals'][2])
+
+        # 256 xterm color background
+        elif len(csi['vals']) == 3 and csi['vals'][0] == 48 and csi['vals'][1] == 5:
+            self.color_changes['ctermbg'] = str(csi['vals'][2])
+            self.color_changes['guibg'] = '#' + self.xterm_to_rgb(csi['vals'][2])
+
+        # 16 colors
+        else:
+            for val in csi['vals']:
+                if CONQUE_FONT.has_key(val):
+
+                    # ignore starting normal colors
+                    if CONQUE_FONT[val]['normal'] and len(self.color_changes) == 0:
+
+                        continue
+                    # clear color changes
+                    elif CONQUE_FONT[val]['normal']:
+
+                        self.color_changes = {}
+                    # save these color attributes for next plain_text() call
+                    else:
+
+                        for attr in CONQUE_FONT[val]['attributes'].keys():
+                            if self.color_changes.has_key(attr) and (attr == 'cterm' or attr == 'gui'):
+                                self.color_changes[attr] += ',' + CONQUE_FONT[val]['attributes'][attr]
+                            else:
+                                self.color_changes[attr] = CONQUE_FONT[val]['attributes'][attr]
+        # }}}
+
+    def csi_clear_line(self, csi): # {{{
+
+
+        # this escape defaults to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+
+
+
+        # 0 means cursor right
+        if csi['val'] == 0:
+            self.screen[self.l] = self.screen[self.l][0 : self.c - 1]
+
+        # 1 means cursor left
+        elif csi['val'] == 1:
+            self.screen[self.l] = ' ' * (self.c) + self.screen[self.l][self.c : ]
+
+        # clear entire line
+        elif csi['val'] == 2:
+            self.screen[self.l] = ''
+
+        # clear colors
+        if csi['val'] == 2 or (csi['val'] == 0 and self.c == 1):
+            real_line = self.screen.get_real_line(self.l)
+            if self.color_history.has_key(real_line):
+                for syn in self.color_history[real_line]:
+                    vim.command('syn clear ' + syn['name'])
+
+
+
+        # }}}
+
+    def csi_cursor_right(self, csi): # {{{
+        # we use 1 even if escape explicitly specifies 0
+        if csi['val'] == 0:
+            csi['val'] = 1
+
+
+
+
+        if self.wrap_cursor and self.c + csi['val'] > self.working_columns:
+            self.l += int(math.floor( (self.c + csi['val']) / self.working_columns ))
+            self.c = (self.c + csi['val']) % self.working_columns
+            return
+
+        self.c = self.bound(self.c + csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_left(self, csi): # {{{
+        # we use 1 even if escape explicitly specifies 0
+        if csi['val'] == 0:
+            csi['val'] = 1
+
+        if self.wrap_cursor and csi['val'] >= self.c:
+            self.l += int(math.floor( (self.c - csi['val']) / self.working_columns ))
+            self.c = self.working_columns - (csi['val'] - self.c) % self.working_columns
+            return
+
+        self.c = self.bound(self.c - csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_to_column(self, csi): # {{{
+        self.c = self.bound(csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_up(self, csi): # {{{
+        self.l = self.bound(self.l - csi['val'], self.top, self.bottom)
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_cursor_down(self, csi): # {{{
+        self.l = self.bound(self.l + csi['val'], self.top, self.bottom)
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_clear_screen(self, csi): # {{{
+        # default to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+        # 2 == clear entire screen
+        if csi['val'] == 2:
+            self.l = 1
+            self.c = 1
+            self.screen.clear()
+
+        # 0 == clear down
+        elif csi['val'] == 0:
+            for l in range(self.bound(self.l + 1, 1, self.lines), self.lines + 1):
+                self.screen[l] = ''
+            
+            # clear end of current line
+            self.csi_clear_line(self.parse_csi('K'))
+
+        # 1 == clear up
+        elif csi['val'] == 1:
+            for l in range(1, self.bound(self.l, 1, self.lines + 1)):
+                self.screen[l] = ''
+
+            # clear beginning of current line
+            self.csi_clear_line(self.parse_csi('1K'))
+
+        # clear coloration
+        if csi['val'] == 2 or csi['val'] == 0:
+            real_line = self.screen.get_real_line(self.l)
+            for line in self.color_history.keys():
+                if line >= real_line:
+                    for syn in self.color_history[line]:
+                        vim.command('syn clear ' + syn['name'])
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_delete_chars(self, csi): # {{{
+        self.screen[self.l] = self.screen[self.l][ : self.c ] + self.screen[self.l][ self.c + csi['val'] : ]
+        # }}}
+
+    def csi_add_spaces(self, csi): # {{{
+        self.screen[self.l] = self.screen[self.l][ : self.c - 1] + ' ' * csi['val'] + self.screen[self.l][self.c : ]
+        # }}}
+
+    def csi_cursor(self, csi): # {{{
+        if len(csi['vals']) == 2:
+            new_line = csi['vals'][0]
+            new_col = csi['vals'][1]
+        else:
+            new_line = 1
+            new_col = 1
+
+        if self.absolute_coords:
+            self.l = self.bound(new_line, 1, self.lines)
+        else:
+            self.l = self.bound(self.top + new_line - 1, self.top, self.bottom)
+
+        self.c = self.bound(new_col, 1, self.working_columns)
+        if self.c > len(self.screen[self.l]):
+            self.screen[self.l] = self.screen[self.l] + ' ' * (self.c - len(self.screen[self.l]))
+
+        # }}}
+
+    def csi_set_coords(self, csi): # {{{
+        if len(csi['vals']) == 2:
+            new_start = csi['vals'][0]
+            new_end = csi['vals'][1]
+        else:
+            new_start = 1
+            new_end = vim.current.window.height
+
+        self.top = new_start
+        self.bottom = new_end
+        self.working_lines = new_end - new_start + 1
+
+        # if cursor is outside scrolling region, reset it
+        if self.l < self.top:
+            self.l = self.top
+        elif self.l > self.bottom:
+            self.l = self.bottom
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_tab_clear(self, csi): # {{{
+        # this escape defaults to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+
+
+        if csi['val'] == 0:
+            self.tabstops[self.c - 1] = False
+        elif csi['val'] == 3:
+            for i in range(0, self.columns + 1):
+                self.tabstops[i] = False
+        # }}}
+
+    def csi_set(self, csi): # {{{
+        # 132 cols
+        if csi['val'] == 3: 
+            self.csi_clear_screen(self.parse_csi('2J'))
+            self.working_columns = 132
+
+        # relative_origin
+        elif csi['val'] == 6: 
+            self.absolute_coords = False
+
+        # set auto wrap
+        elif csi['val'] == 7: 
+            self.autowrap = True
+
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_reset(self, csi): # {{{
+        # 80 cols
+        if csi['val'] == 3: 
+            self.csi_clear_screen(self.parse_csi('2J'))
+            self.working_columns = 80
+
+        # absolute origin
+        elif csi['val'] == 6: 
+            self.absolute_coords = True
+
+        # reset auto wrap
+        elif csi['val'] == 7: 
+            self.autowrap = False
+
+
+        self.color_changes = {}
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # ESC functions {{{
+
+    def esc_scroll_up(self): # {{{
+        self.ctl_nl()
+
+        self.color_changes = {}
+        # }}}
+
+    def esc_next_line(self): # {{{
+        self.ctl_nl()
+        self.c = 1
+        # }}}
+
+    def esc_set_tab(self): # {{{
+
+        if self.c <= len(self.tabstops):
+            self.tabstops[self.c - 1] = True
+        # }}}
+
+    def esc_scroll_down(self): # {{{
+        if self.l == self.top:
+            del self.screen[self.bottom]
+            self.screen.insert(self.top, '')
+        else:
+            self.l += -1
+
+        self.color_changes = {}
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # HASH functions {{{
+
+    def hash_screen_alignment_test(self): # {{{
+        self.csi_clear_screen(self.parse_csi('2J'))
+        self.working_lines = self.lines
+        for l in range(1, self.lines + 1):
+            self.screen[l] = 'E' * self.working_columns
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # Random stuff {{{
+
+    def change_title(self, key, val):
+
+
+        if key == '0' or key == '2':
+
+            vim.command('setlocal statusline=' + re.escape(val))
+
+    def paste(self):
+        self.write(vim.eval('@@'))
+        self.read(50)
+
+    def paste_selection(self):
+        self.write(vim.eval('@@'))
+
+    def update_window_size(self):
+        # resize if needed
+        if vim.current.window.width != self.columns or vim.current.window.height != self.lines:
+
+            # reset all window size attributes to default
+            self.columns = vim.current.window.width
+            self.lines = vim.current.window.height
+            self.working_columns = vim.current.window.width
+            self.working_lines = vim.current.window.height
+            self.bottom = vim.current.window.height
+
+            # reset screen object attributes
+            self.l = self.screen.reset_size(self.l)
+
+            # reset tabstops
+            self.init_tabstops()
+
+
+
+            # signal process that screen size has changed
+            self.proc.window_resize(self.lines, self.columns)
+
+    def init_tabstops(self):
+        for i in range(0, self.columns + 1):
+            if i % 8 == 0:
+                self.tabstops.append(True)
+            else:
+                self.tabstops.append(False)
+
+    # }}}
+
+    ###############################################################################################
+    # Utility {{{
+    
+    def parse_csi(self, s): # {{{
+        attr = { 'key' : s[-1], 'flag' : '', 'val' : 1, 'vals' : [] }
+
+        if len(s) == 1:
+            return attr
+
+        full = s[0:-1]
+
+        if full[0] == '?':
+            full = full[1:]
+            attr['flag'] = '?'
+
+        if full != '':
+            vals = full.split(';')
+            for val in vals:
+
+                val = re.sub("\D", "", val)
+
+                if val != '':
+                    attr['vals'].append(int(val))
+
+        if len(attr['vals']) == 1:
+            attr['val'] = int(attr['vals'][0])
+            
+        return attr
+        # }}}
+
+    def bound(self, val, min, max): # {{{
+        if val > max:
+            return max
+
+        if val < min:
+            return min
+
+        return val
+        # }}}
+
+    def xterm_to_rgb(self, color_code): # {{{
+        if color_code < 16:
+            ascii_colors = ['000000', 'CD0000', '00CD00', 'CDCD00', '0000EE', 'CD00CD', '00CDCD', 'E5E5E5', 
+                   '7F7F7F', 'FF0000', '00FF00', 'FFFF00', '5C5CFF', 'FF00FF', '00FFFF', 'FFFFFF']
+            return ascii_colors[color_code]
+
+        elif color_code < 232:
+            cc = int(color_code) - 16
+
+            p1 = "%02x" % (math.floor(cc / 36) * (255/5))
+            p2 = "%02x" % (math.floor((cc % 36) / 6) * (255/5))
+            p3 = "%02x" % (math.floor(cc % 6) * (255/5))
+
+            return p1 + p2 + p3
+        else:
+            grey_tone = "%02x" % math.floor((255/24) * (color_code - 232))
+            return grey_tone + grey_tone + grey_tone
+        # }}}
+
+    # }}}
+
+
+import os, signal, pty, tty, select, fcntl, termios, struct
+
+###################################################################################################
+class ConqueSubprocess:
+
+    # process id
+    pid = 0
+    
+    # stdout+stderr file descriptor
+    fd = None
+
+    # constructor
+    def __init__(self): # {{{
+        self.pid = 0
+        # }}}
+
+    # create the pty or whatever (whatever == windows)
+    def open(self, command, env = {}): # {{{
+        command_arr  = command.split()
+        executable   = command_arr[0]
+        args         = command_arr
+
+        try:
+            self.pid, self.fd = pty.fork()
+
+        except:
+            pass
+
+
+        # child proc, replace with command after altering terminal attributes
+        if self.pid == 0:
+
+            # set requested environment variables
+            for k in env.keys():
+                os.environ[k] = env[k]
+
+            # set some attributes
+            try:
+                attrs = tty.tcgetattr(1)
+                attrs[0] = attrs[0] ^ tty.IGNBRK
+                attrs[0] = attrs[0] | tty.BRKINT | tty.IXANY | tty.IMAXBEL
+                attrs[2] = attrs[2] | tty.HUPCL
+                attrs[3] = attrs[3] | tty.ICANON | tty.ECHO | tty.ISIG | tty.ECHOKE
+                attrs[6][tty.VMIN]  = 1
+                attrs[6][tty.VTIME] = 0
+                tty.tcsetattr(1, tty.TCSANOW, attrs)
+            except:
+                pass
+
+            os.execvp(executable, args)
+
+        # else master, do nothing
+        else:
+            pass
+
+        # }}}
+
+    # read from pty
+    # XXX - select.poll() doesn't work in OS X!!!!!!!
+    def read(self, timeout = 1): # {{{
+
+        output = ''
+        read_timeout = float(timeout) / 1000
+
+        try:
+            # what, no do/while?
+            while 1:
+                s_read, s_write, s_error = select.select( [ self.fd ], [], [], read_timeout)
+
+                lines = ''
+                for s_fd in s_read:
+                    try:
+                        lines = os.read( self.fd, 32 )
+                    except:
+                        pass
+                    output = output + lines
+
+                if lines == '':
+                    break
+        except:
+            pass
+
+        return output
+        # }}}
+
+    # I guess this one's not bad
+    def write(self, input): # {{{
+        try:
+            os.write(self.fd, input)
+        except:
+            pass
+        # }}}
+
+    # signal process
+    def signal(self, signum): # {{{
+        try:
+            os.kill(self.pid, signum)
+        except:
+            pass
+        # }}}
+
+    # get process status
+    def get_status(self): #{{{
+
+        p_status = True
+
+        try:
+            if os.waitpid( self.pid, os.WNOHANG )[0]:
+                p_status = False
+        except:
+            p_status = False
+
+        return p_status
+
+        # }}}
+
+    # update window size in kernel, then send SIGWINCH to fg process
+    def window_resize(self, lines, columns): # {{{
+        try:
+            fcntl.ioctl(self.fd, termios.TIOCSWINSZ, struct.pack("HHHH", lines, columns, 0, 0))
+            os.kill(self.pid, signal.SIGWINCH)
+        except:
+            pass
+
+        # }}}
+
+
+###################################################################################################
+# ConqueScreen is an extention of the vim.current.buffer object
+# It restricts the working indices of the buffer object to the scroll region which pty is expecting
+# It also uses 1-based indexes, to match escape sequence commands
+#
+# E.g.:
+#   s = ConqueScreen()
+#   ...
+#   s[5] = 'Set 5th line in terminal to this line'
+#   s.append('Add new line to terminal')
+#   s[5] = 'Since previous append() command scrolled the terminal down, this is a different line than first cb[5] call'
+#
+
+import vim
+
+class ConqueScreen(object):
+
+    # CLASS PROPERTIES  {{{
+
+    # the buffer
+    buffer          = None
+
+    # screen and scrolling regions
+    screen_top      = 1
+
+    # screen width
+    screen_width    = 80
+    screen_height    = 80
+
+    # }}}
+
+    def __init__(self): # {{{
+        self.buffer = vim.current.buffer
+
+        self.screen_top = 1
+        self.screen_width = vim.current.window.width
+        self.screen_height = vim.current.window.height
+    # }}}
+
+    ###############################################################################################
+    # List overload {{{
+    def __len__(self): # {{{
+        return len(self.buffer)
+    # }}}
+
+    def __getitem__(self, key): # {{{
+        real_line = self.get_real_idx(key)
+
+        # if line is past buffer end, add lines to buffer
+        if real_line >= len(self.buffer):
+            for i in range(len(self.buffer), real_line + 1):
+                self.append(' ' * self.screen_width)
+
+        return self.buffer[ real_line ]
+    # }}}
+
+    def __setitem__(self, key, value): # {{{
+        real_line = self.get_real_idx(key)
+
+        # if line is past end of screen, append
+        if real_line == len(self.buffer):
+            self.buffer.append(value)
+        else:
+            self.buffer[ real_line ] = value
+    # }}}
+
+    def __delitem__(self, key): # {{{
+        del self.buffer[ self.screen_top + key - 2 ]
+    # }}}
+
+    def append(self, value): # {{{
+        if len(self.buffer) > self.screen_top + self.screen_height - 1:
+            self.buffer[len(self.buffer) - 1] = value
+        else:
+            self.buffer.append(value)
+
+        if len(self.buffer) > self.screen_top + self.screen_height - 1:
+            self.screen_top += 1
+        if vim.current.buffer.number == self.buffer.number:
+            vim.command('normal G')
+    # }}}
+
+    def insert(self, line, value): # {{{
+
+        l = self.screen_top + line - 2
+        self.buffer[l:l] = [ value ]
+    
+    # }}}
+    # }}}
+
+    ###############################################################################################
+    # Util {{{
+    def get_top(self): # {{{
+        return self.screen_top
+    # }}}
+
+    def get_real_idx(self, line): # {{{
+        return (self.screen_top + line - 2)
+    # }}}
+
+    def get_real_line(self, line): # {{{
+        return (self.screen_top + line - 1)
+    # }}}
+
+    def set_screen_width(self, width): # {{{
+        self.screen_width = width
+    # }}}
+
+    # }}}
+
+    ###############################################################################################
+    def clear(self): # {{{
+        self.buffer.append(' ')
+        vim.command('normal Gzt')
+        self.screen_top = len(self.buffer)
+    # }}}
+
+    def set_cursor(self, line, column): # {{{
+        # figure out line
+        real_line =  self.screen_top + line - 1
+        if real_line > len(self.buffer):
+            for l in range(len(self.buffer) - 1, real_line):
+                self.buffer.append('')
+
+        # figure out column
+        real_column = column
+        if len(self.buffer[real_line - 1]) < real_column:
+            self.buffer[real_line - 1] = self.buffer[real_line - 1] + ' ' * (real_column - len(self.buffer[real_line - 1]))
+
+        # python version is occasionally grumpy
+        try:
+            vim.current.window.cursor = (real_line, real_column - 1)
+        except:
+            vim.command('call cursor(' + str(real_line) + ', ' + str(real_column) + ')')
+    # }}}
+
+    def reset_size(self, line): # {{{
+
+
+
+
+        # save cursor line number
+        real_line = self.screen_top + line
+
+        # reset screen size
+        self.screen_width = vim.current.window.width
+        self.screen_height = vim.current.window.height
+        self.screen_top = len(self.buffer) - vim.current.window.height + 1
+        if self.screen_top < 1:
+            self.screen_top = 1
+
+
+        # align bottom of buffer to bottom of screen
+        vim.command('normal ' + str(self.screen_height) + 'kG')
+
+        # return new relative line number
+        return (real_line - self.screen_top)
+    # }}}
+
+    def scroll_to_bottom(self): # {{{
+        vim.current.window.cursor = (len(self.buffer) - 1, 1)
+    # }}}
+        
+    def align(self): # {{{
+        # align bottom of buffer to bottom of screen
+        vim.command('normal ' + str(self.screen_height) + 'kG')
+    # }}}
+
+
+EOF
+
+endif
+

autoload/loremipsum.txt

+Lorem ipsum dolor sit amet...
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis splople autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
+
+Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.
+
+Nunc varius risus quis nulla. Vivamus vel magna. Ut rutrum. Aenean dignissim, leo quis faucibus semper, massa est faucibus massa, sit amet pharetra arcu nunc et sem. Aliquam tempor. Nam lobortis sem non urna. Pellentesque et urna sit amet leo accumsan volutpat. Nam molestie lobortis lorem. Quisque eu nulla. Donec id orci in ligula dapibus egestas. Donec sed velit ac lectus mattis sagittis.
+
+In hac habitasse platea dictumst. Maecenas in ligula. Duis tincidunt odio sollicitudin quam. Nullam non mauris. Phasellus lacinia, velit sit amet bibendum euismod, leo diam interdum ligula, eu scelerisque sem purus in tellus.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In sit amet nunc id quam porta varius. Ut aliquet facilisis turpis. Etiam pellentesque quam et erat. Praesent suscipit justo.
+
+Cras nec metus pulvinar sem tempor hendrerit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nullam in nulla. Mauris elementum. Curabitur tempor, quam ac rutrum placerat, nunc augue ullamcorper est, vitae molestie neque nunc a nunc. Integer justo dolor, consequat id, rutrum auctor, ullamcorper sed, orci. In hac habitasse platea dictumst. Fusce euismod semper orci. Integer venenatis quam non nunc. Vivamus in lorem a nisi aliquet commodo. Suspendisse massa lorem, dignissim at, vehicula et, ornare non, libero. Donec molestie, velit quis dictum scelerisque, est lectus hendrerit lorem, eget dignissim orci nisl sit amet massa. Etiam volutpat lobortis eros. Nunc ac tellus in sapien molestie rhoncus. Pellentesque nisl. Praesent venenatis blandit velit. Fusce rutrum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque vitae erat. Vivamus porttitor cursus lacus. Pellentesque tellus. Nunc aliquam interdum felis. Nulla imperdiet leo. Mauris hendrerit, sem at mollis pharetra, leo sapien pretium elit, a faucibus sapien dolor vel pede. Vestibulum et enim ut nulla sollicitudin adipiscing. Suspendisse malesuada venenatis mauris. Curabitur ornare mollis velit. Sed vitae metus. Morbi posuere mi id odio. Donec elit sem, tempor at, pharetra eu, sodales sit amet, elit.
+
+Curabitur urna tellus, aliquam vitae, ultrices eget, vehicula nec, diam. Integer elementum, felis non faucibus euismod, erat massa dictum eros, eu ornare ligula tortor et mauris. Cras molestie magna in nibh. Aenean et tellus. Fusce adipiscing commodo erat. In eu justo. Nulla dictum, erat sed blandit venenatis, arcu dolor molestie dolor, vitae congue orci risus a nulla. Pellentesque sit amet arcu. In mattis laoreet enim. Pellentesque id augue et arcu blandit tincidunt. Pellentesque elit ante, rhoncus quis, dapibus sit amet, tincidunt eu, nibh. In imperdiet. Nunc lectus neque, commodo eget, porttitor quis, fringilla quis, purus.
+
+Duis sagittis dignissim eros. In sit amet lectus. Fusce lacinia mauris vitae nisl interdum condimentum. Etiam in magna ac nibh ultrices vehicula. Maecenas commodo facilisis lectus. Praesent sed mi. Phasellus ipsum. Donec quis tellus id lectus faucibus molestie. Praesent vel ligula. Nam venenatis neque quis mauris. Proin felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam quam. Nam felis velit, semper nec, aliquam nec, iaculis vel, mi. Nullam et augue vitae nunc tristique vehicula. Suspendisse eget elit. Duis adipiscing dui non quam.
+
+Duis posuere tortor sit amet est iaculis egestas. Ut at magna. Etiam dui nisi, blandit quis, fermentum vitae, auctor vel, sem. Cras et leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin luctus, odio eu porttitor adipiscing, ante elit tristique tortor, sit amet malesuada tortor nisi sit amet neque. Praesent rhoncus eros non velit. Pellentesque mattis. Sed sit amet ante. Mauris ac nibh eget risus volutpat tempor. Praesent volutpat sollicitudin dui. Sed in tellus id urna viverra commodo. Vestibulum enim felis, interdum non, sollicitudin in, posuere a, sem. Cras nibh.
+
+Sed facilisis ultrices dolor. Vestibulum pretium mauris sed turpis. Phasellus a pede id odio interdum elementum. Nam urna felis, sodales ut, luctus vel, condimentum vitae, est. Vestibulum ut augue. Nunc laoreet sapien quis neque semper dictum. Phasellus rhoncus est id turpis. Vestibulum in elit at odio pellentesque volutpat. Nam nec tortor. Suspendisse porttitor consequat nulla. Morbi suscipit tincidunt nisi. Sed laoreet, mauris et tincidunt facilisis, est nisi pellentesque ligula, sit amet convallis neque dolor at sapien. Aenean viverra justo ac sem.
+
+Pellentesque at dolor non lectus sagittis semper. Donec quis mi. Duis eget pede. Phasellus arcu tellus, ultricies id, consequat id, lobortis nec, diam. Suspendisse sed nunc. Pellentesque id magna. Morbi interdum quam at est. Maecenas eleifend mi in urna. Praesent et lectus ac nibh luctus viverra. In vel dolor sed nibh sollicitudin tincidunt. Ut consequat nisi sit amet nibh. Nunc mi tortor, tristique sit amet, rhoncus porta, malesuada elementum, nisi. Integer vitae enim quis risus aliquet gravida. Curabitur vel lorem vel erat dapibus lobortis. Donec dignissim tellus at arcu. Quisque molestie pulvinar sem.
+
+Nulla magna neque, ullamcorper tempus, luctus eget, malesuada ut, velit. Morbi felis. Praesent in purus at ipsum cursus posuere. Morbi bibendum facilisis eros. Phasellus aliquam sapien in erat. Praesent venenatis diam dignissim dui. Praesent risus erat, iaculis ac, dapibus sed, imperdiet ac, erat. Nullam sed ipsum. Phasellus non dolor. Donec ut elit.
+
+Sed risus.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum sem lacus, commodo vitae, aliquam ut, posuere eget, dui. Praesent massa dui, mattis et, vehicula auctor, iaculis id, diam. Morbi viverra neque sit amet risus. Nunc pellentesque aliquam orci. Proin neque elit, mollis vel, tristique nec, varius consectetuer, lorem. Nam malesuada ornare nunc. Duis turpis turpis, fermentum a, aliquet quis, sodales at, dolor. Duis eget velit eget risus fringilla hendrerit. Nulla facilisi. Mauris turpis pede, aliquet ac, mattis sed, consequat in, massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam egestas posuere metus. Aliquam erat volutpat. Donec non tortor. Vivamus posuere nisi mollis dolor. Quisque porttitor nisi ac elit. Nullam tincidunt ligula vitae nulla.
+
+Vivamus sit amet risus et ipsum viverra malesuada. Duis luctus. Curabitur adipiscing metus et felis. Vestibulum tortor. Pellentesque purus. Donec pharetra, massa quis malesuada auctor, tortor ipsum lobortis ipsum, eget facilisis ante nisi eget lectus. Sed a est. Aliquam nec felis eu sem euismod viverra. Suspendisse felis mi, dictum id, convallis ac, mattis non, nibh. Donec sagittis quam eu mauris. Phasellus et leo at quam dapibus pellentesque. In non lacus. Nullam tristique nunc ut arcu scelerisque aliquam. Nullam viverra magna vitae leo. Vestibulum in lacus sit amet lectus tempus aliquet. Duis cursus nisl ac orci. Donec non nisl. Mauris lacus sapien, congue a, facilisis at, egestas vel, quam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae.
+
+Phasellus ipsum odio, suscipit nec, fringilla at, vehicula quis, tellus. Phasellus gravida condimentum dui. Aenean imperdiet arcu vitae ipsum. Duis dapibus, nisi non porttitor iaculis, ligula odio sollicitudin mauris, non luctus nunc massa a velit. Fusce ac nisi. Integer volutpat elementum metus. Vivamus luctus ultricies diam. Curabitur euismod. Vivamus quam. Nunc ante. Nulla mi nulla, vehicula nec, ultrices a, tincidunt vel, enim.
+
+Suspendisse potenti. Aenean sed velit. Nunc a urna quis turpis imperdiet sollicitudin. Mauris aliquam mauris ut tortor. Pellentesque tincidunt mattis nibh. In id lectus eu magna vulputate ultrices. Aliquam interdum varius enim. Maecenas at mauris. Sed sed nibh. Nam non turpis. Maecenas fermentum nibh in est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+
+Duis sagittis fermentum nunc. Nullam elementum erat. Quisque dapibus, augue nec dapibus bibendum, velit enim scelerisque sem, accumsan suscipit lectus odio ac justo. Fusce in felis a enim rhoncus placerat. Cras nec eros et mi egestas facilisis. In hendrerit tincidunt neque. Maecenas tellus. Fusce sollicitudin molestie dui. Sed magna orci, accumsan nec, viverra non, pharetra id, dui.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam placerat mi vitae felis. In porta, quam sit amet sodales elementum, elit dolor aliquam elit, a commodo nisi felis nec nibh. Nulla facilisi. Etiam at tortor. Vivamus quis sapien nec magna scelerisque lobortis.
+
+Curabitur tincidunt viverra justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed eros ante, mattis ullamcorper, posuere quis, tempor vel, metus. Maecenas cursus cursus lacus. Sed risus magna, aliquam sed, suscipit sit amet, porttitor quis, odio. Suspendisse cursus justo nec urna. Suspendisse potenti. In hac habitasse platea dictumst. Cras quis lacus. Vestibulum rhoncus congue lacus. Vivamus euismod, felis quis commodo viverra, dolor elit dictum ante, et mollis eros augue at est. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nulla lectus sem, tristique sed, semper in, hendrerit non, sem. Vivamus dignissim massa in ipsum. Morbi fringilla ullamcorper ligula. Nunc turpis. Mauris vitae sapien. Nunc luctus bibendum velit.
+
+Morbi faucibus volutpat sapien. Nam ac mauris at justo adipiscing facilisis. Nunc et velit. Donec auctor, nulla id laoreet volutpat, pede erat feugiat ante, auctor facilisis dui augue non turpis. Suspendisse mattis metus et justo. Aliquam erat volutpat. Suspendisse potenti. Nam hendrerit lorem commodo metus laoreet ullamcorper. Proin vel nunc a felis sollicitudin pretium. Maecenas in metus at mi mollis posuere. Quisque ac quam sed massa adipiscing rutrum. Vestibulum ipsum. Phasellus porta sapien. Maecenas venenatis tellus vel tellus.
+
+Aliquam aliquam dolor at justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Morbi pretium purus a magna. Nullam dui tellus, blandit eu, facilisis non, pharetra consectetuer, leo. Maecenas sit amet ante sagittis magna imperdiet pulvinar. Vestibulum a lacus at sapien suscipit tempus. Proin pulvinar velit sed nulla. Curabitur aliquet leo ac massa. Praesent posuere lectus vitae odio. Donec imperdiet urna vel ante. In semper accumsan diam. Vestibulum porta justo. Suspendisse egestas commodo eros.
+
+Suspendisse tincidunt mi vel metus. Vivamus non urna in nisi gravida congue. Aenean semper orci a eros. Praesent dictum. Maecenas pharetra odio ut dui. Pellentesque ut orci. Sed lobortis, velit at laoreet suscipit, quam est sagittis nibh, id varius ipsum quam ac metus. Phasellus est nibh, bibendum non, dictum sed, vehicula in, sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Mauris sollicitudin. Duis congue tincidunt orci. Integer blandit neque ut quam. Morbi mollis. Integer lacinia. Praesent blandit elementum sapien. Praesent enim mauris, suscipit a, auctor et, lacinia vitae, nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent lacus diam, auctor quis, venenatis in, hendrerit at, est. Vivamus eget eros. Phasellus congue, sapien ac iaculis feugiat, lacus lacus accumsan lorem, quis volutpat justo turpis ac mauris.
+
+Duis velit magna, scelerisque vitae, varius ut, aliquam vel, justo. Proin ac augue. Nullam auctor lectus vitae arcu. Vestibulum porta justo placerat purus. Ut sem nunc, vestibulum nec, sodales vitae, vehicula eget, ipsum. Sed nec tortor. Aenean malesuada. Nunc convallis, massa eu vestibulum commodo, quam mauris interdum arcu, at pellentesque diam metus ut nulla. Vestibulum eu dolor sit amet lacus varius fermentum. Morbi dolor enim, pulvinar eget, lobortis ac, fringilla ac, turpis. Duis ac erat. Etiam consequat. Integer sed est eu elit pellentesque dapibus. Duis venenatis magna feugiat nisi. Vestibulum et turpis. Maecenas a enim. Suspendisse ultricies ornare justo. Fusce sit amet nisi sed arcu condimentum venenatis. Vivamus dui. Nunc accumsan, quam a fermentum mattis, magna sapien iaculis pede, at porttitor quam odio at est.
+
+Proin eleifend nisi et nibh. Maecenas a lacus. Mauris porta quam non massa molestie scelerisque. Nulla sed ante at lorem suscipit rutrum. Nam quis tellus. Cras elit nisi, ornare a, condimentum vitae, rutrum sit amet, tellus. Maecenas a dolor. Praesent tempor, felis eget gravida blandit, urna lacus faucibus velit, in consectetuer sapien erat nec quam. Integer bibendum odio sit amet neque. Integer imperdiet rhoncus mi. Pellentesque malesuada purus id purus. Quisque viverra porta lectus. Sed lacus leo, feugiat at, consectetuer eu, luctus quis, risus. Suspendisse faucibus orci et nunc. Nullam vehicula fermentum risus. Fusce felis nibh, dignissim vulputate, ultrices quis, lobortis et, arcu. Duis aliquam libero non diam.
+
+Vestibulum placerat tincidunt tortor. Ut vehicula ligula quis lectus. In eget velit. Quisque vel risus. Mauris pede. Nullam ornare sapien sit amet nisl. Cras tortor. Donec tortor lorem, dignissim sit amet, pulvinar eget, mattis eu, metus. Cras vestibulum erat ultrices neque. Praesent rhoncus, dui blandit pellentesque congue, mauris mi ullamcorper odio, eget ultricies nunc felis in augue. Nullam porta nunc. Donec in pede ac mauris mattis eleifend. Cras a libero vel est lacinia dictum. In hac habitasse platea dictumst. Nullam malesuada molestie lorem. Nunc non mauris. Nam accumsan tortor gravida elit. Cras porttitor.
+
+Praesent vel enim sed eros luctus imperdiet. Mauris neque ante, placerat at, mollis vitae, faucibus quis, leo. Ut feugiat. Vivamus urna quam, congue vulputate, convallis non, cursus cursus, risus. Quisque aliquet. Donec vulputate egestas elit. Morbi dictum, sem sit amet aliquam euismod, odio tortor pellentesque odio, ac ultrices enim nibh sed quam. Integer tortor velit, condimentum a, vestibulum eget, sagittis nec, neque. Aenean est urna, bibendum et, imperdiet at, rhoncus in, arcu. In hac habitasse platea dictumst. Vestibulum blandit dignissim dui. Maecenas vitae magna non felis ornare consectetuer. Sed lorem. Nam leo. In eget pede. Donec porta.
+
+Etiam facilisis. Nam suscipit. Ut consectetuer leo vehicula augue. Aliquam cursus. Integer pharetra rhoncus massa. Cras et ligula vel quam tristique commodo. Sed est lectus, mollis quis, lacinia id, sollicitudin nec, eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi urna dui, fermentum quis, feugiat imperdiet, imperdiet id, sapien. Phasellus auctor nunc. Vivamus eget augue quis neque vestibulum placerat. Duis placerat. Maecenas accumsan rutrum lacus. Vestibulum lacinia semper nibh. Aenean diam odio, scelerisque at, ullamcorper nec, tincidunt dapibus, quam. Duis vel ante nec tortor porta mollis. Praesent orci. Cras dignissim vulputate metus.
+
+Phasellus eu quam. Quisque interdum cursus purus. In orci. Maecenas vehicula. Sed et mauris. Praesent feugiat viverra lacus. Suspendisse pulvinar lacus ut nunc. Quisque nisi. Suspendisse id risus nec nisi ultrices ornare. Donec eget tellus. Nullam molestie placerat felis. Aenean facilisis. Nunc erat. Integer in tellus. Mauris volutpat, neque vel ornare porttitor, dolor nisi sagittis dolor, sit amet bibendum orci leo blandit lacus.
+
+In id velit sodales arcu iaculis venenatis. Etiam at leo. Vivamus vitae sem. Mauris volutpat congue risus. Curabitur leo. Aenean tempor tortor eget ligula. Aenean vel augue. Vestibulum ac justo. In hac habitasse platea dictumst. Nam dignissim nisi non mauris. Donec et tortor. Morbi felis. Donec aliquet, erat eu ultrices tincidunt, lorem mi sagittis lectus, ut feugiat pede lacus quis sapien. Suspendisse porta, felis a fermentum interdum, dui nisl sodales felis, ut fermentum sapien nibh eu nunc.
+
+Lorem ipsum dolor sit amet. Integer sed magna. Duis nisl nulla, porta ut, molestie sit amet, tincidunt eu, enim. Cras eu mauris. Cras iaculis, nisi vel tempor fringilla, nisl dolor imperdiet dolor, id lobortis ligula nunc sed dolor.
+
+Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur eu dui vitae nulla tempor consectetuer. Suspendisse ligula dolor, varius nec, vulputate id, luctus sed, lacus. Pellentesque purus urna, porta molestie, mattis non, posuere et, velit. Curabitur diam mauris, dictum vel, lacinia congue, molestie at, nisi. Proin tempus diam ut ligula. Mauris dictum, metus dapibus iaculis sollicitudin, leo ligula cursus sem, eu congue metus ligula sed justo. Suspendisse potenti. Donec sodales elementum turpis. Duis dolor elit, dapibus sed, placerat vitae, auctor sit amet, nunc. Donec nisl quam, hendrerit vitae, porttitor et, imperdiet id, quam. Quisque dolor. Nulla tincidunt, lacus id dapibus ullamcorper, turpis diam fringilla eros, quis aliquet dolor felis at lorem. Pellentesque et lacus. Vestibulum tempor lectus at est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed vitae eros. Nulla pulvinar turpis eget nunc. Sed bibendum pellentesque nunc. Integer tristique, lorem ac faucibus tempor, lorem dolor mollis turpis, a consectetuer nunc justo ac nisl.
+
+Nam vitae purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent semper magna. In eu justo. Nunc vitae risus nec sem scelerisque consequat. In hac habitasse platea dictumst. Nam posuere ultricies turpis. Pellentesque a pede. Duis sed tortor. Phasellus egestas porta lectus. Aliquam dignissim consequat diam. Pellentesque pede.
+
+Ut varius tincidunt tellus. Curabitur ornare ipsum. Aenean laoreet posuere orci. Etiam id nisl. Suspendisse volutpat elit molestie orci. Suspendisse vel augue at felis tincidunt sollicitudin. Fusce arcu. Duis a tortor. Duis et odio et leo sollicitudin consequat. Aliquam lobortis. Phasellus condimentum. Ut porttitor bibendum libero. Integer euismod lacinia velit. Donec velit justo, sodales varius, cursus sed, mattis a, arcu.
+
+Maecenas accumsan, sem iaculis egestas gravida, odio nunc aliquet dui, eget cursus diam purus vel augue. Donec eros nisi, imperdiet quis, volutpat ac, sollicitudin sed, arcu. Aenean vel mauris. Mauris tincidunt. Nullam euismod odio at velit. Praesent elit purus, porttitor id, facilisis in, consequat ut, libero. Morbi imperdiet, magna quis ullamcorper malesuada, mi massa pharetra lectus, a pellentesque urna urna id turpis. Nam posuere lectus vitae nibh. Etiam tortor orci, sagittis malesuada, rhoncus quis, hendrerit eget, libero. Quisque commodo nulla at nunc. Mauris consequat, enim vitae venenatis sollicitudin, dolor orci bibendum enim, a sagittis nulla nunc quis elit. Phasellus augue. Nunc suscipit, magna tincidunt lacinia faucibus, lacus tellus ornare purus, a pulvinar lacus orci eget nibh. Maecenas sed nibh non lacus tempor faucibus. In hac habitasse platea dictumst. Vivamus a orci at nulla tristique condimentum. Donec arcu quam, dictum accumsan, convallis accumsan, cursus sit amet, ipsum. In pharetra sagittis nunc.
+
+Donec consequa