" Vimball Archiver by Charles E. Campbell, Jr., Ph.D. UseVimball finish plugin/myprojects.vim [[[1 3266 "============================================================================= " File: myprojects.vim " Author: Frédéric Hardy - http://blog.mageekbox.net " Date: Wed May 6 11:09:21 CEST 2009 " Licence: GPL version 2.0 license " GetLatestVimScripts: 2556 10039 :AutoInstall: myprojects.vim "============================================================================= " Check version {{{1 if v:version < 700 echoerr "myprojects.vim requires vim >= 7. DOWNLOAD IT! You'll thank me later." " Check folding {{{1 elseif !has('folding') echoerr "myprojects.vim requires folding." " Check compatible mode {{{1 elseif &cp echoerr "myprojects.vim requires no compatible mode." " plug-in's code {{{1 elseif !exists('myprojects_enable') " Save cpo {{{2 let s:keepCpo= &cpo setlocal cpo&vim " Initialize variables {{{2 " Initialize script variables {{{3 let s:plugin = 'myprojects' let s:version = '0.0.98' let s:copyright = '2009' let s:author = 'Frédéric Hardy' let s:email = 'myprojects.vim@mageekbox.net' let s:webSite = 'http://blog.mageekbox.net' let s:prompt = '[' . s:plugin . '] ' let s:oldWidth = 0 let s:windowsOs = has('win16') || has('win32') || has('win64') let s:osSlash = s:windowsOs ? '\' : '/' let s:home = expand('$HOME', ':p') let s:quitVimIfMyProjectsIsAlone = 1 let s:refreshProjectBuffers = 1 let s:loadAttributes = 1 let s:diffBuffers = [] let s:preferences = {} " Function s:initVariable() {{{3 function s:initVariable(name, value) if !exists(a:name) let {a:name} = a:value endif endfunction " Initialize global variables {{{3 call s:initVariable('g:myprojects_width', 30) call s:initVariable('g:myprojects_file', s:home . s:osSlash . '.' . s:plugin) call s:initVariable('g:myprojects_tags_file', '.tags') call s:initVariable('g:myprojects_auto_close', 0) call s:initVariable('g:myprojects_auto_resize', 0) call s:initVariable('g:myprojects_auto_open', 1) call s:initVariable('g:myprojects_version_at_startup', 1) call s:initVariable('g:myprojects_resize_step', 10) call s:initVariable('g:myprojects_syntax', 1) call s:initVariable('g:myprojects_display_empty_folder', 0) call s:initVariable('g:myprojects_version_control_system', 'svn') call s:initVariable('g:myprojects_display_number', 0) call s:initVariable('g:myprojects_cursorline', 1) call s:initVariable('g:myprojects_cursorcolumn', 1) call s:initVariable('g:myprojects_foldcolumn', 0) call s:initVariable('g:myprojects_display_path_in_statusline', 1) call s:initVariable('g:myprojects_tags_generator', '') call s:initVariable('g:myprojects_sessions_directory', s:home . s:osSlash . '.vim' . s:osSlash . 'plugin/myprojects/sessions') call s:initVariable('g:myprojects_preferences_file', s:home . s:osSlash . '.vim' . s:osSlash . 'plugin/myprojects/preferences') call s:initVariable('g:myprojects_new_file_on_bottom', 1) call s:initVariable('g:myprojects_sort_svn', 1) call s:initVariable('g:myprojects_sort_buffers', 1) call s:initVariable('g:myprojects_quit_vim_if_alone', 1) call s:initVariable('g:myprojects_autowrite', 1) " Initialize command {{{2 command -nargs=? -complete=file MyProjectsToggle call toggleMyProjectsWindow() if !hasmapto('MyProjectsToggle') map p MyProjectsToggle endif noremap