code: def cmdSubstitute(self, cmd, count):
          
          cursor = self._qpart.textCursor()
          for _ in range(count):
              cursor.movePosition(QTextCursor.Right, QTextCursor.KeepAnchor)
  
          if cursor.selectedText():
              _globalClipboard.value = cursor.selectedText()
              cursor.removeSelectedText()
  
          self._saveLastEditSimpleCmd(cmd, count)
          self.switchMode(Insert)
docs: s