your thinking wrong
if he can get onto your machine then he can install a keylogger and get the password as fast as you type it.
That depends on what you mean by "get onto your machine". It's much harder to install a keylogger than it is to just read files. Installing a hardware keylogger requires physical access to the machine, and a software keylogger requires direct access to the keyboard driver, which requires administrator privileges on any sane operating system (though if you're in the habit of giving admin privileges to any random program that asks for it, you're screwed).