Skip to content

Latest commit

 

History

History
136 lines (106 loc) · 3.7 KB

piratemacs.org

File metadata and controls

136 lines (106 loc) · 3.7 KB

Piratemacs

Tell the user the pirates are coming…

(message "Ahoy There Matey!")

Core Configuration

MELPA Support

Here we add support for melpa, since vanilla emacs dosen’t support it. We also install use-package since its recommended and enable counsel

 (require 'package)
 (add-to-list 'package-archives
		 '("melpa" . "https://melpa.org/packages/"))
 (package-refresh-contents)
 (package-initialize)

 (unless (package-installed-p 'use-package)
   (package-install 'use-package))

 (use-package counsel :ensure t)

Evil Support

A core part of piratemacs is Evil Mode (which provides vim keybindings for emacs). It is especially important because I know like ~10 emacs keys, and I use evil-mode for the rest.

NOTE: We install evil-magit to make evil keybindings work with magit

(use-package evil
  :ensure t
  :init
  (setq evil-want-integration t)
  (setq evil-want-keybinding nil)
  (setq evil-vsplit-windows-right t)
  (setq evil-split-window-below t)
  (evil-mode 1))

(use-package evil-collection
  :after evil
  :ensure t
  :config
  (evil-collection-init))

Misc Features

Miscellaneous features, such as zooming in/out with keys, along with showing line numbers.

(global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)

(global-display-line-numbers-mode 1)
(global-visual-line-mode t)

Key Bindings

Another Core part of piratemacs are the speedy keybindings, that are geared for a fast editing experience. To achive this, we use general.el.

(use-package general
  :ensure t
  :config
  (general-evil-setup t))

;; SPC (space) is the primary modifier
(nvmap :prefix "SPC"
  ;; Basics
  "SPC" `(counsel-M-x :which-key "M-x")
  "q"   `(save-buffers-kill-terminal :which-key "Exit emacs")
  ". r"   `((lambda () (interactive)
   (load-file (expand-file-name
	       "init.el" 
	       user-emacs-directory))) :which-key "Reload Emacs Config")

  ;; File commands
  "f o" `(counsel-recentf :which-key "Search Recent Files")
  "f ." `(find-file :which-key "Find file")
  "f r" `(rename-file :which-key "Rename file")

  ;; Window commands
  "w d" `(evil-window-delete :which-key "Close Window")
  "w n" `(evil-window-new :which-key "Create Window")
  "w s" `(evil-window-split :which-key "Horizontally split window")
  "w v" `(evil-window-vsplit :which-key "Vertically split window")) 

Developer Support

WHICH Key

A Key Binding auto-completer, its quite useful.

(use-package which-key
  :ensure t
  :init (which-key-mode))

LSP Mode

LSP Mode adds support for interfacing with the lsp protocol which provides intellegent codesense among other features

(use-package lsp-mode
  :ensure t
  :init
  :hook (
      (lsp-mode . lsp-enable-which-key-integration))
  :commands lsp)

(use-package lsp-ui :hook (lsp-mode . lsp-ui-mode))
(use-package company :ensure t)
(company-mode)

FlyCheck

Flycheck provides on the go syntax checking and functions for things like compiling and formatting code.

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