File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 9393There're two key mappings defined by default:
9494
9595-  ` <leader>gl `  (normal/visual mode): copy git link to clipboard.
96- -  ` <leader>gL `  (normal/visual mode): open git link in default  browser.
96+ -  ` <leader>gL `  (normal/visual mode): open git link in browser.
9797
9898To disable the default key mappings, set ` mapping = false `  in ` setup() `  function
9999(see [ Configuration] ( #configuration ) ).
@@ -116,9 +116,9 @@ require('gitlinker').setup({
116116      desc  =  " Copy git link to clipboard" 
117117    },
118118    [" <leader>gL" =  {
119-       --  open git link in default  browser
119+       --  open git link in browser
120120      action  =  require (" gitlinker.actions" system ,
121-       desc  =  " Open git link in default  browser" 
121+       desc  =  " Open git link in browser" 
122122    },
123123  },
124124
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ local Defaults = {
2323    },
2424    [" <leader>gL" =  {
2525      action  =  require (" gitlinker.actions" system ,
26-       desc  =  " Open git link in default  browser" 
26+       desc  =  " Open git link in browser" 
2727    },
2828  },
2929
@@ -106,9 +106,18 @@ local function setup(option)
106106    file  =  Configs .file_log ,
107107  })
108108
109+   local  key_mappings  =  nil 
110+   if  type (option ) ==  " table"  and  option [" mapping" ~=  nil  then 
111+     if  type (option [" mapping" ==  " table"  then 
112+       key_mappings  =  option [" mapping" 
113+     end 
114+   else 
115+     key_mappings  =  Defaults .mapping 
116+   end 
117+ 
109118  --  key mapping
110-   if  Configs . mapping   and   # Configs . mapping   >   0  then 
111-     for  k , v  in  pairs (Configs . mapping ) do 
119+   if  key_mappings  then 
120+     for  k , v  in  pairs (key_mappings ) do 
112121      local  opt  =  {
113122        noremap  =  true ,
114123        silent  =  true ,
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments