Community
    • Login

    Line Number Shortcut

    Scheduled Pinned Locked Moved General Discussion
    shortcutlinenumber
    8 Posts 4 Posters 6.2k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Bill FB Offline
      Bill F
      last edited by

      New here…Hi! I have searched and googled, etc for a tab menu item to turn off line numbering or a keyboard shortcut…the ability to turn off and on quickly is more than just convenient. The only option I see or read about is going into preferences each time, a pain in the butt, not efficient. Why is there not this function in the View drop down with a shortcut? Am I missing something? Please help. Tx

      1 Reply Last reply Reply Quote 0
      • MAPJe71M Offline
        MAPJe71
        last edited by

        Am I missing something?

        Yes you are i.e. Hide Line Number Margin in the View menu.

        1 Reply Last reply Reply Quote 0
        • YaronY Offline
          Yaron
          last edited by Yaron

          Hello Bill,

          Install the Customize Toolbar plugin and Hide Line Number Margin will be added to the View menu.

          You can then assign a shortcut to this command via Settings -> Shortcut Mapper.

          Best regards.

          1 Reply Last reply Reply Quote 2
          • YaronY Offline
            Yaron
            last edited by

            You can then assign a shortcut to this command via Settings -> Shortcut Mapper.

            Hide Line Number Margin is not available in the Shortcut Mapper. Sorry.

            1 Reply Last reply Reply Quote 0
            • YaronY Offline
              Yaron
              last edited by

              You can assign a shortcut to Hide Line Number Margin by installing Python Script or Lua Script and then:

              1. Create a script containing the following line: notepad.runMenuCommand("View", "Hide Line Number Margin").
              2. Create a shortcut to the script.
              Bill FB 1 Reply Last reply Reply Quote 0
              • Scott SumnerS Offline
                Scott Sumner
                last edited by

                FWIW, this one-line Pythonscript will toggle line numbers on/off with each run, in case you don’t want to use the Customize Toolbar plugin:

                editor.setMarginWidthN(0, 0 if editor.getMarginWidthN(0) == 26 else 26)
                

                NOTE: For this to work, Display line numbers must be UNCHECKED in Settings (menu) -> Preferences -> Editing .

                1 Reply Last reply Reply Quote 1
                • Bill FB Offline
                  Bill F @Yaron
                  last edited by

                  @Yaron Tx, and to all others that took time to respond. I discovered I had to have the line numbers turned on before I installed the plugin for it to work. I’m happy to have that and will try the scripts for a shortcut. @Scott-Sumner I’ll check that out too.

                  1 Reply Last reply Reply Quote 0
                  • YaronY Offline
                    Yaron
                    last edited by

                    @Bill F,
                    You’re welcome.

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors