 
 (defun my-lsp-format ()
   (interactive)
+  (delete-trailing-whitespace)
   (if (bound-and-true-p lsp-mode)
       (progn
         (lsp-format-buffer)

  :ensure t
  :config
  (general-define-key
   :states '(normal visual insert emacs motion)
   :global-prefix "C-b"
   :prefix "C-w"
   :non-normal-prefix "C-b"

(defun close-help-window ()
  (interactive)
  (let ((w (get-buffer-window "*Help*")))
    (if w (delete-window w))))

(defun move-forward ()
  (interactive)
