• help about lines arabic

    Locked
    4
    2 Votes
    4 Posts
    967 Views
    Claudia FrankC

    @saud-s.k

    a little bit cryptic but this one can do it

    editor.setText('\r\n'.join(reversed(['[keep.text]{}'.format(x) for x in editor.getText().splitlines()])))

    Cheers
    Claudia

  • Select multiple words / Copy multiple words

    Locked
    4
    0 Votes
    4 Posts
    2k Views
    Scott SumnerS

    @Terry-R

    I think your idea was covered in the thread I pointed to earlier…see where @guy038 in that thread says:

    SEARCH (?s)^.*?(Your regex to match)|(?s).*\z
    REPLACE…etc

    Like your recent suggestion, that is a destructive search, which may be a downside, although a simple Undo can take care of that after the resultant data is Copy’d out…

  • RegExp full syntax

    Locked
    5
    1 Votes
    5 Posts
    1k Views
    Scott SumnerS

    Ah, okay, I see from your first posting what you mean. No, Notepad++ has no built-in way of doing that. However, it is doable with a bit of prep work. These threads will show how:

    https://notepad-plus-plus.org/community/topic/15318/replace-text-with-incremented-counter https://notepad-plus-plus.org/community/topic/12967/replace-string-across-multiple-files-and-increment-value
  • How to insert [Path+Filename] into the Notepad text ?

    Locked
    4
    2 Votes
    4 Posts
    4k Views
    Elodie CEMOIE

    Thank you very much !

  • Finding multiple lines in multiple files and deleting just those lines

    26
    0 Votes
    26 Posts
    9k Views
    Steve Wilson105S

    Like I said, I understand MUCH better what the regex is supposed to do and is doing. This is the regex I’m using:
    (?i)^.?(<font.?|\sync.?correct|www.|.(?=Help other users)|please rate|Professional Translation|advertise your|== for|WWW.MY-SUBS.COM|SLY@Moon|subXpacio|www.opensubtitles.org|Open Subtitles MKV Player|Subtitles by|Synchr:AA|Support us and become VIP|to remove all ads|AmericasCardroom|.(?=Synced and corrected by BLuk)|Subrip by|million dollar).?\R

    It works flawlessly. If I run this regex on a directory of files and some of the files have consecutive lines listed for removal in the regex, I’ll get a message at the end like “Replace in Files: 26 occurrences replaced”. If I run the regex until it says “Replace in Files: 0 occurrences replaced”, all of the lines (including the multiple consecutive lines) will have been replaced. Except - occasionally there will be multiple consecutive lines at the very end of the subtitle I’m editing. In those instances, the very last line won’t have been removed. I can solve that fairly simply by loading every subtitle into NP++ and just making sure that there’s a blank line (simply a CR/FL) for the last line. I’ve tried to create a regex to do just that, but they aren’t working. It’s not a huge deal - this is MUCH better and I’m very appreciative, but if what I’m looking for is a trivial thing and anyone has suggestions they’d be very welcome.

    As always, thanks very much

  • You cannot receive donation?

    Locked
    1
    0 Votes
    1 Posts
    453 Views
    No one has replied
  • Convertxt macro

    Locked
    2
    0 Votes
    2 Posts
    669 Views
    Terry RT

    Can you provide some more detail? Macros are generally created by users for their own purposes, so is it possible whom ever is asking you to do this might have more information?

    Do you know what sort of function this macro does to your file. If it changes the source data a lot then it might actually be a ‘plugin’. These are programs that users can make using other programming languages, which are then incorporated into NPP to enhance it’s usefulness.

    Terry

  • case sensive

    Locked
    2
    0 Votes
    2 Posts
    678 Views
    PeterJonesP

    I assume you want “case sensitive matching” during a Find or Find And Replace? If so, then the toggle is in the same place it’s always been: in the Find dialog, there’s a ☑ Match Case which needs to be toggled on to match case, or off to ignore case.

  • command to compile and execute code in COBOL

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    PeterJonesP

    … For example, here’s an NppExec script that I use to save, compile, and run a standalone C++ program:

    npp_save cd "$(CURRENT_DIRECTORY)" g++ "$(FILE_NAME)" -o "$(NAME_PART)" npp_run cmd.exe /k "$(NAME_PART)"

    For compiling cobol, you would use your cobol compiler rather than “g++”, and would have to format the command line appropriately; if your compiler is not in your path, you will have to do something like “c:\full\path\to\compileCobol.exe”.

    If you don’t want to also run the program when compiled, then you could just remove the “npp_run …” command from the NppExec script.

  • Delete LF

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Scott SumnerS

    @Jose-Emilio-Osorio

    You could use a negative lookbehind assertion, e.g. (?<!\r)\n

    How did you get mismatched line-endings in your file, anyway?

  • Not remembering opened NppConsole

    Locked
    2
    0 Votes
    2 Posts
    746 Views
    Claudia FrankC

    @Esteban-Julián

    you probably better asking at the NppConsole forum
    unless you find someone here using it and knows the answer

    Cheers
    Claudia

  • Replace a special character

    Locked
    6
    0 Votes
    6 Posts
    2k Views
    Jose Emilio OsorioJ

    Thanks. It works without the + and ?.

  • Remember hidden lines after unhiding

    Locked
    4
    1 Votes
    4 Posts
    1k Views
    Claudia FrankC

    @Kris-S.

    I don’t know of a plugin doing this maybe someone else does.
    Npp itself offers this functionality only if you use folding instead of hiding but
    this means your document lexer needs to support this.

    I’m currently thinking about a python script solution but this raises the question,
    about the logic when to hide, which documents should be affected …

    Cheers
    Claudia

  • Creating and running macros

    19
    0 Votes
    19 Posts
    18k Views
    PeterJonesP

    @Tony-Moody,

    You must not …

    That’s not strictly true. “You must be careful if you …” would be the better way of phrasing that.

    C:\Documents and Settings\<username>\Application Data\Notepad++\shortcuts.xml

    And I can now identify that you’re on an older Windows, such as Win2k or WinXP. For more on the %AppData%, see our FAQ on the topic – which includes an explanation for how the simplest way to access folders in the user-app-data hierarchy is by %AppData%\FolderName, so you don’t have to know which file hierarchy your system uses.

    What I do is record a macro and run it to check. If it needs altering I either record it again or I have a go at editing it. One can add macros together by editing.

    Yep, those are good, solid advice.

    Editing Configuration Files

    As it says in NpWiki++: Configuration Files, “Because Notepad++ updates some of its configuration files on normal program termination, manual editing of a Notepad++ configuration file requires both specific procedures and good knowledge of the files’ layout. It is strongly advised to read about how to edit configuration files and the knowledge base for file layouts.”

    The editing configuration files page claims you have to mark the files as read-only, but that’s not technically accurate, either.

    Notepad++ will overwrite the shortcuts.xml file when it exits… but only if you’ve recorded a new Macro, or if you’ve used the Settings > Shortcut Mapper or Macro > Modify Shortcut / Delete Macro…. (There may be one or two other circumstances that I haven’t thought of, but if there are, they seem to be more rare.)

    A sequence that has always worked for me, every time, for editing the shortcuts.xml from within Notepad++:

    Close all active instances of Notepad++. This will make sure Notepad++ saves any changes it needs to save into shortcuts.xml. Open one instance of Notepad++. Do nothing else regarding Notepad++, other than what’s described in these steps, while following these instructions. Do not open another instance. Do not change GUI settings, especially the Shortcut Mapper… or Modify Shortcut / Delete Macro…. Open %AppData%\Notepad++\shortcuts.xml using that one instance of Notepad++ if you’re in a portable installation, open the local shortcuts.xml instead Make your edits to shortcuts.xml using that one Notepad++, without opening any other instances. Save shortcuts.xml Close that one instance of Notepad++. When you open Notepad++ again, the changes you made should take effect if you handcrafted a new macro, or edited an existing one, it should be available in the Macro menu. You can also re-load shortcuts.xml to make sure the changes are still in place; they should be (they are for me). If shortcuts.xml is open, either Close shortcuts.xml again, so that you don’t expect it to be editable this time,
    or if you do want to safely edit shortcuts.xml more, and haven’t done anything else with Notepad++, you’re effectively back at step #3 right now, and can continue the sequence from there
  • 0 Votes
    1 Posts
    518 Views
    No one has replied
  • can't donate

    Locked
    1
    1 Votes
    1 Posts
    552 Views
    No one has replied
  • NP++ 'ignores' parenthesis in remote session while editing Python

    Locked
    6
    0 Votes
    6 Posts
    2k Views
    Chip WachobC

    Thanks to all.

    Just got Npp with NppFTP plugin working. The ‘help’ for NppFTP is a little light, but once you set up your ‘server’ in NppFTP and click on the chain link, you are good to go…

    Used vsftpd and xinetd per here

    https://linuxconfig.org/how-to-setup-and-use-ftp-server-in-ubuntu-linux

    On the Ubuntu side.

  • Automatic update of "modified:..." in .md file header

    Locked
    2
    2 Votes
    2 Posts
    852 Views
    PeterJonesP

    What you want is something that will set a callback on the FILEBEFORESAVE notification.

    You could use PythonScript – download the latest using the Plugin Manager, or directly from the github repo releases. The Plugins > Python Script > Context-Help will bring up a help window; navigate to Notepad++ Object and scroll down to notepad.callback(function, notifications) for the syntax.

    You can search this forum for “callback” to find other complete examples of how to set up a callback. (You would want to put the callback initialization in your startup.py in order to get it to be always enabled.) I believe there are also examples in the forum of applying a callback only to a particular type of file – for you, you’d presumably want it only if the file was a .md markdown file.

    I assume LuaScript would also have the notification/callback feature, too (though I could be wrong).

  • Changing NPP's GUI

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    Embedding the image you linked:

    I believe that the blue background you are referring to on the menu bar and the icon bar are a function of your operating system. I use Windows 10 64bit OS, and mine does not have the blue tinge to the title bar, menu bar, and icon bar. If I remember correctly, Windows 7 used the faded blue backgrounds.

    The icons, themselves, however, I do see the same icon shapes… just not with the bluish background tinge:
    Imgur
    I opened both the Settings > Style Configurator to show I had temporarily selected Zenburn, and the Settings > Preferences > General to show I’ve got ☑ Standard icons selected. If I change to ☑ Small icons or ☑ Big icons, they are definitely a different image/icon: specifically,
    and

    Note that the icons don’t change when I change the theme; they just change as I go between small, big, or standard.

  • Help with regex

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    C Ananda RaoC

    @PeterJones Thank you so much! It worked!

    I went through the FAQ. But the whole regex thing looked so frightening that I decided to depend upon the kindness of strangers. Not being a programmer, I felt that it would take me at least a couple of months just to get an idea about it.