1
0
Fork 0
mirror of synced 2024-12-24 07:43:20 -05:00

Updated plugins

This commit is contained in:
amix 2014-01-07 00:25:41 +00:00
parent 2a0e2ddc13
commit b03dc8e510
12 changed files with 107 additions and 31 deletions

View file

@ -126,6 +126,7 @@ function! s:goyo_on(width)
\ 'showtabline': &showtabline,
\ 'fillchars': &fillchars,
\ 'winwidth': &winwidth,
\ 'winminheight': &winminheight,
\ 'winheight': &winheight,
\ 'statusline': &statusline,
\ 'ruler': &ruler,
@ -139,7 +140,7 @@ function! s:goyo_on(width)
" vim-gitgutter
let t:goyo_disabled_gitgutter = get(g:, 'gitgutter_enabled', 0)
if t:goyo_disabled_gitgutter
GitGutterDisable
silent! GitGutterDisable
endif
" vim-airline
@ -157,6 +158,12 @@ function! s:goyo_on(width)
augroup! PowerlineMain
endif
" lightline.vim
let t:goyo_disabled_lightline = exists('#LightLine')
if t:goyo_disabled_lightline
silent! call lightline#disable()
endif
if !get(g:, 'goyo_linenr', 0)
setlocal nonu
if exists('&rnu')
@ -169,6 +176,8 @@ function! s:goyo_on(width)
" Global options
set winwidth=1
let &winheight = max([&winminheight, 1])
set winminheight=1
set winheight=1
set laststatus=0
set showtabline=0
@ -185,8 +194,8 @@ function! s:goyo_on(width)
set guioptions-=L
endif
let t:goyo_pads.l = s:init_pad('vertical new')
let t:goyo_pads.r = s:init_pad('vertical rightbelow new')
let t:goyo_pads.l = s:init_pad('vertical topleft new')
let t:goyo_pads.r = s:init_pad('vertical botright new')
let t:goyo_pads.t = s:init_pad('topleft new')
let t:goyo_pads.b = s:init_pad('botright new')
@ -195,10 +204,6 @@ function! s:goyo_on(width)
let &statusline = repeat(' ', winwidth(0))
if exists('g:goyo_callbacks[0]')
call g:goyo_callbacks[0]()
endif
augroup goyo
autocmd!
autocmd BufWinLeave <buffer> call s:goyo_off()
@ -206,6 +211,10 @@ function! s:goyo_on(width)
autocmd VimResized * call s:resize_pads()
autocmd ColorScheme * call s:tranquilize()
augroup END
if exists('g:goyo_callbacks[0]')
call g:goyo_callbacks[0]()
endif
endfunction
function! s:goyo_off()
@ -232,6 +241,7 @@ function! s:goyo_off()
let goyo_disabled_gitgutter = t:goyo_disabled_gitgutter
let goyo_disabled_airline = t:goyo_disabled_airline
let goyo_disabled_powerline = t:goyo_disabled_powerline
let goyo_disabled_lightline = t:goyo_disabled_lightline
if tabpagenr() == 1
tabnew
@ -240,13 +250,19 @@ function! s:goyo_off()
endif
tabclose
let wmh = remove(goyo_revert, 'winminheight')
let wh = remove(goyo_revert, 'winheight')
let &winheight = max([wmh, 1])
let &winminheight = wmh
let &winheight = wh
for [k, v] in items(goyo_revert)
execute printf("let &%s = %s", k, string(v))
endfor
execute 'colo '. g:colors_name
if goyo_disabled_gitgutter
GitGutterEnable
silent! GitGutterEnable
endif
if goyo_disabled_airline && !exists("#airline")
@ -259,6 +275,10 @@ function! s:goyo_off()
silent! PowerlineReloadColorscheme
endif
if goyo_disabled_lightline
silent! call lightline#enable()
endif
if exists('#Powerline')
doautocmd Powerline ColorScheme
endif

View file

@ -183,10 +183,13 @@ endfunction
let s:current_bufnr = -1
let s:current_tabnr = -1
let s:current_tabline = ''
let s:current_modified = 0
function! s:get_buffers()
let cur = bufnr('%')
if cur == s:current_bufnr
return s:current_tabline
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
return s:current_tabline
endif
endif
let b = airline#builder#new(s:builder_context)
@ -202,6 +205,7 @@ function! s:get_buffers()
else
let group = 'airline_tabsel'
endif
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
else
if index(tab_bufs, nr) > -1
let group = 'airline_tab'
@ -225,7 +229,9 @@ function! s:get_tabs()
let curbuf = bufnr('%')
let curtab = tabpagenr()
if curbuf == s:current_bufnr && curtab == s:current_tabnr
return s:current_tabline
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
return s:current_tabline
endif
endif
let b = airline#builder#new(s:builder_context)
@ -239,6 +245,7 @@ function! s:get_tabs()
endif
endfor
endif
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
else
let group = 'airline_tab'
endif

View file

@ -1396,6 +1396,7 @@ function! s:diff_restore()
let restore = 'setlocal nodiff noscrollbind'
\ . ' scrollopt=' . &l:scrollopt
\ . (&l:wrap ? ' wrap' : ' nowrap')
\ . ' foldlevel=999'
\ . ' foldmethod=' . &l:foldmethod
\ . ' foldcolumn=' . &l:foldcolumn
\ . ' foldlevel=' . &l:foldlevel
@ -1499,14 +1500,14 @@ function! s:Diff(bang,...)
try
let spec = s:repo().translate(file)
let commit = matchstr(spec,'\C[^:/]//\zs\x\+')
let restore = s:diff_restore()
let w:fugitive_diff_restore = restore
if s:buffer().compare_age(commit) < 0
execute 'rightbelow '.vert.'split '.s:fnameescape(spec)
execute 'rightbelow '.vert.'diffsplit '.s:fnameescape(spec)
else
execute 'leftabove '.vert.'split '.s:fnameescape(spec)
execute 'leftabove '.vert.'diffsplit '.s:fnameescape(spec)
endif
call s:diffthis()
wincmd p
call s:diffthis()
let w:fugitive_diff_restore = restore
return ''
catch /^fugitive:/
return 'echoerr v:errmsg'

View file

@ -70,7 +70,7 @@ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" keepend nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline

View file

@ -44,6 +44,18 @@ looking at the [vim-snippets][vim-snippets] repository.
" Optional:
Bundle "honza/vim-snippets"
## Release Notes ##
### 0.87 - 2014-01-04 ###
* Stop indenting empty lines when expanding snippets
* Support extends keyword in .snippets files
* Fix visual placeholder support
* Add zero tabstop support
* Support negative 'softtabstop'
* Add g:snipMate_no_default_aliases option
* Add <Plug>snipMateTrigger for triggering an expansion inside a snippet
* Add snipMate#CanBeTriggered() function
[ultisnips]: https://github.com/sirver/ultisnips
[msanders]: https://github.com/msanders

View file

@ -404,6 +404,28 @@ Perhaps some of these features will be added in a later release.
==============================================================================
CHANGELOG *SnipMate-changelog*
0.87 - 2014-01-04
-----------------
* Stop indenting empty lines when expanding snippets
* Support extends keyword in .snippets files
* Fix visual placeholder support
* Add zero tabstop support
* Support negative 'softtabstop'
* Add g:snipMate_no_default_aliases option
* Add <Plug>snipMateTrigger for triggering an expansion inside a snippet
* Add snipMate#CanBeTriggered() function
0.86 - 2013-06-15
-----------------
* Use more idiomatic <Plug> maps
* Remove most select mode mappings
* Fix disappearing variables bug (hpesoj)
* Fix cursor position bug when a variable is on the same line as the stop
* Fix undo point creation causing problems with Supertab
* Fix bug where SnipMate would use a typed trigger as a regular expression
0.85 - 2013-04-03
-----------------

View file

@ -1,13 +1,11 @@
" File: snipMate.vim
" Author: Michael Sanders
" Version: 0.86
" Description: snipMate.vim implements some of TextMate's snippets features in
" Vim. A snippet is a piece of often-typed text that you can
" insert into your document using a trigger word followed by a "<tab>".
"
" For more help see snipMate.txt; you can do this by using:
" :helptags ~/.vim/doc
" :h snipMate.txt
" :h SnipMate
if exists('loaded_snips') || &cp || version < 700
finish

View file

@ -93,3 +93,17 @@ snippet req
# Export
snippet exp
${0:root} = exports ? this
snippet ajax
$.ajax
url: "${1:mydomain.com/url}"
type: "${2:POST}"
dataType: "${3:xml/html/script/json}"
data: ${4:data}
complete: (jqXHR, textStatus) ->
${5:// callback}
success: (data, textStatus, jqXHR) ->
${6:// success callback}
error: (jqXHR, textStatus, errorThrown) ->
${0:// error callback}

View file

@ -7,6 +7,14 @@ zenroom for Vim: Focusing only on the essential](http://amix.dk/blog/post/19744#
Please note that this might not work perfectly with your colorscheme. Patches are welcome to fix this :-)
## Installaion and usage
* Install [goyo.vim](https://github.com/junegunn/goyo.vim)
* In command mode type :Goyo
Additionally you may want to have a shortcut. Add this to your vimrc:
nnoremap <silent> <leader>z :Goyo<cr>
## Inspirations/Similar
* [Writing Markdown With Style in Vim](http://astrails.com/blog/2013/8/12/writing-markdown-with-style-in-vim)

View file

@ -23,16 +23,9 @@ if exists( "&background" )
let s:save_background = &background
endif
" Save the current `textwidth'` value for reset later
let s:save_textwidth = ""
if exists( "&textwidth'" )
let s:save_textwidth' = &textwidth'
endif
function! s:markdown_room()
set background=light
set linespace=8
set textwidth=80
hi Normal guibg=gray95
hi NonText guifg=gray95
@ -88,10 +81,6 @@ function! g:zenroom_goyo_after()
if is_mark_or_rst
set linespace=0
if s:save_textwidth != ""
exec( "set textwidth=" . s:save_textwidth )
endif
if s:save_background != ""
exec( "set background=" . s:save_background )
endif

View file

@ -343,9 +343,12 @@ map <leader>s? z=
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" Quickly open a buffer for scripbble
" Quickly open a buffer for scribble
map <leader>q :e ~/buffer<cr>
" Quickly open a markdown buffer for scribble
map <leader>x :e ~/buffer.md<cr>
" Toggle paste mode on and off
map <leader>pp :setlocal paste!<cr>

View file

@ -110,4 +110,6 @@ let g:airline_theme="luna"
" => Vimroom
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:goyo_width=100
let g:goyo_margin_top = 2
let g:goyo_margin_bottom = 2
nnoremap <silent> <leader>z :Goyo<cr>