A new BODIPY-containing conjugated polymer (P1) had been designed and synthesized as a colorimetric and fluorescent chemosensor for F− and CN−. The combination of advantages of both reaction based sensors and conjugated polymer sensors offered its highly sensitive and selective recognition of F− and CN− with no interference from each other. The addition of F− and CN− to P1 solution induced a rapid color change from purple to orange and faint yellow, respectively. At the same time, the emission color of the P1 solution changed from red to yellow and yellowish green in presence of F− and CN−, respectively. 11B, 19F and 1H NMR spectra indicated that addition of fluoride and cyanide result in a nucleophilic displacement to break a BN bond of P1. In addition, the cell imaging experiments demonstrated that P1 could be successfully applied as a bioimaging agent with good biocompatibility.