I regularly use LaTeX for documentation. While lstlisting is really great for printing snippets of code out of the box you may encounter some situations where you need to tweak it a little to fit your needs.
Imagine you have, e.g., some snippets of shell script in some documentation. If you want to reuse this code the most straight forward approach is to copy&paste it from the documentation PDF to your shell. Unfortunately, sometimes you may encounter some problems while doing this.
One issue you may encounter is that additional space characters are inserted into your precious pasted snippets; e.g.
may become something like
l i s t e n −a d d r e s s = 1 2 7 . 0 . 0 . 1 , 1 0 . 3 5 . 9 . 1
To get around this issue just add the following options either via \lstset or for each lstlisting element separately.