@M.K. Safi - The way I get around that is by keeping custom functions in a directory inside wp-content, separate to themes or plugins, then using the theme's functions.php to just call the other files. This way, you can organise functions eg. comment-functions.php, nav-functions.php etc which makes it easy to identify code snippets. Then just include by calling through functions.php. Its a safe way of having custom functions that work across different themes, without the risk of deleting them if you change themes.