Menu

Suggestion regarding Find (volatile) keys

maksee
2009-07-21
2012-11-13
  • maksee

    maksee - 2009-07-21

    Hi,
    thanks not npp, I like the fact that everything I thought I could not adjust finally was possible )

    I suggest changing the default keys for volatile search. I know that it's not a good idea since defaults should not be changed in general but I'll explain.

    Once I wrote a plugin (expert) for Delphi that did the same as Find (volatile). I called it Wident (Where is identifier) and I chose CTRL-ALT-Up, CTRL-Alt-DOWN for the task. You may bet when I find the feature in npp, I changed the keys and use it this way from now on. But just think about this keys variation comparing to default CTRL-F3, or (which is better) try it, it will probably change the way you think and search identifiers in your code. It works like this. When you're somewhere where function is called, you will probably would like to find where it's defined, you think 'UP' - you press UP. In another situation, when you're writing a function, you could want to look at the place when it's used in this case you think DOWN - you press down. In any other situation hands are near these keys just to press quickly to find the identifier referene. Just try and you'll like it )

    So, I suggest that if you like the way you look and work with your sources, changing the default keys could be a violent act, but partly ideological and sharing. Anyway, if it's not possible, consider this post as a tip ))

    Thanks

    Max

     
    • cchris

      cchris - 2009-07-21

      The day Find in files will be recordable as a macro again, the "down" part will be easy. Btw, Ctrl+Alt shortens to AltGr on european keyboards.
      As for finding where a function is defined, I like the way FunctionList tells me about it.

      CChris

       
    • maksee

      maksee - 2009-07-23

      Christian,
      thanks for your comment, I see what you mean considering that in serious projects function definitions and usage rarely resides in the same files, but the metaphor works not only for (some of ) programming languages, but for general texts too. You read text, you see Alice, you think "Who is Alice? She was probably was introduced before..." (before=up) and press (Ctrl-Alt)-Up. Once again, you think "Will Alice be mentioned after?" (after = down), you press (Ctrl-Alt)-Down. And moreover, it works like fast navigation, because once you discovered Alice two clicks away you will return to the initial place just by pressing the reverse shortcut the same amount of times (imagine, your left hand still lays on CTRL-ALT, and you only have to move your middle finger a little from UP to DOWN).

      I know that it is possible to get used to current shortcuts, but they just dont' reflect this "before-after" relation that helps a lot in daily usage. Once again, this "temporarily jump to another place where this word appeared and return" scenario is not so "natural" to use with the current shortcuts.

      And once again, I'm completely content with the fact that npp allows me to change everything, just looking for a way to share my experience )

       
    • cchris

      cchris - 2009-07-23

      What about Search "Alice" Find all in current ocument, and then navigate using F4/Shift+F4, or whatever you remap these to? You can close the Results window if it bothers you.

      Or use Find All instead with the LMark lines option. This drops a bookmark on any line Alice appears. Then use F2/Shift+F2 to navigate - again, nothing prevents you to change these keys.

      How are these different?
      When dealing with multiple files, , "before" and "after" become fuzzy, because how are you telling which file is before which one?

      CChris

       
    • maksee

      maksee - 2009-07-24

      Chris,
      a real example, just a couple of minutes before I read your reply, I added several lines in my php project with npp. It was some call and I saw that a constant should not be hardcoded in the call, but defined separately at the beginning of the file. So I typed MYCONSTANT, copied it, CTRL-Home to go at the beginning of the file (constants area), Shift-Ins to insert it (I'm one of those who never uses CTRL-C,V for texts) and immediately CTRL-ALT-Down to return to the initial place (and it it was done successfully because I know I typed this word there). So it was not an action of me thinking "Ok, there's a word, lets discover the places it relates to", it was just a quick daily action of saving time that can appear dozen times in a day and save finally much more time. And as for "universal" searching between files, I agree, it's not possible with this approach, but anyway, if you're coding, you're identifier- or keyword-centered. If so, there are always language-specific words like 'function', 'class' and so on, there are always more than one reference of local variable in one file or local function in one file, constants etc. so you probably needs to jump between them more often than you think you need in the first place.

      As for the flexibility of npp, I'll say once again just one word "Perfect" ) The only minor suggestion for the Volatile feature is to have a possibility to disable Wrap Around like it is possible with  general search. I don't know how to do this since this feature doesn't have its own dialog, maybe use the same option from the general dialog? Anyway, I can live with that ) Thanks

       
    • maksee

      maksee - 2009-07-24

      Chris, I would like to add some explanation I since while talking to you I finally understood what this suggestions was about )
      Assigning shortcuts that contains Up and Down (it can be any other, not only ctrl-alt) simply embeds "search results" window right into the text window without necessity to do extra actions every time. Because if we look at the feature we see that staying at some word and having something-Up and something-Down for jumping between the appearances is just ready "list" metaphor. And having it available right at your fingers gives it power. Sorry for posting so much )

       
    • cchris

      cchris - 2009-07-24

      No problem.

      Did you consider using TextFX -> TextFX Viz -> Hide lines without (Clipboard) ? I should have mentioned it earlier:

      Select word and copy to clipboard
      Use the command. Now you only see tose lines with "Alice" in it.
      And there is a "Show more lines around my position" menu entry, I let you discover this.

      Otherwise, you sure can post your request on IdeaTorrent. But be sure to explain why the many currently available ways need to be supplemented wihth anither - I'm not saying you are not right, just that many people may think there are many already.

      If TextFX was still actively developed, I'd ask the developer a "Bookmark visible lines" new command. But this is a different story.

      DARN!
      I was going to hit the big grey button when I thought of yet something else:

      Add a tiny change, like an extra space, to this line you started from. Then go to top of file and do your stuff. Then Change Markers -> Jump to previous unsaved change. Again, you can map this to Ctrl+Alt+Down or whatever you like - Windows key is not supported.

      CChris

       
    • maksee

      maksee - 2009-07-24

      Very, very impressive, thanks, so many ways to achieve the same or similar ). But I'll think twice to go further with IdeaTorrent since I may just add extra mess )). Personally, it would be great if there's a site where anyone can post ideas about not chaning, but just using npp and plugins and vote there, so anyone can see and read most popular tips. I know that there are many pages like "tips for using notepad++", but I just don't have time to read them all unfortunately...

       
    • cchris

      cchris - 2009-07-24

      Don' worry, you cannot mess up IdeaTorrent. I didn't achieve that as a moderator :-) Well, I know how I could, though.

      Ok, I'll open a new IdeaTorrent category called Tips & Tricks, and then one can suggest tricks of all kinds and people can thumb them up or down according to how convenient they find them.

      If you find some useful trick for using Notepad++, then you can contribute a NpWiki++ page about it.

      CChris

       
MongoDB Logo MongoDB