Skip to content

Latest commit

 

History

History
297 lines (240 loc) · 6.89 KB

ide.org

File metadata and controls

297 lines (240 loc) · 6.89 KB

Core IDE

Env Vars

(use-package load-env-vars
  :ensure t
  :init (load-env-vars "~/.profile"))

Exec Path

This is to ensure that shell and Emacs can share PATH env var

(use-package exec-path-from-shell
  :ensure t
  :config (setq exec-path-from-shell-variables '("PATH"))
  :init
  (when (memq window-system '(mac ns x))
  (exec-path-from-shell-initialize)))

Mac

;; Keybonds
(global-set-key [(hyper a)] 'mark-whole-buffer)
(global-set-key [(hyper v)] 'yank)
(global-set-key [(hyper c)] 'kill-ring-save)
(global-set-key [(hyper s)] 'save-buffer)
(global-set-key [(hyper l)] 'goto-line)

(global-set-key [(hyper w)]
                (lambda () (interactive) (delete-window)))
(global-set-key [(hyper z)] 'undo)

(setq mac-option-modifier 'meta)
(setq mac-command-modifier 'hyper)

UX

Icons

(use-package memoize
  :ensure t)

(use-package all-the-icons
  :ensure t)

Modeline

(use-package doom-modeline
  :ensure t
  :hook (after-init . doom-modeline-mode))

Dashboard

(setq dashboard-banner-logo-title "Huh!")
(setq dashboard-startup-banner "~/dev/etc/don-t-panic.png")

;;(setq show-week-agenda-p t)

;; To disable shortcut "jump" indicators for each section, set
;;(setq dashboard-show-shortcuts nil)

(setq dashboard-items '((recents  . 8)
                        (bookmarks . 5)
                        (projects . 5)
                        (agenda . 5)
                        (registers . 5)))
;;(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))

(setq dashboard-footer-messages '(
"Talking to his professor about orbital mechanics, Newton realized that he needed to stop and invent Calculus. Go Shave that yak! err.. Once in a while."
"'Git' was several weeks of yak shaving for linus! Go Shave that yak! err.. Once in a while."
"Be aware of the army of yaks that threatens your time and sanity!"
"The Golden Yak is the yak that changes everything, the one that alters your reality."
"Golden yaks change behavior."
"Yaks are a part of life and of progress."
"Yaks. They’re so much more than hair."
"Wat! you think you found that extremely rare 'Golden Yak'"
"Welcome to the church of Emacs"
"While any text editor can save your files,\
only Emacs can save your soul"
"Meta yaks are magical!"
"Why Should I Care What Color the Bikeshed Is?"
"Using vi is not a sin; it is a penance"
"Calling EMACS an editor is like calling the Earth a hunk of dirt."
"Emacs is a nice operating system"
))
(use-package dashboard
  :ensure t
  :config (setq dashboard-startup-banner 3)
  :init (dashboard-setup-startup-hook))

Project Management

Helm

(use-package helm
  :ensure t
  :bind (("M-x" . helm-M-x)
         ("M-<f5>" . helm-find-files)
         ([f10] . helm-buffers-list)
         ([S-f10] . helm-recentf)))

Projectile

(use-package projectile
  :diminish projectile-mode
  :ensure t
  :init
  :delight '(:eval (concat " " (projectile-project-name)))
  :config
  (progn
    (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
    (projectile-mode +1)
    (setq projectile-completion-system 'helm)
    (setq projectile-enable-caching t)
    (setq projectile-indexing-method 'alien)
    (add-to-list 'projectile-globally-ignored-files "node-modules")))

(use-package helm-projectile
  :ensure t
  :bind (("H-p" . helm-projectile-switch-project)
	 ("H-t" . helm-projectile-find-file)
	 ))

Search in a project

(use-package rg
  :ensure t)

(use-package helm-rg
  :ensure t
  :bind (("C-c h /" . helm-projectile-rg)
	 ))

Neotree: Nerdtree for emacs

(use-package neotree
  :ensure t
  :bind (("C-c n t" . neotree-toggle)))

Indispensable git companion

(use-package magit
  :ensure t
  :bind (("H-g" . magit-status)))

(use-package git-messenger
  :ensure t
  :bind (("C-x g m" . git-messenger:popup-message)))

M-x Alternate via ido

(use-package smex
  :ensure t
  :config
  (global-set-key (kbd "H-x") 'smex))

Window Management

(windmove-default-keybindings)
(use-package winner
  :ensure t
  )

(use-package ace-window
  :ensure t)

(global-set-key (kbd "M-o") 'ace-window)



Snippets

(use-package yasnippet
  :ensure t
  :defer t
  :init (yas-global-mode t))

(use-package doom-snippets
  :load-path "~/dev/etc/doom-snippets"
  :after yasnippet)

Dired mode

(use-package all-the-icons-dired
  :ensure t
  :init (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
)

(global-set-key (kbd "H-<f1>")
  (lambda ()
    (interactive)
    (dired "~/")))

Completions

Company Mode

(use-package company
  :ensure t
  :config (progn
            (setq company-idle-delay 0)
            (setq company-minimum-prefix-length 1)
            (setq company-tooltip-align-annotations t)
            (setq lsp-completion-provider :capf)
            )
  :hook (prog-mode . company-mode))

LSP

(use-package lsp-mode
  :ensure t
  ;; :custom (lsp-gopls-server-args '("-debug" "127.0.0.1:0"))
  :commands (lsp lsp-deferred)
  :custom (progn
  (require 'lsp-clients)
  (lsp-rust-analyzer-cargo-watch-command "clippy")
  (lsp-eldoc-render-all t)
  (lsp-idle-delay 0.6)
  ;; enable / disable the hints as you prefer:
  ;;todo: move to rust.org
  (lsp-rust-analyzer-server-display-inlay-hints t)
  (lsp-rust-analyzer-display-lifetime-elision-hints-enable "skip_trivial")
  (lsp-rust-analyzer-display-chaining-hints t)

  (lsp-rust-analyzer-display-lifetime-elision-hints-use-parameter-names nil)
  (lsp-rust-analyzer-display-closure-return-type-hints t)
  (lsp-rust-analyzer-display-parameter-hints nil)
  (lsp-rust-analyzer-display-reborrow-hints nil)
  (add-hook 'lsp-mode-hook 'lsp-ui-mode)))

(use-package lsp-ui
  :ensure t
  :commands lsp-ui-mode
  :custom (progn
  (setq lsp-ui-peek-always-show f)
  (setq lsp-ui-sideline-show-hover t)
  (set1 lsp-ui-doc-enable nil)))

Syntax checker & Highlighting

(use-package flycheck
  :ensure t
  :init (global-flycheck-mode))

(use-package hi-lock
  :bind (("C-RET h l" . highlight-lines-matching-regexp)
         ("C-RET h r" . highlight-regexp)
         ("C-RET h w" . highlight-phrase)
	 ("C-RET h 0" . hi-lock-unface-buffer)))

Provide this so that it may be required

(provide 'ide)