• Is it possible to change save as shortcut?

    Locked
    3
    0 Votes
    3 Posts
    915 Views
    Eugene SavitskyE

    O! Tnx!!!

  • Update to 7.7 ver and missed ASP code style

    Locked
    2
  • Plugins Admin not installing plugins

    Locked
    4
    1 Votes
    4 Posts
    3k Views
    Meta ChuhM

    welcome to the notepad++ community, @Darren-Wogan and thank you for your detailed information, including your debug info.

    However! … run as admin and set the proxy and retried and all of a sudden the new Plugins admin is working. Sure I tried this before without success, but its working now.

    this is what i would have asked, if you wouldn’t have found it yourself already 😉👍

    yes you are correct, and this is the most frequent hurdle for proxy users.
    notepad++ has to be run as administrator, to set the proxy.
    if it isn’t in administrator mode, at the time of setting the proxy, it will not give you any warning, but it will not be able to set the proxy.

    sorry for the inconvenience and best regards.

  • 0 Votes
    5 Posts
    1k Views
    Veyron BugattiV

    Ok. Thanks. Good luck.

  • Non Working Jumplist

    4
    0 Votes
    4 Posts
    822 Views
    Kevin SternK

    I just discovered if I pin from Notepad++ it doesn’t work. if I drag and drop onto Notepadd++ and pin it that way, it now works fine. Very odd.

  • 1 Votes
    1 Posts
    378 Views
    No one has replied
  • Start browser URL with selected text?

    8
    1 Votes
    8 Posts
    864 Views
    David-PatowD

    Thanks, Everyone. I think I’ve got enough clues to start my journey. You’ve been most helpful.

  • Replace around 100 different variables with variables in 300+ files?

    Locked
    2
    0 Votes
    2 Posts
    391 Views
    Alan KilbornA

    @Rasmus-K said:

    around 100 variables are changing names

    There is no “batch” replacement capability in Notepad++. I don’t know of a plugin that does this, either. It is certainly something that could be scripted with a N++ scripting language, or you could take it “outside” N++ and use just about any programming language to do it.

  • Plugins are pulling from install directory in new version

    Locked
    1
    0 Votes
    1 Posts
    302 Views
    No one has replied
  • V7.7 - File too big error - even when opening 1KB files?

    Locked
    10
    0 Votes
    10 Posts
    1k Views
    PeterJonesP

    @Johan-Santen said:

    It’s unfortunate this forum doesn’t allow screenshots to be posted, how do I show you guys the error?

    Upload to an external image-hosting service like imgur.com, then embed the image using the syntax

    ![](http://i.imgur.com/QTHZysa.png)

    which will render as

    .

    (If you are using imgur, please make sure to use the “direct link”, which has the i.imgur.com hostname, and includes the .png or .gif or .jpg extension at the end; that is the actual image; if you use the https://imgur.com/QTHZysa-style link, it will try to imbed the HTML wrapper-page from imgur as an image in the forum, and that won’t work. Other image-hosting sites are probably similar.)

  • Replace part of an expression from a line, in many documents

    Locked
    2
    0 Votes
    2 Posts
    431 Views
    Meta ChuhM

    welcome to the notepad++ community, @George-RJ

    if you want to replace all digits, that match the pattern 1.23, open the replace window and enter the following:

    find what: (\d.\d\d)
    replace with: 0.01
    search mode: regular expression

    then either replace one by one, or hit replace all.

    note: if those numbers also exist on positions you don’t want to replace, and you want to explicitly replace spawn_rate entries only, please enter the following:

    find what: spawn_rate : (\d.\d\d)
    replace with: spawn_rate : 0.01
    search mode: regular expression

    ps: if regex isn’t too overwhelming in general, please have a look at this faq section on where to find some understandable regex documentation for beginners:
    https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentation

    best regards.

  • Moving blocks along with content

    Locked
    15
    0 Votes
    15 Posts
    4k Views
    andrecool-68A

    @rddim It works, but when a block consists of a very large number of lines … it is not very convenient to do (visually you can lose the beginning and end of the block)

  • Notepad++ will not open any file

    Locked
    2
    0 Votes
    2 Posts
    402 Views
    EkopalypseE

    @Yurk-Huntz
    have you checked that your registry entries are correct?
    If you are using the zipped version, how did you register the shell extension?

  • Pythonscript plugin, how to insert console code into the startup script?

    Locked
    3
    0 Votes
    3 Posts
    505 Views
    SalviaSageS

    Yes, that worked.
    Thank you.

  • Assign Language by Line

    23
    0 Votes
    23 Posts
    6k Views
    EkopalypseE
    # -*- coding: utf-8 -*- from Npp import editor, notepad, INDICATORSTYLE, INDICFLAG, LANGTYPE, NOTIFICATION import xml.etree.ElementTree as et import os import json from pprint import pformat try: TextStyler().register_document() except NameError: SC_INDICVALUEBIT = 0x1000000 INDICATOR_ID = 8 class SingletonTextStyler(type): ''' Ensures, more or less, that only one instance of the main class can be instantiated ''' _instance = None def __call__(cls, *args, **kwargs): if cls._instance is None: cls._instance = super(SingletonTextStyler, cls).__call__(*args, **kwargs) return cls._instance class TextStyler(object): __metaclass__ = SingletonTextStyler def __init__(self): self.hidden_scintilla = notepad.createScintilla() editor1.indicSetStyle(INDICATOR_ID, INDICATORSTYLE.TEXTFORE) editor1.indicSetFlags(INDICATOR_ID, INDICFLAG.VALUEFORE) editor2.indicSetStyle(INDICATOR_ID, INDICATORSTYLE.TEXTFORE) editor2.indicSetFlags(INDICATOR_ID, INDICFLAG.VALUEFORE) self.npp_config_dir = notepad.getNppDir() self.styler_dict = dict() self.active_theme = et.parse(self.get_active_styler_xml()) # self.udls = self.create_udls_xml() self.lexer_keywords = self.get_langs_xml() self.list_of_document_ids = [] self.current_lexer = 'null' self.default_id = 0 self.memory_file = os.path.join(notepad.getPluginConfigDir(), 'TextStylerMemory.txt') self.remember_styles = None notepad.callback(self.on_langchanged, [NOTIFICATION.LANGCHANGED]) notepad.callback(self.on_fileclosed, [NOTIFICATION.FILECLOSED]) notepad.callback(self.on_filesaved, [NOTIFICATION.FILESAVED]) notepad.callback(self.on_shutdown, [NOTIFICATION.SHUTDOWN]) # there is an peformance issue when calling paint_it directly, # therefore we are hacking around langchanged notification def on_langchanged(self, args): ''' Gets called by npp when language change is deteced Resets to null lexer and calls main method ''' if (args['bufferID'] in self.list_of_document_ids): if notepad.getLangType() == LANGTYPE.TXT: if self.current_lexer != 'null': self.main(self.current_lexer) else: notepad.messageBox('Expected a lexer but null found', 'Error',0) else: self.current_lexer = editor.getLexerLanguage() if self.current_lexer == 'user': self.current_lexer = notepad.getLanguageName(notepad.getLangType()) notepad.setLangType(LANGTYPE.TXT) def on_shutdown(self, args): ''' Gets called by npp when shutting down TODO: store knwon files and their colors which then would be reused on fileopen/bufferactived callback ''' notepad.destroyScintilla(self.hidden_scintilla) def on_filesaved(self, args): ''' Gets called by npp when a buffer is saved TODO: check if doc is of interest if so, get current filename check if doc is empty if so delete from memory if not store current colors and their position ''' if (args['bufferID'] in self.list_of_document_ids): current_file = notepad.getCurrentFilename() from pprint import pformat values = [editor.indicatorValueAt(INDICATOR_ID,x) for x in range(editor.getTextLength())] prev_value = 0 fill_range = 1 sorted_values = [] for offset, value in enumerate(values): if value == 0: continue if prev_value == value: fill_range += 1 else: sorted_values.append((value, offset-fill_range, fill_range)) prev_value = value fill_range = 1 print(pformat(sorted_values)) def on_fileclosed(self, args): ''' Gets called by npp when a buffer gets closed Removes unneeded buffer ids from internal list ''' if (args['bufferID'] in self.list_of_document_ids): self.list_of_document_ids.remove(args['bufferID']) def get_active_styler_xml(self): ''' returns the xml path of the current theme ''' xml_file = os.path.join(self.npp_config_dir, 'config.xml') xml_doc = et.parse(xml_file) return xml_doc.find('GUIConfigs/GUIConfig[@name="stylerTheme"]').get('path') # def create_udls_xml(self): # ''' merge all udls from userDefineLangs into one big xml ''' # udls_dir = os.path.join(self.npp_config_dir, 'userDefineLangs') # udl_files = os.listdir(udls_dir) # root = et.Element('NotepadPlus') # for udl_file in udl_files: # xml_doc = et.parse(os.path.join(udls_dir, udl_file)) # user_lang = xml_doc.find('UserLang') # root.append(user_lang) # return root def get_lexer_styles(self, lexername): ''' Creates the styling dictionary by reading the styler xml ''' if lexername.startswith('udf - '): return # as long as hidden scintilla doesn't do the styling we are done here # tag = 'UserLang[@name="%s"]/Styles/WordsStyle' % lexername[6:] # lexer_styles = self.udls.findall(tag) # self.default_id = 0 # for id, result in enumerate(lexer_styles): # fgColor = result.attrib.get('fgColor', None) # if not fgColor: # notepad.messageBox('Received unexpected value\nid: {}\nfgColor: {}'.format(id, fgColor), 'Error',0) # return # red, green, blue = bytearray.fromhex(fgColor) # color = (blue<<16) + (green<<8) + red # self.styler_dict[int(id)] = color tag = 'LexerStyles/LexerType[@name="%s"]/WordsStyle' % lexername lexer_styles = self.active_theme.findall(tag) for result in lexer_styles: if result.attrib.get('name', None) == 'DEFAULT': id = result.attrib.get('styleID', None) self.default_id = int(id) else: id = result.attrib.get('styleID', None) fgColor = result.attrib.get('fgColor', None) if not fgColor: notepad.messageBox('Received unexpected value\nid: {}\nfgColor: {}'.format(id, fgColor), 'Error',0) return red, green, blue = bytearray.fromhex(fgColor) color = (blue<<16) + (green<<8) + red self.styler_dict[int(id)] = color def get_langs_xml(self): ''' returns a dictionary which contains all keywords for all defined builtin languages ''' xml_file = os.path.join(self.npp_config_dir, 'langs.xml') xml_doc = et.parse(xml_file) lexer_keywords = dict() for lang in xml_doc.findall('Languages/Language'): lexer_keywords[lang.attrib['name']] = lang.findall('Keywords') return lexer_keywords def paint_it(self, color, start, length): ''' Does the coloring by using an indicator ''' editor.setIndicatorCurrent(INDICATOR_ID) editor.setIndicatorValue(color | SC_INDICVALUEBIT) editor.indicatorFillRange(start, length) def main(self, lexer): ''' Gathers the needed information for the current selected lexer and sets these in the hidden scintilla. Calls hidden scintillas colourise method and retrieves the needed colors and their position. Finally sets it in the active document ''' text = editor.getSelText() text_length = len(text) if not text_length: notepad.messageBox('Nothing selected!', 'Error',0) return if not lexer: notepad.messageBox('lexer expected, received: {}'.format(lexer), 'Error',0) return offset = min(editor.getSelectionStart(), editor.getSelectionEnd()) # unfortunately udls behave different than builtin lexers # there for this hack until the secrets get revealed if lexer.startswith('udf - '): active_buffer = notepad.getCurrentBufferID() notepad.new() editor.setText(text) notepad.runMenuCommand('Language', lexer[6:]) styles = [(pos, editor.styleGetFore(editor.getStyleAt(pos))) for pos in range(text_length)] editor.undo() notepad.close() notepad.activateBufferID(active_buffer) for position, color in styles: self.paint_it(color[0] + (color[1] << 8) + (color[2] << 16), offset+position, 1) return # we are done here # else part - aka builtin lexer self.get_lexer_styles(lexer) keywords = self.lexer_keywords.get(lexer, None) self.hidden_scintilla.styleClearAll() self.hidden_scintilla.setLexerLanguage(lexer) if keywords: # not all lexers do have keywords, e.g. xml lexer for i, _keywords in enumerate(keywords): self.hidden_scintilla.setKeyWords(i, _keywords.text) self.hidden_scintilla.setText(text) self.hidden_scintilla.colourise(0, text_length) styles = [(pos, self.hidden_scintilla.getStyleAt(pos)) for pos in range(text_length)] color = self.styler_dict.get(self.default_id, None) if color is None: return self.paint_it(color, offset, text_length) # TODO: can default color different previous_style = [] sorted_styles = dict() for pos, style in styles: if previous_style: if previous_style[0] == style: previous_style[2] += 1 else: if previous_style[0] != 0: if previous_style[0] in sorted_styles: sorted_styles[previous_style[0]].append((previous_style[1],previous_style[2])) else: sorted_styles[previous_style[0]] = [(previous_style[1],previous_style[2])] previous_style = [style, pos, 1] else: previous_style = [style, pos, 1] for k, v in sorted_styles.items(): color = self.styler_dict.get(k, None) if not color: continue for _v in v: self.paint_it(color, offset+_v[0], _v[1]) def register_document(self): ''' store current buffer id in internal list ''' id = notepad.getCurrentBufferID() if id not in self.list_of_document_ids: self.list_of_document_ids.append(id) TextStyler().register_document() print('done') # -------------------------------------------------------------------------- # TESTDATA TESTDATA = ''' Start with an perl example use strict; # comment use warnings; print "Hello, World!\n"; ------------------------------------------------------------------------------ here we have an cpp example #include <iostream> using namespace std; // line comment int main() { /* multi line comment */ cout << "Hello, World!"; return 0; } ------------------------------------------------------------------------------ followed by an rust example fn main() { // Print text to the console println!("Hello World!"); } ------------------------------------------------------------------------------ an xml example <tags> <tag id="0" value="text" /> </tags> ------------------------------------------------------------------------------ an python example class test(object): def __init__(self): self.greet = 'Hello World!' # comment def do_greet(self): print(self.greet) ------------------------------------------------------------------------------ and finally udl markdown \1-2-3 *multiple italic*, **multi bold** and ***multi bold italic*** I have *a pen **I have an apple** uuh* Apple pen. I have **a pen *I have a pineapple* uuh** Pineapple pen! I have *a pen __I have an apple__ uuh* Apple pen. I have **a pen _I have a pineapple_ uuh** Pineapple pen! \* apple \* pen \* <!-- escape test \* t \* t \* t --> ```js var a = 1 * 1 ``` ****** <!-- hr --> ## Bullet point test - normal text * This should be normal text * mess up *some thing* (\* suppose \* it's \* normal) * This should be normal text ''' # --------------------------------------------------------------------------
  • Most of my plugins stopped loading after latest update

    Locked
    3
    1 Votes
    3 Posts
    526 Views
    dinkumoilD

    @eappell

    Since Notepad++ v7.6 the plugin management system has undergone some changes. In v7.6.3 and above every plugin needs to be moved to a separate folder under <Notepad++-install-dir>\plugins which has to be named like the plugin’s DLL file itself.

    Example: If a plugin’s DLL file name is ABC.dll it has to be moved to <Notepad++-install-dir>\plugins\ABC.

    Please note: If a plugin needs some companion files, mostly they need to be moved to that folder too. If these companion files have been located in e.g. <Notepad++-install-dir>\plugins\doc they have to be moved to <Notepad++-install-dir>\plugins\<Plugin-name>\doc, i.e. the former folder structure has to be kept. Sometimes, depending on the plugin, that even means that the folder <Plugin-name> has to be doubled, i.e. <Notepad++-install-dir>\plugins\<Plugin-name>\<Plugin-name>.

    Some plugins use hard coded access paths to their companion files, thus they will not find them at the new location. In that case the companion files have to stay at their old location (where they have been stored in Notepad++ versions prior to v7.6).

    If you have a lot of plugins you could use a script I wrote to automate the migration process. But be aware of the restrictions mentioned above! They are also applicable when using this script.

    You can download a ZIP file containing the script >>> from here <<<. You can read a description of the script >>> here <<<.

  • Shouldn't paste be made respecting correct space (at least) Preference?

    Locked
    10
    1 Votes
    10 Posts
    1k Views
    EkopalypseE

    @Alan-Kilborn

    Thanks, but most of it is stolen from other codes :-D
    But there are so many functions scintilla provide, I assume there are still some Perls out there which we haven’t figured out yet. :-)

    Name, what do you expect? :-D LOL - it gets converted anyway LOL

  • Using caret (circumflex) key for a shortcut

    Locked
    10
    0 Votes
    10 Posts
    3k Views
    dinkumoilD

    @Egon-Olsen , @Alan-Kilborn , @Ekopalypse

    Yeah, it’s the old new thing about keyboard layouts.

    On all PC keyboards world wide, no matter of which locale, keys have the same scan codes depending on their physical position on the keyboard. The keyboard driver for a certain locale translates them (under Windows) into virtual key codes. That’s what applications see when they read keyboard input. These virtual key codes are translated into the actual glyphs of the characters (at the end of the day a bitmap image) when they are displayed on the screen.

    If the keyboard driver supports so called “dead keys” it waits for a second key press to compose them to a resulting character, e.g. all these â,ê,î,ô,û,… letters used in various european languages. This way there are not so much weird key combos to input these characters.

    Unfortunately, in the shortcut mapper of Notepad++ all this isn’t taken into account. The person who programmed the key selector has used a hard coded table for the mapping of physical keys to their character representation, which is wrong for most locales. I wasn’t able to figure out yet, which keyboard locale this person used as a basis for the mapping.

    This is the mapping table for german keyboards between the key list in Notepad++'s shortcut mapper and the physical keys:

    | Npp shortcut mapper | German Keyboard | | |---------+------------| | | solo | with SHIFT | |---------------------+---------+------------| | ~ | ö | Ö | | - | - | _ | | = | + | * | | [ | ß | ? | | ] | ´ (DK) | ` (DK) | | ; | ü | Ü | | ' | ä | Ä | | \ | ^ (DK) | ° | | , | , | ; | | . | . | : | | / | # | ' | | <> | < | > |

    (DK) marks dead keys.

    I often thought about filing an issue about that but I think it will be nothing more than another forgotten minor bug in the issue tracker…

  • Replace Unicode values with characters (e.g. \u00e9 with é)

    Locked
    2
    0 Votes
    2 Posts
    4k Views
    Meta ChuhM

    welcome to the notepad++ community, @Morney-le-Roux

    you need to install the plugin HTML Tag, by using the built in plugins admin on newer versions of notepad++, or using the old plugin manager, if you are on notepad++ 7.5.9 or below.

    once installed, select your partial or complete text, like “ADAMS, Andr\u00e9as” and go to plugins > html tag > decode js, to get “ADAMS, Andréas”.

    best regards.

  • Can notepad++ work with Windows speech recognition ?

    Locked
    2
    0 Votes
    2 Posts
    3k Views
    Meta ChuhM

    welcome to the notepad++ community, @Angelo-Bancheri

    if you have managed to get windows 10 speech recognition to work for any other language than english, you will be able to start dictating by pressing windows + h.

    windows speech recognition will just simulate a keyboard entry, and type into any active editor or text field, but it is a pain in the a. to get it working at all and you will have to google a lot to get it going.

    once you’ve managed to get it running on windows by using one of the guides around, depending on your language, test it with word or notepad.exe first.

    best regards.