   ;; ('normal magit-mode-map "SPC" leader-map)
   )
 
+;; set proper language (fixes cyrillic letters in ansi-term)
+(setenv "LANG" "pt_BR.UTF-8")
 ;; Set default font
+
 (set-face-attribute 'default nil
                     :family "Operator Mono"
                     :height 150
                     :weight 'normal 
                     :width 'normal)
+
+;; font for all unicode characters
+(set-fontset-font t 'unicode "Symbola" nil 'prepend)
+
+;; override font for cyrillic characters
+(set-fontset-font t 'cyrillic "Droid Sans Mono")
+
+;; https://fakedrake.github.io/teaching-emacs-to-copy-utf-8-on-mac-os-x.html
+(defun paste-to-osx (text &optional push)
+  (let ((process-connection-type nil)
+        (lang (getenv "LANG"))
+        (default-directory "~"))
+    (setenv "LANG" "en_US.UTF-8")
+    (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
+      (process-send-string proc text)
+      (process-send-eof proc))
+    (setenv "LANG" lang)))
+(setq interprogram-cut-function 'paste-to-osx)
+
 
 (use-package js2-mode)
 (use-package web-mode)

   "p" 'flycheck-previous-error
   "y" 'flycheck-copy-errors-as-kill)

  (setq flycheck-check-syntax-automatically '(save idle-change mode-enabled))
  (setq flycheck-buffer-switch-check-intermediate-buffers nil)
  (setq flycheck-idle-buffer-switch-delay 0.9)
  (setq flycheck-display-errors-delay 0.9)
  (setq flycheck-idle-change-delay 0.9)

  :config
  (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))

(use-package kaolin-themes
  :ensure t
  :load-path "themes"
  :config
  (load-theme 'kaolin-eclipse t))

;; icons
(use-package all-the-icons)
