#+TITLE Configuration
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(package-initialize)
;(package-refresh-contents)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
*
(use-package all-the-icons :ensure t :config
(use-package all-the-icons-dired :ensure t :config
(add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
)
)
(use-package company :ensure t :config
(use-package company-quickhelp :ensure t)
(global-company-mode)
(company-quickhelp-mode)
)
(use-package evil
:ensure t
:init
(setq evil-want-keybinding nil)
:config
(evil-mode 1))
(use-package evil-collection :after evil :ensure t :config
(setq evil-collection-company-use-tng nil)
(evil-collection-init)
)
(use-package evil-matchit :ensure t)
(use-package evil-surround :ensure t :config (global-evil-surround-mode 1))
(use-package flycheck :ensure t :config
(global-flycheck-mode)
)
(use-package hcl-mode :ensure t :mode "\\.tf\\'")
(use-package helm :ensure t :config
(use-package helm-company :ensure t)
(use-package helm-projectile :ensure t)
(helm-mode)
)
(use-package inf-ruby :ensure t :mode "\\.rb\\'" :config
(autoload 'inf-ruby-minor-mode "inf-ruby" "Run an inferior Ruby process" t)
(add-hook 'enh-ruby-mode-hook 'inf-ruby-minor-mode)
)
(use-package lsp-mode :ensure t
:hook (prog-mode . lsp)
:config
(use-package lsp-ui :ensure t :config
(setq lsp-prefer-flymake nil)
(add-hook 'lsp-mode-hook 'lsp-ui-mode)
)
(use-package company-lsp :ensure t :config
(push 'company-lsp company-backends)
)
)
(use-package magit :ensure t)
(use-package markdown-mode :mode "\\.md\\'" :ensure t)
(use-package monokai-theme :ensure t :config
(load-theme 'monokai t)
)
(use-package projectile :ensure t :config
(projectile-mode)
)
(use-package rainbow-delimiters :ensure t :config
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
)
(use-package rg :ensure t)
(use-package robe :mode "\\.rb\\'" :ensure t :config
(add-hook 'enh-ruby-mode-hook 'robe-mode)
(push 'company-robe company-backends)
)
(use-package spaceline :ensure t :config
(spaceline-emacs-theme)
(spaceline-helm-mode)
)
(use-package tide :ensure t
:after (typescript-mode company flycheck)
:hook (
(typescript-mode . tide-setup)
(typescript-mode . tide-hl-identifier-mode)
(before-save . tide-format-before-save)
)
)
(use-package web-mode :defer t :ensure t :config
(add-to-list 'auto-mode-alist '("\\.js[x]\\'" . web-mode))
(setq web-mode-content-types-alist '(("jsx" . "\\.js[x]?\\'")))
)
(use-package writegood-mode :ensure t)
(use-package yaml-mode :mode "\\.yml\\'" :ensure t)
(use-package yasnippet :ensure t)
(use-package enh-ruby-mode :mode "\\.rb\\'" :ensure t :config
(add-to-list 'auto-mode-alist
'("\\(?:\\.rb\\|ru\\|rake\\|thor\\|jbuilder\\|gemspec\\|podspec\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Vagrant\\|Guard\\|Pod\\)file\\)\\'" . enh-ruby-mode))
)
(require 'server)
(unless (server-running-p) (server-start))
(setq
backup-by-copying t ; don't clobber symlinks
backup-directory-alist
'(("." . "~/.emacs_saves")) ; don't litter my fs tree
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t) ; use versioned backups
(global-hl-line-mode)
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default tab-stop-list (number-sequence 2 120 2))
(setq-default js-indent-level 2)
(setq web-mode-markup-indent-offset 2)
(setq ruby-deep-indent-paren nil)
(setq projectile-enable-caching t)
(scroll-bar-mode -1)
(menu-bar-mode -1)
(setq org-src-fontify-natively t)
(setq org-directory "~/Dropbox/Documents/Notes")
(setq org-default-notes-file (concat org-directory "capture.org"))
(put 'dired-find-alternate-file 'disabled nil)
(add-hook 'dired-mode-hook (lambda () (dired-hide-details-mode 1)))
'(blink-cursor-mode nil)
(global-visual-line-mode t)
(setq-default rspec-use-chruby t)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(global-auto-revert-mode t)
(setq vc-follow-symlinks t)
(defalias 'yes-or-no-p 'y-or-n-p)
(setq-default company-dabbrev-downcase nil)
(setq-default company-dabbrev-ignore-case t)
(setq-default company-dabbrev-code-ignore-case t)
(setq-default company-irony-ignore-case 'smart)
(setq completion-ignore-case 1)
(setq-default company-auto-complete t)
(setq-default company-idle-delay 0.1)
(setq-default display-line-numbers (quote relative))
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
(setq-default lsp-clients-clangd-args (quote ("-limit-results=15")))
(setq-default evil-shift-width 2)
(define-key evil-normal-state-map (kbd "C-u") 'evil-scroll-up)
(evil-define-minor-mode-key 'normal 'robe-mode "C-:" 'robe-jump)
(evil-ex-define-cmd "bls" 'helm-buffers-list)
(evil-ex-define-cmd "[me]ta" 'helm-M-x)
(define-key evil-insert-state-map (kbd "C-k") 'helm-company)
(define-key evil-normal-state-map (kbd "C-j") 'helm-buffers-list)
(global-set-key (kbd "M-x") 'helm-M-x)
(evil-ex-define-cmd "[Gp]ush" 'magit-push-implicitly)
(evil-ex-define-cmd "[Gs]tatus" 'magit-status)
(evil-ex-define-cmd "[Gc]ommit" 'magit-commit)
(evil-ex-define-cmd "ff" 'helm-projectile)
(evil-ex-define-cmd "prg" 'rg-project)
(defvar ro/leader-map (make-sparse-keymap))
(define-key evil-normal-state-map (kbd "SPC") ro/leader-map)
(define-key ro/leader-map (kbd "b") 'helm-buffers-list)
(define-key ro/leader-map (kbd "f") 'helm-projectile)
(define-key ro/leader-map (kbd "w") 'save-buffer)
(evil-set-initial-state 'artist-mode 'emacs)
(when (eq system-type 'darwin)
(set-face-attribute 'default nil :family "Inconsolata")
(set-face-attribute 'default nil :height 240)
)
(when (eq system-type 'windows-nt)
(set-face-attribute 'default nil :family "Consolas")
(set-face-attribute 'default nil :height 180)
(setq markdown-command "pandoc")
)
(when (eq system-type 'gnu/linux)
(set-face-attribute 'default nil :height 180)
)