Skip to content

Feature Request: Improve <ESC> Behavior in Comment Windows #239

@petRUShka

Description

@petRUShka

Feature Request: Improve <ESC> Behavior in Comment Windows

Issue Description

I've been exploring gitlab.nvim, and it's been a fantastic tool. However, I've encountered a significant issue that hinders my workflow: inadvertently losing comment text by pressing <ESC>. In Vim (or Neovim), <ESC> is habitually used to ensure one is in Normal mode, often pressed multiple times just to be certain. Unfortunately, in gitlab.nvim, an extra press of <ESC> results in losing all the written comments — erasing thoughts and efforts instantaneously.

This behavior is contrary to the Vim philosophy, where it's challenging to lose work unintentionally. Vim safeguards against potential loss, allowing for undo actions, reopening closed buffers, and warning users about unsafe actions like quitting without saving. The current <ESC> functionality in comment windows breaks from this safety net, forcing users to adopt new habits that may detract from their experience.

Proposed Solution

  1. Save Unfinished Comments: Similar to how the GitLab web interface retains comments even if the tab is closed, gitlab.nvim could automatically save drafts of unfinished comments. This feature would prevent data loss and align with the expected Vim behavior of safeguarding user input.

  2. Redefine <ESC> Keybinding: Removing <ESC> as the default method for closing comment windows would adhere more closely to Vim traditions. Instead, adopting commands like :q! for closing without saving and :wq for saving and submitting comments could offer a more Vim-centric approach. This method is reminiscent of Fugitive's handling of commit messages, providing a familiar workflow for Vim users.

Conclusion

Adjusting the <ESC> key's functionality to protect user input and align with Vim's user-protection philosophy would greatly enhance the usability of gitlab.nvim for the Vim community. These changes would mitigate the risk of losing valuable input and help maintain the muscle memory and habits formed by long-time Vim users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions