1. Dave Vedder
  2. dotfiles

Commits

Dave Vedder  committed 50caa08 Merge

merged

  • Participants
  • Parent commits 58d8516, e02a2c8
  • Branches default

Comments (0)

Files changed (4)

File .vim/after/syntax/html.vim

View file
  • Ignore whitespace
+" Vim syntax file
+" Language:     HTML (version 5)
+" Maintainer:   Rodrigo Machado <rcmachado@gmail.com>
+" URL:          http://rm.blog.br/vim/syntax/html.vim
+" Last Change:  2009 Aug 19
+" License:      Public domain
+"               (but let me know if you liked it :) )
+"
+" Note: This file just adds the new tags from HTML 5
+"       and don't replace default html.vim syntax file
+
+" HTML 5 tags
+syn keyword htmlTagName contained article aside audio bb canvas command datagrid
+syn keyword htmlTagName contained datalist details dialog embed figure footer
+syn keyword htmlTagName contained header hgroup keygen mark meter nav output
+syn keyword htmlTagName contained progress time ruby rt rp section time video
+
+" HTML 5 arguments
+syn keyword htmlArg contained autofocus placeholder min max step
+syn keyword htmlArg contained contenteditable contextmenu draggable hidden item
+syn keyword htmlArg contained itemprop list subject spellcheck
+" this doesn't work because default syntax file alredy define a 'data' attribute
+syn match   htmlArg "\<\(data-[\-a-zA-Z0-9_]\+\)=" contained

File .vim/bundle/bclose/plugin/bclose.vim

View file
  • Ignore whitespace
+" Delete buffer while keeping window layout (don't close buffer's windows).
+" Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165
+if v:version < 700 || exists('loaded_bclose') || &cp
+    finish
+endif
+let loaded_bclose = 1
+if !exists('bclose_multiple')
+    let bclose_multiple = 1
+endif
+
+" Display an error message.
+function! s:Warn(msg)
+    echohl ErrorMsg
+    echomsg a:msg
+    echohl NONE
+endfunction
+
+" Command ':Bclose' executes ':bd' to delete buffer in current window.
+" The window will show the alternate buffer (Ctrl-^) if it exists,
+" or the previous buffer (:bp), or a blank buffer if no previous.
+" Command ':Bclose!' is the same, but executes ':bd!' (discard changes).
+" An optional argument can specify which buffer to close (name or number).
+function! s:Bclose(bang, buffer)
+    if empty(a:buffer)
+        let btarget = bufnr('%')
+    elseif a:buffer =~ '^\d\+$'
+        let btarget = bufnr(str2nr(a:buffer))
+    else
+        let btarget = bufnr(a:buffer)
+    endif
+    if btarget < 0
+        call s:Warn('No matching buffer for '.a:buffer)
+        return
+    endif
+    if empty(a:bang) && getbufvar(btarget, '&modified')
+        call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)')
+        return
+    endif
+    " Numbers of windows that view target buffer which we will delete.
+    let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget')
+    if !g:bclose_multiple && len(wnums) > 1
+        call s:Warn('Buffer is in multiple windows (use ":let bclose_multiple=1")')
+        return
+    endif
+    let wcurrent = winnr()
+    for w in wnums
+        execute w.'wincmd w'
+        let prevbuf = bufnr('#')
+        if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w
+            buffer #
+        else
+            bprevious
+        endif
+        if btarget == bufnr('%')
+            " Numbers of listed buffers which are not the target to be deleted.
+            let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget')
+            " Listed, not target, and not displayed.
+            let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
+            " Take the first buffer, if any (could be more intelligent).
+            let bjump = (bhidden + blisted + [-1])[0]
+            if bjump > 0
+                execute 'buffer '.bjump
+            else
+                execute 'enew'.a:bang
+            endif
+        endif
+    endfor
+    execute 'bdelete'.a:bang.' '.btarget
+    execute wcurrent.'wincmd w'
+endfunction
+command! -bang -complete=buffer -nargs=? Bclose call s:Bclose('<bang>', '<args>')
+nnoremap <silent> <Leader>bd :Bclose<CR>

File .vim/snippets/html.snippets

View file
  • Ignore whitespace
+snippet newdoc
+	<!doctype html>
+	<html>
+	<head>
+		<title>${1}</title>
+	</head>
+	<body lang="en">
+		${2}
+	</body>
+	</html>

File .vimrc

View file
  • Ignore whitespace
 set scrolloff=5 " always show a few lines under the one we are working on for context!
 set hid "change buffer w/o annoying for save
 set shortmess=aOstTI "removes many ENTER TO CONTINUE messages
-
 set wrap " soft wrap text
 set linebreak " rules for breaking lines
+" turn off auto commenting!!!
+autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
 " }}}
 
 " Folding --- {{{