• Login
Community
  • Login

Line Number Shortcut

Scheduled Pinned Locked Moved General Discussion
shortcutlinenumber
8 Posts 4 Posters 5.3k Views
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.
  • B
    Bill F
    last edited by Sep 5, 2017, 8:43 PM

    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
    • M
      MAPJe71
      last edited by Sep 5, 2017, 9:30 PM

      Am I missing something?

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

      1 Reply Last reply Reply Quote 0
      • Y
        Yaron
        last edited by Yaron Sep 5, 2017, 11:24 PM Sep 5, 2017, 11:22 PM

        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
        • Y
          Yaron
          last edited by Sep 5, 2017, 11:42 PM

          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
          • Y
            Yaron
            last edited by Sep 6, 2017, 12:04 AM

            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.
            B 1 Reply Last reply Sep 6, 2017, 11:08 PM Reply Quote 0
            • S
              Scott Sumner
              last edited by Sep 6, 2017, 8:01 PM

              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
              • B
                Bill F @Yaron
                last edited by Sep 6, 2017, 11:08 PM

                @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
                • Y
                  Yaron
                  last edited by Sep 7, 2017, 11:03 PM

                  @Bill F,
                  You’re welcome.

                  1 Reply Last reply Reply Quote 0
                  1 out of 8
                  • First post
                    1/8
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors