Commits

ZyX_I committed 100aa78

Added a bunch of global mappings
Made some mapping {lhs} more consistent

Comments (0)

Files changed (9)

ftplugin/aurumcommit.vim

                 \           '{})<CR>'
 endfunction
 call s:_f.mapgroup.add('AuCommitMessage', {
-            \ 'Commit': {'lhs': 'C', 'rhs': s:F.gm('commit') },
+            \ 'Commit': {'lhs': 'i', 'rhs': s:F.gm('commit') },
             \   'Exit': {'lhs': 'X', 'rhs': s:F.gm('discard')},
         \}, {'mode': 'in', 'silent': 1, 'leader': ','})
 "▶1
     "                        .hgignore to repository if it is not present)
     " TODO :AuDirectory/:AuTree
     " TODO :Au ?
-    " TODO Global mappings for most commands
     " TODO aurum#changeset(), aurum#repository() and aurum#status()
-    " TODO Comments explaining what will be commited
     " TODO vimdiff mapping to aurum://diff
     " TODO make :AuLog accept date ranges
     let s:addargs={'Update': {'bang': 1}}
     call s:_f.augroup.add('Aurum',[['BufReadCmd',  'aurum://*',0,[s:auefunc,0]],
                 \                  ['FileReadCmd', 'aurum://*',0,[s:auefunc,1]],
                 \                 ])
+    "▶2 Global mappings
+    call FraworLoad('@/mappings')
+    call s:_f.mapgroup.add('Aurum', {
+                \'Commit':    {'lhs':  'i', 'rhs': ':<C-u>AuCommit<CR>'          },
+                \'CommitAll': {'lhs':  'I', 'rhs': ':<C-u>AuCommit**<CR>'        },
+                \'ROpen':     {'lhs':  'o', 'rhs': ':<C-u>AuFile<CR>'            },
+                \'Revert':    {'lhs':  'R', 'rhs': ':<C-u>AuFile . : replace<CR>'},
+                \'Vdiff':     {'lhs':  'D', 'rhs': ':<C-u>AuVimDiff<CR>'         },
+                \'Diff':      {'lhs':  'd', 'rhs': ':<C-u>AuDiff :<CR>'          },
+                \'Fdiff':     {'lhs': 'gd', 'rhs': ':<C-u>AuDiff<CR>'            },
+                \'Annotate':  {'lhs':  'a', 'rhs': ':<C-u>AuAnnotate<CR>'        },
+                \'Status':    {'lhs':  's', 'rhs': ':<C-u>AuStatus|wincmd p<CR>' },
+                \'Record':    {'lhs':  'r', 'rhs': ':<C-u>AuRecord<CR>'          },
+            \}, {'mode': 'n', 'silent': 1, 'leader': ',a'})
     "▲2
     finish
 elseif s:_pluginloaded

plugin/aurum/commit.vim

     return r
 endfunction
 "▶1 commit :: repo, opts, files → + repo
-" XXX Do not change names of options used here, see :AuRecord
+" TODO Comments explaining what will be commited
 let s:defdate=['strftime("%Y")',
             \  'strftime("%m")',
             \  'strftime("%d")',
             \  '"00"',
             \  '"00"',
             \  '"00"']
+" XXX Do not change names of options used here, see :AuRecord
 function s:F.commit(repo, opts, files)
     let user=''
     let date=''

plugin/aurum/record.vim

         setlocal nomodifiable
         return
     endif
-    "▶2 add/ignore
-    if a:action[-3:] is# 'add' || a:action[-6:] is# 'ignore'
+    "▶2 add/remove
+    if a:action[-3:] is# 'add' || a:action[-6:] is# 'remove'
         if a:action[0] is# 'v'
             let sline=line("'<")
             let eline=line("'>")
     elseif a:action is# 'discardall'
         execute swnr.'wincmd w'
         return s:F.runstatmap('discard')
-    elseif a:action is# 'ignore'
+    elseif a:action is# 'remove'
         call s:F.runleftmap('discard')
         let sbvar=s:_r.bufvars[bufnr('%')]
         let fidx=index(sbvar.files, bvar.recfile)
 endfunction
 call s:_f.mapgroup.add('AuRecord', {
             \    'Add': {'lhs': 'A', 'rhs': s:F.gm('add')    },
-            \ 'Ignore': {'lhs': 'I', 'rhs': s:F.gm('ignore') },
+            \ 'Remove': {'lhs': 'R', 'rhs': s:F.gm('remove') },
             \   'Edit': {'lhs': 'O', 'rhs': s:F.gm('edit')   },
             \ 'Commit': {'lhs': 'i', 'rhs': s:F.gm('commit') },
             \   'Undo': {'lhs': 'u', 'rhs': s:F.gm('undo')   },
             \   'Vadd': {'lhs': 'A', 'rhs': s:F.gm('vadd'),    'mode': 'v'},
-            \'Vignore': {'lhs': 'I', 'rhs': s:F.gm('vignore'), 'mode': 'v'},
+            \'Vremove': {'lhs': 'R', 'rhs': s:F.gm('vremove'), 'mode': 'v'},
         \}, {'mode': 'n', 'silent': 1, 'dontmap': 1})
 call s:_f.mapgroup.add('AuRecordLeft', {
             \'Discard': {'lhs': 'x', 'rhs': s:F.gml('discard')   },
             \   'Exit': {'lhs': 'X', 'rhs': s:F.gml('discardall')},
             \ 'Commit': {'lhs': 'i', 'rhs': s:F.gml('commit')    },
-            \ 'Ignore': {'lhs': 'I', 'rhs': s:F.gml('ignore')    },
+            \ 'Remove': {'lhs': 'R', 'rhs': s:F.gml('remove')    },
         \}, {'mode': 'n', 'silent': 1, 'dontmap': 1, 'leader': ','})
 "▶1
 call frawor#Lockvar(s:, '_r,_pluginloaded')
 :silent AuCommit
 Abc:silent write
 :WT
-:W{{{1 ,C mapping
+:W{{{1 ,i mapping
 :call append('$', 'Brand new text')
 :silent write
 :silent AuCommit
-Jkl,C:WT
+Jkl,i:WT
 :W{{{1 ,X mapping
 :call append('$', 'Brand new text 2')
 :silent write
 :silent write
 :bwipeout!
 :R silent AuCommit **
-Pqr,C:WT
+Pqr,i:WT
 :source addmessages.vim
 @  Changeset 23
 |  Tag: tip
 |    Abc
-{{{1 ,C mapping
+{{{1 ,i mapping
 @  Changeset 24
 |  Tag: tip
 |    Jkl

test/prevmessage.in

 Commiting
 all
 files
-,C:WT
+,i:WT
 :R !hg rollback
 :R AuCommit **
-,C:WT
+,i:WT
 :let g:aurum_remembermsg=0
 :R AuCommit **
 :try | write | catch | echom v:exception | endtry
 A:silent write
 Def:silent write
 :WT
-:W{{{1 AIiX
+:W{{{1 ARiX
 :R AuRecord
-AIiX:WT
-:W{{{1 2A2IiX
+ARiX:WT
+:W{{{1 2A2RiX
 :R AuRecord
-2A2IiX:WT
+2A2RiX:WT
 :W{{{1 message, {count}A
 :R AuRecord message Ghi
 2Ai:WT
 :W{{{1 edit-edit-ignore
 :R AuRecord message Mno
 OGdo:silent write
-jOzRggdd,IiX:WT
+jOzRggdd,RiX:WT
 :W{{{1 edit-commit
 :R AuRecord message Mno
 OGdo,i:WT
 @  Changeset 24
 |  Tag: tip
 |    Def
-{{{1 AIiX
+{{{1 ARiX
 @  Changeset 24
 |  Tag: tip
 |    Def
-{{{1 2A2IiX
+{{{1 2A2RiX
 @  Changeset 24
 |  Tag: tip
 |    Def