Is there a way to open files in the left panel/view only?
-
I always have the files i’m working on in the left panel/view and docs/notes/logs files etc. in the right panel, though frequently open files after having the right panel/view active
like using the file://PATH/FILENAME link and have to move to other view -
Is there a way to open files in the left panel/view only?
No, not normally.
But this behavior can be scripted:
# -*- coding: utf-8 -*- from __future__ import print_function # Python2 vestige! ######################################### # # AlwaysOpenFilesIntoPrimaryViewTabs (AOFIPVT) # ######################################### # note: # This script was developed and tested under Python3 64-bit on unicode (non-ANSI) encoded data. # It may work as-is using Python2 and/or ANSI-encoded data and/or 32-bits, but that would be incidental. # references: # https://community.notepad-plus-plus.org/topic/26371/is-there-a-way-to-open-files-in-the-left-panel-view-only # for newbie info on PythonScripts, see https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript #------------------------------------------------------------------------------- from Npp import * #------------------------------------------------------------------------------- class AOFIPVT(object): def __init__(self): self.recently_opened_buff_id = None notepad.callback(self.fileopened_callback, [NOTIFICATION.FILEOPENED]) notepad.callback(self.bufferactivated_callback, [NOTIFICATION.BUFFERACTIVATED]) def fileopened_callback(self, args): self.recently_opened_buff_id = args['bufferID'] def bufferactivated_callback(self, args): if self.recently_opened_buff_id is not None: if self.recently_opened_buff_id == args['bufferID']: if notepad.getCurrentView() == 1: notepad.menuCommand(MENUCOMMAND.VIEW_GOTO_ANOTHER_VIEW) self.recently_opened_buff_id = None #------------------------------------------------------------------------------- ALWAYS_OPEN_FILES_INTO_PRIMARY_VIEW_TABS = AOFIPVT()Note that while using the script, you must move any tabs/files you want to be in the secondary view (the “right panel” in your terms) from the primary (“left”) view. What I’m trying to point out here is that if you attempt to drag (from Windows Explorer) and drop into the secondary/right view, the tab/file will immediately be moved to the primary/left view.
To have the script start when Notepad++ starts up, put the following line into user
startup.py:from AlwaysOpenFilesIntoPrimaryViewTabs import ALWAYS_OPEN_FILES_INTO_PRIMARY_VIEW_TABSand make sure that “Initialisation” for “Python Script Configuration” is set to “ATSTARTUP” and not “LAZY”.
-
A Alan Kilborn referenced this topic on
-
@Alan-Kilborn wow this is great, thankyou
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login