Community
    • 登入

    Open text file and jump to the end

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    10 貼文 4 Posters 2.6k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Rahan BölzerR
      Rahan Bölzer
      最後由 編輯

      Hey Guys, can i open a text file like a log File and jump automaticly to the end of the file?
      Maybe with a aditional parameter. Or with nen start macro.
      I know i can press Strg+End, but other people dont know this.

      PeterJonesP Alan KilbornA Michael VincentM 3 條回覆 最後回覆 回覆 引用 0
      • PeterJonesP
        PeterJones @Rahan Bölzer
        最後由 PeterJones 編輯

        @Rahan-Bölzer ,

        That feature is not built into Notepad++ as far as I am aware.

        To get an “[on] start macro”, you could use a plugin like PythonScript, and add editor.documentEnd() to startup.py, with the PythonScript > Configuration setting Initialisation: ATSTARTUP

        <edit>: That will only get it in the first active window. If you also want it every time you load a new file, you’d also have to define a callback for NOTIFICATION.FILEOPENED (there are some examples of callbacks in the PythonScript docs after you install the plugin)</edit>

        1 條回覆 最後回覆 回覆 引用 1
        • Alan KilbornA
          Alan Kilborn @Rahan Bölzer
          最後由 Alan Kilborn 編輯

          @Rahan-Bölzer said in Open text file and jump to the end:

          I know i can press Strg+End, but other people dont know this.

          I think you mean Shift+End , but it could be that “Strg” is a non-English keyboard thing that I’ve never heard of.

          Anyway, Shift+End is a keycombo that works in most Windows programs – wouldn’t it be a good idea to educate other people about how things work?
          That seems to me like the best solution.

          PeterJonesP 2 條回覆 最後回覆 回覆 引用 2
          • PeterJonesP
            PeterJones @Alan Kilborn
            最後由 PeterJones 編輯

            @Alan-Kilborn said in Open text file and jump to the end:

            I think you mean Shift+End

            I think you mean Ctrl+End. By default, Shift+End selects to the end of the line. By default, Ctrl+End moves the cursor to the end of the document

            60289620-f782-40f8-a251-1aef599fe21e-image.png

            Alan KilbornA 1 條回覆 最後回覆 回覆 引用 1
            • Alan KilbornA
              Alan Kilborn @PeterJones
              最後由 Alan Kilborn 編輯

              @PeterJones said in Open text file and jump to the end:

              I think you mean Ctrl+End

              Yep, oops.

              That shows how little I think about it – I just DO IT!
              If you learn it and train yourself in its use early on, it becomes second-nature muscle-memory.
              One more argument for educating the masses.

              (I think I was thrown in what I was typing by OP’s use of “Strg” which made me think of “Shift”).

              Regardless, where I said Shift in my previous post, replace with Ctrl !
              Sorry.

              1 條回覆 最後回覆 回覆 引用 2
              • PeterJonesP
                PeterJones @Alan Kilborn
                最後由 編輯

                @Alan-Kilborn said in Open text file and jump to the end:

                it could be that “Strg” is a non-English keyboard

                Specifically, according to a quick search, Wiki says it’s German keyboards, being the abbreviation for “Steuerung”.

                Alan KilbornA 1 條回覆 最後回覆 回覆 引用 1
                • Alan KilbornA
                  Alan Kilborn @PeterJones
                  最後由 編輯

                  @PeterJones said in Open text file and jump to the end:

                  Wiki says it’s…

                  The key part of that:

                  …(thus e.g. “Ctrl” is translated to its German equivalent “Strg”, for Steuerung).

                  1 條回覆 最後回覆 回覆 引用 0
                  • Michael VincentM
                    Michael Vincent @Rahan Bölzer
                    最後由 Michael Vincent 編輯

                    @Rahan-Bölzer said in Open text file and jump to the end:

                    and jump automaticly to the end of the file

                    It’s a bit “hacky”, but could you just use the -n command line argument and put in a ridiculously large number (i.e., greater than the number of lines in your file)?

                    For me, opening a 2827 line file with:

                    notepad++.exe -n1000000000 file.txt
                    

                    puts the cursor on the last line of that file.

                    Note: Windows 10 64-bit, Notepad++ 7.9 64-bit

                    Cheers.

                    Alan KilbornA 1 條回覆 最後回覆 回覆 引用 6
                    • Alan KilbornA
                      Alan Kilborn @Michael Vincent
                      最後由 編輯

                      @Michael-Vincent said in Open text file and jump to the end:

                      It’s a bit “hacky”, but could you just use the -n command line argument

                      I 💙 this solution.
                      I don’t see it as “hacky”.
                      Well…
                      I don’t see it that way because we’re all about “hacks” here. :-)

                      Michael VincentM 1 條回覆 最後回覆 回覆 引用 3
                      • Michael VincentM
                        Michael Vincent @Alan Kilborn
                        最後由 編輯

                        @Alan-Kilborn said in Open text file and jump to the end:

                        I don’t see it as “hacky”.

                        I was hoping -1 (negative one) would be like “last array element” and bring me to the last line, but it didn’t work. I would think that would be “less hacky”.

                        :-)

                        Cheers.

                        1 條回覆 最後回覆 回覆 引用 4
                        • 第一個貼文
                          最後的貼文
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors