 (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") 'persp-ivy-switch-buffer)
+(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") 'persp-switch)
-(global-set-key (kbd "C-n c") 'ab/workspace-new)
-(global-set-key (kbd "C-n $") 'persp-rename)
-(global-set-key (kbd "C-n n") 'persp-next)
-(global-set-key (kbd "C-n p") 'persp-prev)
-(global-set-key (kbd "C-n X") 'persp-kill)
+(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
-;; same as my vim bindings
-(global-set-key (kbd "C-p") 'counsel-projectile-find-file)
-(define-key evil-normal-state-map (kbd "C-g") 'counsel-imenu)
+(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))
 
 
-;;; fine tuning
+;;; 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

  :config
  (evil-collection-init))

;; free C-p for personal use. I use it for file selection in other editors.
(define-key evil-normal-state-local-map (kbd "C-p") nil)
(define-key evil-normal-state-map (kbd "C-p") nil)
(define-key evil-insert-state-map (kbd "C-p") nil)
(define-key evil-visual-state-map (kbd "C-p") nil)
(define-key evil-emacs-state-map (kbd "C-p") nil)
(define-key evil-motion-state-map (kbd "C-p") nil)
(global-set-key (kbd "C-p") nil)
(global-set-key (kbd "<normal-state> C-p") nil)
;; free C-n for personal use. my favourite tmux mapping
(define-key evil-normal-state-local-map (kbd "C-n") nil)
(define-key evil-normal-state-map (kbd "C-n") nil)
(define-key evil-insert-state-map (kbd "C-n") nil)
(define-key evil-visual-state-map (kbd "C-n") nil)
(define-key evil-emacs-state-map (kbd "C-n") nil)
(define-key evil-motion-state-map (kbd "C-n") nil)
(global-set-key (kbd "C-n") nil)
(global-set-key (kbd "<normal-state> C-n") nil)

;;; use 4 tab space
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)


;;; customize eshell prompt
;;; found at https://stackoverflow.com/a/59236830
(defun ab/eshell-prompt-function ()
  (setq eshell-prompt-regexp "^λ: ")
  (format "%s\nλ: " (abbreviate-file-name (eshell/pwd))))
(setq eshell-prompt-function #'ab/eshell-prompt-function)
(setq comint-prompt-read-only t)
(setq eshell-scroll-to-bottom-on-input t)
(defun ab/eshell-insert-mode ()
  "jump to end of buffer i.e. the prompt before switching to insert mode"
  (interactive)
  (end-of-buffer)
  (end-of-line)
  (evil-insert-state))

;;; Projectile
(use-package projectile
