Commits

Steve Losh committed b8aab52

Add threesome_leader config option.

  • Participants
  • Parent commits e74f19c
  • Tags v0.2.0

Comments (0)

Files changed (2)

File autoload/threesomelib/util/keys.py

 import vim
 from bufferlib import buffers
+from ..settings import setting
 
 
-def bind(key, to, options='', mode=None, leader='<localleader>'):
+def bind(key, to, options='', mode=None, leader=None):
+    if not leader:
+        leader = setting('leader', '<localleader>')
+
     vim.command('nnoremap %s %s%s %s' % (options, leader, key, to))
 
-def unbind(key, options='', leader='<localleader>'):
+def unbind(key, options='', leader=None):
+    if not leader:
+        leader = setting('leader', '<localleader>')
+
     vim.command('unmap %s %s%s' % (options, leader, key))
 
-def bind_for_all(key, to, options='', mode=None, leader='<localleader>'):
+def bind_for_all(key, to, options='', mode=None, leader=None):
+    if not leader:
+        leader = setting('leader', '<localleader>')
+
     with buffers.remain():
         for b in buffers.all:
             b.open()
             bind(key, to, options, mode, leader)
 
-def unbind_for_all(key, options='', leader='<localleader>'):
+def unbind_for_all(key, options='', leader=None):
+    if not leader:
+        leader = setting('leader', '<localleader>')
+
     with buffers.remain():
         for b in buffers.all:
             b.open()

File doc/threesome.txt

         5.13 threesome_initial_scrollbind_compare .. |ThreesomeConfig_is_compare|
         5.14 threesome_initial_scrollbind_path ..... |ThreesomeConfig_is_path|
         5.15 threesome_initial_mode ................ |ThreesomeConfig_im|
-        5.16 threesome_wrap ........................ |ThreesomeConfig_wrap|
+        5.16 threesome_leader ...................... |ThreesomeConfig_leader|
+        5.17 threesome_wrap ........................ |ThreesomeConfig_wrap|
     6. License ..................................... |ThreesomeLicense|
     7. Bugs ........................................ |ThreesomeBugs|
     8. Contributing ................................ |ThreesomeContributing|
 Default: "grid"
 
 ------------------------------------------------------------------------------
-5.16 g:threesome_wrap                                   *ThreesomeConfig_wrap*
+5.16 g:threesome_leader                               *ThreesomeConfig_leader*
+
+Set this to change the leader Threesome will bind all of its mappings to.
+
+For example: >
+
+    let g:threesome_leader = "<leader>t"
+
+Will make all Threesome commands start with <leader>t instead of the default
+<localleader>.
+
+Options: Any valid key mapping string
+Default: "<localleader>"
+
+------------------------------------------------------------------------------
+5.17 g:threesome_wrap                                   *ThreesomeConfig_wrap*
 
 Set this to "wrap" or "nowrap" to set |wrap| or |nowrap| on all windows by
 default.
 ==============================================================================
 9. Changelog                                              *ThreesomeChangelog*
 
+v0.2.0
+    * Add threesome_leader as a config option.
 v0.1.1
     * Fix a bug when the user doesn't use :set hidden.
 v0.1.0