   :ensure t
   :config
   (setq doom-modeline-icon nil)
+  (setq doom-modeline-workspace-name t)
+  (setq doom-modeline-persp-name t)
   :hook (after-init . doom-modeline-mode))
 (use-package modus-operandi-theme
   :ensure t

  (interactive)
  (persp-switch "new workspace"))
;; tslint fix
(defun ab/tslint-fix-file ()
  "Apply tslint --fix to the current file"
  (interactive)

(global-set-key (kbd "C-n %") 'ab/window-split-right)
(global-set-key (kbd "C-n \"") 'ab/window-split-down)
(global-set-key (kbd "C-n x") 'evil-window-delete)
(global-set-key (kbd "C-n b b") 'persp-ivy-switch-buffer)
(global-set-key (kbd "C-n b n") 'projectile-next-project-buffer)
(global-set-key (kbd "C-n b p") 'projectile-previous-project-buffer)
(global-set-key (kbd "C-n b x") 'kill-buffer)
(global-set-key (kbd "C-n b r") 'rename-buffer)
(global-set-key (kbd "C-n :") 'counsel-M-x)
(global-set-key (kbd "C-n s") 'tab-bar-select-tab-by-name)
(global-set-key (kbd "C-n c") 'tab-new)
(global-set-key (kbd "C-n $") 'tab-rename)
(global-set-key (kbd "C-n n") 'tab-next)
(global-set-key (kbd "C-n p") 'tab-previous)
(global-set-key (kbd "C-n X") 'tab-close)
;; custom keybindings for code editing
(global-set-key (kbd "C-h .") 'ab/help-symbol-lookup)
(global-set-key (kbd "C-c f") 'counsel-projectile-find-file)
(global-set-key (kbd "C-c i") 'counsel-imenu)
;; ivy/counsel bindings
(global-set-key (kbd "C-x :") 'counsel-M-x)
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
(global-set-key "\C-s" 'swiper)
(global-set-key (kbd "C-c C-r") 'ivy-resume)
(global-set-key (kbd "<f6>") 'ivy-resume)
(define-key ivy-minibuffer-map (kbd "C-j") 'ivy-next-line)
(define-key ivy-minibuffer-map (kbd "C-k") 'ivy-previous-line)


;; autocomplete
(use-package company
  :ensure t
  :init
  (setq company-idle-delay 0)
  (setq company-minimum-prefix-length 1)
  (setq company-selection-wrap-around t)
  :config
  (global-company-mode 1))
;; quickhelp for autocomplete
(use-package company-quickhelp
  :ensure t
  :init
  (setq company-quickhelp-delay 1.0)
  :config
  (company-quickhelp-mode 1))
(with-eval-after-load 'company
  (define-key company-active-map (kbd "C-j") #'company-select-next)
  (define-key company-active-map (kbd "C-k") #'company-select-previous)
  (evil-define-key 'insert company-active-map (kbd "<return>") #'company-complete)
  (define-key company-active-map (kbd "<return>") #'company-complete))


;;; rest client
;; optional deps
(use-package json-mode
  :ensure t)
(use-package jq-mode
  :ensure t
  :config
  (with-eval-after-load "json-mode"
    (define-key json-mode-map (kbd "C-c C-j") #'jq-interactively)))
;; restclient package
(use-package restclient
  :ensure t
  :mode (("\\.http\\'" . restclient-mode)
         ("\\.rest\\'" . restclient-mode))
  :bind (:map restclient-mode-map
	          ("C-c C-f" . json-mode-beautify)))
;; autocomplete in restclient
(use-package company-restclient
  :ensure t
  :config
  (add-to-list 'company-backends 'company-restclient))


;;; auto tail log files
(add-to-list 'auto-mode-alist '("\\.log\\'" . auto-revert-mode))


;;; org babel
;; no need to confirm evaluation for all languages, some are harmless
(setq org-confirm-babel-evaluate nil)
(setq org-src-fontify-natively t)
(setq org-adapt-indentation nil)
;;; add non-core languages
;; typescript
(use-package ob-typescript
  :ensure t)
;; go
(use-package ob-go
  :ensure t
  :straight (ob-go :type git :host github :repo "pope/ob-go"))
;; http
(use-package ob-http
  :ensure t)
;; restclient
(use-package ob-restclient
  :ensure t)
;; graphql
(use-package ob-graphql
  :ensure t)
;;; agenda
(setq org-agenda-files (list
                        "~/org-agenda/todo.org"))
(use-package evil-org
  :ensure t
  :after org
  :hook (org-mode . (lambda () evil-org-mode))
  :config
  (require 'evil-org-agenda)
  (evil-org-agenda-set-keys))
;;; org code executions
(setq org-babel-python-command "python3")
(org-babel-do-load-languages 'org-babel-load-languages
                             '(
                               (shell . t)
                               (python . t)
                               (js . t)
                               (typescript . t)
                               (go . t)
                               (org . t)
                               (emacs-lisp . t)
                               (http . t)
                               (restclient . t)
                               (java . t)
                               (makefile . t)
                               (sql . t)
                               (awk . t)
                               (graphql . t)
                               ))
;; other org keybindings
(global-set-key (kbd "C-x C-a") 'org-agenda)

;;; fine tuning performance
;;; gotten from https://emacs-lsp.github.io/lsp-mode/page/performance/
(setq gc-cons-threshold 100000000)
(setq read-process-output-max (* 1024 1024)) ;; 1mb

;;; init.el ends here
(custom-set-variables
