• Adding a vertical column to the right side

    4
    0 Votes
    4 Posts
    1k Views
    PeterJonesP

    @MachineThatGoesP1NG ,

    maybe there was some sort template that i could apply to text files.

    Notepad++ doesn’t have a builtin templating system. I use the QuickText plugin, available through Plugins Admin. Then, in the QuickText settings, I would pick the right language (if you’re using a UDL instead of a builtin language, I think you pick “External” from the dropdown, but I’ve never tried that). You can then define a new quick-text keyword, and then in your document, you’d use type the quick-text keyword then use the assigned keystroke for QuickText completion (I think TAB is the default; I change mine to Ctrl+Shift+Enter, because TAB has too many important meanings to me to be also used for this function).

    In the languages that I use, I have a QuickText entry called “start”, so I would type start then the keystroke (or Plugins > QuickText > Replace Snip), and get my starter template.

    But I’m guessing what you really want is “I want to be able to take my existing code and add the column easily”. Since macros don’t know how many lines are in your file, if I were doing it for me, I would be tempted to pull out the PythonScript plugin, and code up something that would add the veritcal-bar comments to all the lines in the file.

    with shift tab to push them back

    Shift+Tab works for shifting the first non-space characters of a file back one tab-stop (honoring your language’s tab settings for using either n spaces or the actual tab character). But for something that’s later on the line, I would again just recommend using the column-mode editing (either via Alt+Click as I said before, or using Edit > Begin/End Select in Column Mode for long files – use that once to set it at the beginning, then Ctrl+End to get to the end of the document, move the caret to the right column of the last line, and use it again to end the selection) and then delete that selection to move it left (or do one or more TABs or spaces to move right)

  • Remove duplicate lines not possible?

    24
    0 Votes
    24 Posts
    4k Views
    Alan KilbornA

    @endolith said in Remove duplicate lines not possible?:

    It depends on the text?

    Could be a line-ending problem?
    If line-endings are different on otherwise duplicate lines, they won’t be considered true duplicates.

  • notepad++ editing and searching

    2
    0 Votes
    2 Posts
    157 Views
    Mark OlsonM

    @Gen-Gen
    If none of your passwords or the domain names to which they correspond contain a colon (literal :), this is an easy find-replace:
    FIND: .+:([^:]{8,15})$
    REPLACE WITH: ${1}
    Regular expression ON.
    Example:
    Converted

    PYUTGPBQzTM@LZsJeXV.pDNTx:IBge1O9h 8Ej4Yvadj4m.NJr:DqSyjWpm bN6wc76fo4n@YYyqy.USPao:vcoT7KF584g OMm7PAVs9iy4.xTCQ:Sz4iAC02 qH7BVQxhor.jwxZ:6Oyb8nuPjW lKgyhCKKu@flBQpAB.rRXmG:2o9mtT9boc8bg0 G41wuU.VIT:Q4TDoVqIe5o3I gGNBYv8abkJ.rlev:YA9duaEwmG G3nVFy@repHcft.RfhM:N70Gnr6YcYIm hr9Fa8YnJHG1@MjZKlEo.NGxF:qZYmosMf7KFnq KuhwiopHHu.BpLR:YUqNT0dLBX MenK6RKfL@JzcbtFd.Qelr:sXSRBOg0q MskMswpfCsZa.cJBX:dISQwNJn2EIo ayx3xXUw4f@mOHliOF.GTrIo:HpEigj5In0 msGP447Um@KplNWkgB.LsfJ:oM2ZdFe8P GtSojZe8.ZBQJ:UzbBJdos8I2e MMUkZ3EX@apVKI.FEUK:vf1fG2bmHeYtbFT RPxo3RX8sdH@RIQGxFPXMh.HfS:b6d8qOSNkq u1OuDyumF2W.DmAR:40FyTgDi5PFTal4 nQBU7X@xAXZgvN.YIpr:CduOg6J83gI

    into the stuff after the colon, i.e

    IBge1O9h DqSyjWpm vcoT7KF584g Sz4iAC02 6Oyb8nuPjW 2o9mtT9boc8bg0 Q4TDoVqIe5o3I YA9duaEwmG N70Gnr6YcYIm qZYmosMf7KFnq YUqNT0dLBX sXSRBOg0q dISQwNJn2EIo HpEigj5In0 oM2ZdFe8P UzbBJdos8I2e vf1fG2bmHeYtbFT b6d8qOSNkq 40FyTgDi5PFTal4 CduOg6J83gI

    If any passwords or domain names contain a colon, this becomes much more irritating, and I’d have to give it a good think.

    FWIW this task becomes trivial if you used a horizontal tab (as in, the character from the Tab key) to separate passwords from domain names, because horizontal tabs are never allowed in passwords or URLs.

  • Notepad++ crashes (or immediately exists) when starting

    4
    0 Votes
    4 Posts
    328 Views
    PeterJonesP

    @Will-Pittenger said in Notepad++ crashes (or immediately exists) when starting:

    @PeterJones Seems to be JsMapParser.NppPlugin. Doesn’t seem to be a newer version. I have 4.2 and that’s the latest.

    At this point, you need to submit an issue with the plugin developer/maintainer. While waiting for a resolution, your options are to forgo using that plugin, or to downgrade to an old-enough Notepad++ to be compatible with that plugin.

  • connect notepad to gaming console

    6
    0 Votes
    6 Posts
    815 Views
    PeterJonesP

    @Gabr-Care ,

    So you are talking about this screenshot here?

    b51c17e9-5b44-479d-abe4-99f57798fff8-image.png

    The video is showing using Notepad++ to code in Python. It is not Notepad++ which is responding to the video game – it’s the python code which is doing something. So they used Notepad++ to edit some script (which they showed very briefly). They were then presumably running that script using the python interpreter to somehow interact with the video game. So what you’re really asking is “how do I code in Python to interact with video game X on my Switch or other Console?”. And the answer to that is, “you learn the Python programming language; then you find out whatever system that video’s creator is using to interface their python code with their game, and learn how to use that system and library; then you type the code in Notepad++, then you have to run that code through whatever system they were using”.

    From a “how it works” perspective, it’s got nothing to do with Notepad++ – whether you use Notepad++ or Atom or VSCode or MS notepad.exe to type your code – the coding techniques are completely independent of the editor. So, as I told you in December, to type the code (the only part that has anything to do with Notepad++), “You open a file in Notepad++ and start typing.” To know what to type is up to you, hence I pointed you to our FAQ (https://community.notepad-plus-plus.org/topic/15958/faq-desk-you-ve-asked-your-question-in-the-wrong-place) which explains why we are not going to be able to teach you to code in this forum, just becasuse you want to use Notepad++ to do the coding.

  • "This file has been modified by another program"

    3
    0 Votes
    3 Posts
    442 Views
    PeterJonesP

    @rdipardo said in “This file has been modified by another program”:

    still the only documentation

    Sorry, I didn’t know about that flag-file.

    I just created an issue and will add the notes from that commit message to the User Manual, so it will be described in the next release of the Online User Manual.

  • Syntax Highlighting (BASH/shell) question/bug

    6
    1 Votes
    6 Posts
    3k Views
    Michael VincentM

    @Trevor-S said in Syntax Highlighting (BASH/shell) question/bug:

    @Michael-Vincent Yes indeed, thanks!

    Great! Then if you’re comfortable, upgrade now since 8.5.5 is available; otherwise, wait for the autoupdate usually about 7-10 days after the release - if all goes well.

    No need to mark the question answered, it just stays like this for posterity.

    Cheers.

  • How to see .htaccess file in directory tree

    4
    0 Votes
    4 Posts
    493 Views
    PeteNorrisP

    @PeterJones

    Mr. Kilborn, Mr. Jones;

    Thank you for responding.

    I added the -al to the “LIST Parameters:” box under the FTP Misc. tab and it now works fine.

    Thanks again for the information.

    PN

  • Keep hidden lines hidden

    9
    1 Votes
    9 Posts
    2k Views
    mkupperM

    @Gideon-Addai said in Keep hidden lines hidden:

    I have a long script file which I edit from time to time, and its annoying to use the search function every time to go to a certain line. It would be nice to keep hidden lines hidden, any ideas?

    I get around that issue by taking advantage of that Notepad++ already has the -n command line option to open a file at a specific line number or to jump to that line if it’s already open. Notepad++ does not have a similar command line option to go to a specific line based on a search of the text in the file I want to open. To get around this I first figure out the line number and then use Notepad++'s -n command line option when opening the file.

    Here is a trimmed down batch file script:

    set XFILE=c:\path to the text file set "XTAG=The tag or anchor within the text file I want to go to" findstr /n /c:"%XTAG%" "%XFILE%" >"%TEMP%\~nptag1.txt" if errorlevel 1 goto :tag_not_found sed -r -n -e "s~^([0-9]+):.+~set XLINE=\1~p" "%TEMP%\~nptag1.txt" >"%TEMP%\~nptag2.bat" if errorlevel 1 goto :sed_failed set XLINE=1 call "%TEMP%\~nptag2.bat" "%ProgramFiles%\Notepad++\Notepad++.exe" -n%XLINE% "%XFILE%"

    The script first uses findstr to return a list of lines with their line numbers that match XTAG. If desired, I could use findstr’s /r option for the crude regular expressions that findstr supports.

    The script then uses GNU sed to extract the line number(s) from the findstr results and to convert those into a .bat file line that sets the XLINE variable for each line found. If more than one line matches XTAG then there will be more then one line in the temporary batch file meaning we will jump to the last XTAG found. If that bothers you then you can add logic to deal with this.

    The script then calls the temporary batch file to set the XLINE environment variable.

    Last is the line that runs Notepad++ and opens the text file at the desired line number. If you are using a 32-bit installation of Notepad++ on a 64-bit machine then use %ProgramFiles(x86)% instead of %ProgramFiles% in the last line or replace it with the path to your copy of Notepad++ (The full path is in Notepad++'s ? / Debug info... results in the Path: line.)

  • No results in "print" python command

    4
    0 Votes
    4 Posts
    307 Views
    David ZevallosD

    @Alan-Kilborn tks a will do

  • Using Mark (Markers) and Styles

    34
    1 Votes
    34 Posts
    19k Views
    Alan KilbornA

    @Victorel-Petrovich said in Using Mark (Markers) and Styles:

    the conclusion is that this feature is broken (if I can break it so easily).

    it is easy to get the UI out of sync just using the built-in features (no scripting).

    Ah, OK – I thought you meant something with the script.
    Yes, the feature is very broken, for many reasons.
    This has long been known.

  • I need help with deleting specific lines

    4
    0 Votes
    4 Posts
    265 Views
  • Replace a specific char with the begining of the line

    3
    0 Votes
    3 Posts
    1k Views
    Axel BlitzA

    @PeterJones said in Replace a specific char with the begining of the line:

    Peter Jones you saved my day !!
    Thank you very much <3

  • Plugin installation don't works

    8
    0 Votes
    8 Posts
    1k Views
    rdipardoR

    New Problem: The plugin “NppXmlTreeview 2” crashes always at startup. Error message: “NppXmlTreeviewPlugin.dll just crashed in runPluginCommand (size_t i:58)”

    Actually an “old” problem

    Indeed, even older than I thought.

    The problem seems to only affect version 2 (“Rome”). 1.5.0.54 (“Berlin”) apparently works fine.

  • Code Folding Plain Text in Dark Mode

    2
    1 Votes
    2 Posts
    389 Views
    PeterJonesP

    @Frank-Wojtczak ,

    UDLs are mostly independent of themes – you define their colors separately from the theme colors. By using “transparent” background instead of fixed background (right click on the color square, or click the “Transparent” checkbox if you’re in a new enough version of Notepad++), you can alleviate some of the problems of it not matching well with the rest of your theme, because it will just inherit the background from your theme. But a foreground color that works well on a light background will not usually work well on a dark background. This is the reason that even the Markdown UDL that distributes with Notepad++ has two versions – one if you’re in Dark mode, and one for default light mode.

    how can you edit a User Defined Language

    Language > User Defined Language > Define My Language, then select your UDL from the User Language dropdown. Then edit the keywords,operators,styles, etc just as you did when you created.

    how can you delete a User Defined Language

    Language > User Defined Language > Define My Language, then select your UDL from the User Language dropdown. Then Remove

    See also: https://npp-user-manual.org/docs/user-defined-language-system/
  • Move NPP to new computer

    6
    1 Votes
    6 Posts
    11k Views
    PeterJonesP

    @Future Readers,

    If you have been reading this topic to find out how to copy settings from one computer to another, this 2023 discussion gives one more caveat to my instructions from Aug 2019:

    If the OLD computer and NEW computer have different usernames, or otherwise use different paths for the %AppData%\Notepad++ directory resolution (maybe it’s on d:\users\abc\AppData\Roaming\Notepad++ on OLD and c:\users\long.name\AppData\Roaming\Notepad++ on NEW), then you might also have to edit the NEW copy of session.xml and possibly other config files, and if they have any paths in those config files that referenced the OLD AppData, you will have to update to the NEW AppData.

    In general, in session.xml and other config files, if there are paths in those files, they are hardcoded to full paths… so if those full paths do not exactly match on both machines, you will have to edit the config files or Notepad++ cannot find the files referenced by those paths.

  • Moving Notepad++ to new computer *Including all the opened tabs"

    4
    0 Votes
    4 Posts
    31k Views
    PeterJonesP

    @PJ-Hankins ,

    Glad you found it.

    The directory path names need to be changed in the source.xml [session.xml] and config.xml files on the target to point to the new directory name for %AppData%

    That is true: since session.xml and other config files use full paths without windows variable expansion, they cannot just store %AppData% and instead store a hardcoded path. With a hardcoded path, then purely copying is not sufficient.

  • Update CLI command

    3
    0 Votes
    3 Posts
    3k Views
    mkupperM

    @Michal-Šunka To add to what @PeterJones posted, you can run gup.exe --help (with two leading – dashes) and it’ll show you the command line options.

    Typically, when someone selects the ? / Update Notepad++ menu option it runs
    "C:\Program Files (x86)\Notepad++\updater\gup.exe" -verbose -v8.55 where the -v8.55 is the current version of Notepad++.

    gup.exe has a web site, https://wingup.org/, but the details of the command line options don’t seem to be explained so you can figure out what works best for your setup.

  • Need to extract specific info from text file

    10
    0 Votes
    10 Posts
    1k Views
    Alan KilbornA

    @Alexander-Verbitsky said in Need to extract specific info from text file:

    My solution transforms text as OP wants. OK, I don’t know, maybe marking text suits his need.

    All OP said was “extract”, not “transform”.

  • Can't find the unsaved tabs after Window 10 automatic update

    2
    0 Votes
    2 Posts
    236 Views
    PeterJonesP

    @Vincent-Pringalle said in Can’t find the unsaved tabs after Window 10 automatic update:

    2 days ago after an unsollicited Windows 10 update, Notepad+ reopened without any tabs. The C:\Users\USER\AppData\Roaming\ does not contain any Notepad++.

    If you only use Portable with doLocalConf.xml in the portable directory, then then it will never create anything in the AppData hierarchy. So looking there most likely won’t help you with your portable version.

    Moreover as I use Notepad++ in Portable mode, the dir …_portable_Notepad++\App\Notepad++\backup\ defined in Settings / Preferences / Backup contains some unsaved tabs but with outdated contents : the tabs modified last week were dated feb 2022…

    Could you show us

    A screenshot of Settings > Preferences > Backup Paste a copy of your ?-menu’s Debug Info let us know where you got your portable Notepad++

    Do you have nppLogNulContentCorruptionIssue.xml in your portable directory? if so, did it create nppLogNulContentCorruptionIssue.log in the portable directory when the crash occurred? If so, its contents might be able to give some insight into the sequence of events that led to your periodic-backup-and-session-snapshot being corrupted.

    In order to proceed with my works, I backuped this backup dir before reusing Notepad++ again.
    Could someone help me retrieving my recent unsaved tabs dated last week ?

    Most likely not: if the files aren’t in the portable backup directory, then somehow Notepad++ was convinced that you had told it that it was okay to delete the unsaved files, and so they haven’t been saved. At that point, as it mentions in our backup FAQ, you might have to resort to file recovery software (we give the example of “Recuva”, but make no guarantees or warranties regarding that separate piece of software), which may or may not be able to see the no-longer-visible files in the portable backup directory. That FAQ has suggestions for how to prevent this loss of data in the future.