Sounds to me like your cable is in need of replacement. If the housing moves with the cable when shifting it (inner cable) clearly is not moving smoothly in the housing. this could be due to a number of things (e.g. rusted/dirty inner cable/housing, freyed cable, severely bent housing (which will happen to the end of the housing where the ferrule is held in place, when used for a long period of time)). Try loosening the derailleur end of the cable (loosen the screw and remove the inner cable from underneath the screw/holding plate. Hold the cable in one hand and pull it, then use your other hand to shift up and down and see if the cable moves back and forth without it taking excessive force on the shift levers (only remove the cable from the derailleur for this test, don't remove the cable housing from the frame just yet, since we're testing how smoothly the inner cable runs through the housing). Sometimes the ferrules (outer cable end caps) can get bent out of shape after a long time of use, check if they are straight.
Bent ferrules/improperly cut cable housing, freyed cables etc will usually cause issues with shifting.
Inspect the inner cable, if it doesn't look too rusty, isn't freyed and isn't bent too badly you should be fine just replacing the cable housing (do make sure to lube the inner cable to reduce friction).
I would suggest replacing inner and outer cable, inner cables are not that expensive, if you buy cable housing in bulk (10+meter) it is not that expensiv (I bought 30m teflon inner shifter housing for approx 40euro). The ferrules are really cheap also (a few euro/dollar for 100 pieces). It is quite easy to DIY, here's a video showing how:
You don't need a special tool for it you can use regular side cutters (for brake outer cables make sure to cut it a few times if there are any sharp/protruding pieces of the metal spiral such that the cut it relatively flat).
Use the old cable's length as reference for your replacement cable housing (as can be seen in the video).
To remove inner cable from shifter you have to shift it into a specific gear such that the cable end (the cyclinder shaped end piece of the inner cable that holds the cable in place on the shifter's end) can be seen through the little hole inside the shifter (it is sometimes covered with a plastic screw). When it is aligned just grab the inner cable and press it towards the shifter, it will slide out through the hole.
Make sure to cut freyed cable end off the inner cable (if the cable's end is freyed). Or if the freying is not too bad you can usually twist the cable end to restore it to usable condition.
Be sure to use something pointy (small screwdriver/toothpick/nail etc.) to make sure the inner teflon lining of the cable housing is not folded over on itself/is opened up (when you cut the cable you squish everything together which can cause this lining to become misshapen which will prevent the inner cable from properly entering.