How to bind something in autoexec.cfg so that it doesn’t get rebound by default bindings or whatever is set up in settings

counter-strike-global-offensivesource-engine

I want to rebind mouse1, shift, ctrl and some other keys so that they also clear decals in csgo. I did that in autoexec.cfg:

bind r "+reload; r_cleardecals"
bind shift "+speed; r_cleardecals"
bind ctrl "+duck; r_cleardecals"
bind mouse1 "+attack; r_cleardecals"

However these bindings are being overwritten by simple bindings which are set up in csgo settings. Is there a way to prevent them from being reset? Ideally I want to be able to bring autoexec.cfg to a new computer with csgo and have everything configured there just working.

Best Answer

What you can do is to run CS:GO, open console, then unbind said keys before you rebind them. To open console, you must enable it trough the options menu, under key bindings and advanced settings. You can also right-click CS:GO in your steam game library and select "launch options". There you must write -console. Done correctly and the console will be open when you start the game again. I recommend you do a bindtoggle [ keyname ] console to ensure you get easy access to the console at a later point.

In console, write:

unbind [ Keyname ]

Then you can rebind them using bind [ keyname ] [ command ]

The unbind part may not be needed, but it's reasonable to do so you are sure the keys are completely set to ONLY be bound the way you want.