@@ -149,12 +149,19 @@ func (a *App) Run() error {
149149 return fmt .Errorf ("failed to register hotkeys: %w" , err )
150150 }
151151
152- a .logger .Info ("GoVim is running. Press hotkeys to activate modes. " )
152+ a .logger .Info ("GoVim is running" )
153153 fmt .Println ("✓ GoVim is running" )
154- fmt .Printf (" Hint mode (direct): %s\n " , a .config .Hotkeys .ActivateHintMode )
155- fmt .Printf (" Hint mode (with actions): %s\n " , a .config .Hotkeys .ActivateHintModeWithActions )
156- fmt .Printf (" Scroll mode: %s\n " , a .config .Hotkeys .ActivateScrollMode )
157- fmt .Printf (" Exit mode: Escape (hardcoded)\n " )
154+
155+ // Print configured hotkeys
156+ if key := strings .TrimSpace (a .config .Hotkeys .ActivateHintMode ); key != "" {
157+ fmt .Printf (" Hint mode (direct): %s\n " , key )
158+ }
159+ if key := strings .TrimSpace (a .config .Hotkeys .ActivateHintModeWithActions ); key != "" {
160+ fmt .Printf (" Hint mode (with actions): %s\n " , key )
161+ }
162+ if key := strings .TrimSpace (a .config .Hotkeys .ActivateScrollMode ); key != "" {
163+ fmt .Printf (" Scroll mode: %s\n " , key )
164+ }
158165
159166 // Wait for interrupt signal with force-quit support
160167 sigChan := make (chan os.Signal , 1 )
@@ -196,31 +203,41 @@ func (a *App) Run() error {
196203// registerHotkeys registers all global hotkeys
197204func (a * App ) registerHotkeys () error {
198205 // Hint mode hotkey (direct click)
199- a .logger .Info ("Registering hint mode hotkey" , zap .String ("key" , a .config .Hotkeys .ActivateHintMode ))
200- if _ , err := a .hotkeyManager .Register (a .config .Hotkeys .ActivateHintMode , func () {
201- a .activateHintMode (false )
202- }); err != nil {
203- return fmt .Errorf ("failed to register hint mode hotkey: %w" , err )
206+ if key := strings .TrimSpace (a .config .Hotkeys .ActivateHintMode ); key != "" {
207+ a .logger .Info ("Registering hint mode hotkey" , zap .String ("key" , key ))
208+ if _ , err := a .hotkeyManager .Register (key , func () {
209+ a .activateHintMode (false )
210+ }); err != nil {
211+ return fmt .Errorf ("failed to register hint mode hotkey: %w" , err )
212+ }
204213 }
205214
206215 // Hint mode with actions hotkey
207- a .logger .Info ("Registering hint mode with actions hotkey" , zap .String ("key" , a .config .Hotkeys .ActivateHintModeWithActions ))
208- if _ , err := a .hotkeyManager .Register (a .config .Hotkeys .ActivateHintModeWithActions , func () {
209- a .activateHintMode (true )
210- }); err != nil {
211- return fmt .Errorf ("failed to register hint mode with actions hotkey: %w" , err )
216+ if key := strings .TrimSpace (a .config .Hotkeys .ActivateHintModeWithActions ); key != "" {
217+ a .logger .Info ("Registering hint mode with actions hotkey" , zap .String ("key" , key ))
218+ if _ , err := a .hotkeyManager .Register (key , func () {
219+ a .activateHintMode (true )
220+ }); err != nil {
221+ return fmt .Errorf ("failed to register hint mode with actions hotkey: %w" , err )
222+ }
212223 }
213224
214225 // Scroll mode hotkey
215- if _ , err := a .hotkeyManager .Register (a .config .Hotkeys .ActivateScrollMode , a .activateScrollMode ); err != nil {
216- return fmt .Errorf ("failed to register scroll mode hotkey: %w" , err )
226+ if key := strings .TrimSpace (a .config .Hotkeys .ActivateScrollMode ); key != "" {
227+ a .logger .Info ("Registering scroll mode hotkey" , zap .String ("key" , key ))
228+ if _ , err := a .hotkeyManager .Register (key , a .activateScrollMode ); err != nil {
229+ return fmt .Errorf ("failed to register scroll mode hotkey: %w" , err )
230+ }
217231 }
218232
219233 // Note: Escape key for exiting modes is hardcoded in handleKeyPress, not registered as global hotkey
220234
221235 // Reload config hotkey
222- if _ , err := a .hotkeyManager .Register (a .config .Hotkeys .ReloadConfig , a .reloadConfig ); err != nil {
223- a .logger .Warn ("Failed to register reload config hotkey" , zap .Error (err ))
236+ if key := strings .TrimSpace (a .config .Hotkeys .ReloadConfig ); key != "" {
237+ a .logger .Info ("Registering reload config hotkey" , zap .String ("key" , key ))
238+ if _ , err := a .hotkeyManager .Register (key , a .reloadConfig ); err != nil {
239+ a .logger .Warn ("Failed to register reload config hotkey" , zap .Error (err ))
240+ }
224241 }
225242
226243 return nil
0 commit comments