" along with this file. If not, see <http://www.gnu.org/licenses/>.
+" HELPER FUNCTIONS
+
+if has('eval')
+" Check if the given syntax group is available. Thanks to bairui in #vim on
+" Freenode (2012-02-19 01:15 CET) for the try/catch silent highlight idea.
+ function! s:HasSyntaxGroup(group)
+ try
+ execute 'silent highlight ' . a:group
+ " \a = [A-Za-z]
+ catch /^Vim\%((\a\+)\)\=:E411/ " 'highlight group not found'
+ return 0
+ endtry
+ return 1
+ endfunction
+
+" Check if the given Vim version and patch is available.
+ function! s:HasVersionAndPatch(version, patch)
+ return v:version > a:version
+ \ || (v:version == a:version && has('patch' . a:patch))
+ endfunction
+endif
+
+
" EDITOR SETTINGS
" Save 'runtimepath' in case it was changed by the system's configuration
set viminfo^='1000
endif
-" Use strong encryption if possible, also used for swap/undo files.
+" Use strong(er) encryption if possible, also used for swap/undo files.
if exists('+cryptmethod')
- set cryptmethod=blowfish
+ if s:HasVersionAndPatch(704, 399)
+ set cryptmethod=blowfish2
+ else
+ set cryptmethod=blowfish
+ endif
endif
" Clear all vimrc-related autocmds. Has to be done here as the vimrc augroup
endif
-" HELPER FUNCTIONS
-
-if has('eval')
-" Check if the given syntax group is available. Thanks to bairui in #vim on
-" Freenode (2012-02-19 01:15 CET) for the try/catch silent highlight idea.
- function! s:HasSyntaxGroup(group)
- try
- execute 'silent highlight ' . a:group
- " \a = [A-Za-z]
- catch /^Vim\%((\a\+)\)\=:E411/ " 'highlight group not found'
- return 0
- endtry
- return 1
- endfunction
-
-" Check if the given Vim version and patch is available.
- function! s:HasVersionAndPatch(version, patch)
- return v:version > a:version
- \ || (v:version == a:version && has('patch' . a:patch))
- endfunction
-endif
-
-
" TERMINAL SETTINGS
" Also enable fast terminal mode in GNU screen and tmux, but not for SSH
" FTDETECT AUTO COMMANDS
-" Recognize .md as markdown files (Vim default is .mkd).
- autocmd BufRead,BufNewFile *.md set filetype=mkd
" Recognize .test as Tcl files.
autocmd BufRead,BufNewFile *.test set filetype=tcl