   (define-key company-active-map (kbd key)
     `(menu-item nil company-complete
                 :filter ,(lambda (cmd)
-                            (when (company-explicit-action-p)
-                            cmd)))))
+                           (when (company-explicit-action-p)
+                             cmd)))))
 (define-key company-active-map (kbd "TAB") #'company-complete-selection)
 (define-key company-active-map (kbd "SPC") nil)
 (setq company-auto-complete-chars nil)

(use-package yasnippet
  :config
  (progn
    (setq-default yas-snippet-dirs '("~/.emacs.d/snippets"))
    (yas-global-mode))
  :diminish yas-minor-mode)


;; undoes all meta keys otherwise
(amap "<escape>" 'evil-normal-state)

(nmap "SPC w f" 'delete-other-windows
      "SPC b b" 'ivy-switch-buffer
      "SPC f f" 'counsel-find-file
      "SPC f t" 'zsh-terminal)

(defun edit-emacs-rc ()
  "Go to emacsrc."
  (interactive)
  (find-file "~/.emacs"))
(nmap "SPC f e" 'edit-emacs-rc)

(defun flycheck-toggle-and-check ()
  "Toggle flycheck mode and check if it was previously off."
  (interactive)
  (flycheck-mode 'toggle)
  (if (bound-and-true-p flycheck-mode) (flycheck-buffer)))

(nmap "SPC t" 'flycheck-toggle-and-check)

(nmap "SPC SPC" 'counsel-M-x)
(nmap "SPC g" 'magit-status)
(nmap "SPC b d" 'evil-delete-buffer)
(nmap "SPC s" 'swiper)

(setq python-shell-completion-native-enable nil)

