Try this config, it should help quite a bit.
// Number of command packets sent to the server per second.
cl_cmdrate "25000"
// Interpolate x seconds from game (0.02 = 20ms)
cl_interp "0"
// Sets the interpolation amount (final amount is [cl_interp_ratio / cl_updaterate]).
cl_interp_ratio "1"
cl_lagcomp_errorcheck "1"
// Perform server side lag compensation of weapon firing events.
cl_lagcompensation "1"
cl_localnetworkbackdoor "0"
// [0] It reuses prediction data from the previous frame that can be slightly off for the server.
// That value comes from 1.5 / 66. This is so that you aren't always relying on one snapshot to make it to your client on time.
// https://www.teamfortress.tv/42867/mastercomfig-fps-customization-config/?page=35#1024
// [1] Optimize for not copying data if didn't receive a network update.
// [2] '' And for not re-predicting if there were no errors.
// Best to use 2 for shots to land better on higher ping servers.
cl_pred_optimize "0"
// Don't know if this matters much, but I guess it should help?
// Haven't seen any difference nonetheless.
cl_predict "1"
cl_predictweapons "1"
cl_SetupAllBones "1"
cl_showerror "0"
// If set to 1 attempts to smooth the view after prediction errors.
cl_smooth "1"
// Time over which to smooth the view after prediction errors if cl_smooth is enabled.
cl_smoothtime "0.1"
// Amount of time (in seconds) that the game tries to reconnect to the server. (Auto-disconnect dialog.)
cl_timeout "5"
// Number of packets per second you are requesting from the server.
cl_updaterate "25000"
Keep in mind, this is a general use script, so some settings might need to be adjusted accordingly.
If anyone who knows better about this, please try to verify this and see if most of these are necessary or not. As far as I know, these work just fine for me and my internet isn't really the greatest.