Type C-hl to run view-lossage which will show you the last several keystrokes, and which commands they are bound to in the current buffer (which might not be the same as the commands they were bound to in the buffer which was active when they keys were typed -- only the keystrokes themselves are actually recorded).
n.b. Older Emacsen will display only the ...
You may want to try the package super-save, which auto saves files when idle or Emacs lose focus.
My own auto save function saving when idle or lose focus, built from Emacs built-ins (github link in case I'm missing anything):
(defvar jester-auto-save-idle 1 "Time in seconds before auto-saving all buffers.")
Emacs has some built in functionality for this already, so there is no need to write your own function. In case you do want to use your function, I would suggest adding a check for 'prog-mode. Programming modes should all be derived from prog-mode, so:
(when (derived-mode-p 'prog-mode)
;; Do stuff
or, to include text-mode (org-mode, md, etc.):
I'm not sure which completion backend Doom uses by default these days for Ruby (whether it's LSP or Robe), but the Troubleshooting section of company/README.org says this:
For instance, go-mode requires guru to be installed on your system, and ruby-mode requires that you have a Robe server running (M-x robe-start).
Meaning, you need to have robe (the ...