David is enjoying a peaceful respite from war, so he gets to thinking about other things, like the fact that he lives in a house, but the ark of the covenant lives in a tent. Well, god told them to build it and this is what he wanted, so what's he bitching about? Nathan, his prophet, tells him to do what he wants, because god is with him. Mighty convenient, no?
God comes to Nathan that night and says he likes the footloose and fancy-free feeling of caravaning it and has never asked anybody for a house. Eventually, he'll settle down with the Israelites, when they have their own country, but he'll build the house himself.
He also promises to keep David's line in power forever, and not to take his mercy away, as he did with Saul.
David listens to all of this and goes to talk to god himself. He flatters him, praising his good deeds and so on and asks for a blessing.
David kills more Philistines. It's a wonder there are any left, frankly. Then he defeats the Moabites. After his victory, he has the survivors lie on the ground and kills 2 out of every 3 of them. What a terrifying way to die. Then he smites Hadadezer, king of Zobah, in a border dispute. This is only verse 3. He captures some chariots, charioteers and footmen, and hangs all but a hundred of the horses.
Bear in mind we're only at verse 5, where David kills 22 000 Syrians. He enslaves them, and we are informed that god is with him wherever he goes.
David brings back a lot of treasure, and is also given a lot of it as a tribute from other kings anxious not to be invaded. He dedicates all of it to god, and puts garrisons in all his conquered towns.
He also institutes a fair and just domestic policy, so there is happiness all around.