comparison plugin/lawrencium.vim @ 14:eab2680e6818

Better fold sections.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 13 Dec 2011 07:21:24 -0800
parents a7bf37a97a1b
children f02e37f395ae
comparison
equal deleted inserted replaced
13:298261c939b3 14:eab2680e6818
185 autocmd VimEnter * if expand('<amatch>')==''|call s:setup_buffer_commands()|endif 185 autocmd VimEnter * if expand('<amatch>')==''|call s:setup_buffer_commands()|endif
186 augroup end 186 augroup end
187 187
188 " }}} 188 " }}}
189 189
190 " Main Buffer Commands {{{ 190 " Buffer Commands Management {{{
191 191
192 " Store the commands for Lawrencium-enabled buffers so that we can add them in 192 " Store the commands for Lawrencium-enabled buffers so that we can add them in
193 " batch when we need to. 193 " batch when we need to.
194 let s:main_commands = [] 194 let s:main_commands = []
195 195
205 205
206 augroup lawrencium_main 206 augroup lawrencium_main
207 autocmd! 207 autocmd!
208 autocmd User Lawrencium call s:DefineMainCommands() 208 autocmd User Lawrencium call s:DefineMainCommands()
209 augroup end 209 augroup end
210
211 " }}}
212
213 " Commands Auto-Complete {{{
210 214
211 " Auto-complete function for commands that take repo-relative file paths. 215 " Auto-complete function for commands that take repo-relative file paths.
212 function! s:ListRepoFiles(ArgLead, CmdLine, CursorPos) abort 216 function! s:ListRepoFiles(ArgLead, CmdLine, CursorPos) abort
213 let l:matches = s:hg_repo().Glob(a:ArgLead . '*', 1) 217 let l:matches = s:hg_repo().Glob(a:ArgLead . '*', 1)
214 call map(l:matches, 's:normalizepath(v:val)') 218 call map(l:matches, 's:normalizepath(v:val)')
219 function! s:ListRepoDirs(ArgLead, CmdLine, CursorPos) abort 223 function! s:ListRepoDirs(ArgLead, CmdLine, CursorPos) abort
220 let l:matches = s:hg_repo().Glob(a:ArgLead . '*/') 224 let l:matches = s:hg_repo().Glob(a:ArgLead . '*/')
221 call map(l:matches, 's:normalizepath(v:val)') 225 call map(l:matches, 's:normalizepath(v:val)')
222 return l:matches 226 return l:matches
223 endfunction 227 endfunction
228
229 " }}}
224 230
225 " Hg {{{ 231 " Hg {{{
226 232
227 function! s:Hg(bang, ...) abort 233 function! s:Hg(bang, ...) abort
228 let l:repo = s:hg_repo() 234 let l:repo = s:hg_repo()
486 call s:AddMainCommand("-bang Hgcommit :execute s:HgCommit(<bang>0, 0)") 492 call s:AddMainCommand("-bang Hgcommit :execute s:HgCommit(<bang>0, 0)")
487 call s:AddMainCommand("-bang Hgvcommit :execute s:HgCommit(<bang>0, 1)") 493 call s:AddMainCommand("-bang Hgvcommit :execute s:HgCommit(<bang>0, 1)")
488 494
489 " }}} 495 " }}}
490 496
491 " }}}
492
493 " Autoload Functions {{{ 497 " Autoload Functions {{{
494 498
495 " Prints a summary of the current repo (if any) that's appropriate for 499 " Prints a summary of the current repo (if any) that's appropriate for
496 " displaying on the status line. 500 " displaying on the status line.
497 function! lawrencium#statusline(...) 501 function! lawrencium#statusline(...)