Commits

firefly committed 6a31f93

Added patch check for formatoptions+=j.

Comments (0)

Files changed (1)

 " ~/.vimrc
 
+
+"""" Utility functions """"""""""""""""""""""""""""""""""""""""""""""
+function <SID>has_patch(version, patch)
+  return v:version > a:version || v:version == a:version && has('patch ' . a:patch)
+endfun
+
+
 """" General settings """""""""""""""""""""""""""""""""""""""""""""""
 set nocompatible                " IMprove the editor
 set encoding=utf-8              " (we're not in the eighties anymore)
 
 set formatoptions+=n            " Indent numbered lists in comments better
 set formatoptions+=l            " Don't wrap lines that were already long
-set formatoptions+=j            " Remove comment leaders when joining
+if <SID>has_patch(703, 541)
+  set formatoptions+=j          " Remove comment leaders when joining
+endif
 
 " Use pretty characters for vim's rendering of things.
 " (fillchar/stlnc doesn't support multibyte chars.. :<)
 let g:html_number_lines = 0
 
 if !exists("*UploadCurrFileHTML")
-  fun UploadCurrFileHTML()
+  function UploadCurrFileHTML()
     TOhtml
     silent w
     silent !scp % xen:srv/http/up
     silent !rm %
     silent close
     " TODO: Put link in clipboard
-  endf
+  endfun
 
   com Up     call UploadCurrFileHTML()
   com Upload call UploadCurrFileHTML()