aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/init.el
blob: 77163f94ade5671f753d48bdeca1c8c6040dd2d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
(require 'package)
(add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t)

(package-initialize)
(package-install 'use-package)

(setq ring-bell-function 'ignore)
(load-theme 'tango-dark)

(use-package evil
  :ensure t
  :config
  (evil-mode +1))

(use-package evil-surround
  :ensure t
  :after (evil)
  :config
  (evil-surround-mode +1))

(use-package which-key
  :ensure t
  :config
  (which-key-mode +1))

(use-package general
  :ensure t
  :config
  (general-create-definer leader
    :prefix "SPC"
    :states 'normal
    :keymaps 'override)
  (general-create-definer localleader
    :prefix ","
    :states 'normal
    :keymaps 'override)

  (leader
    "!" #'async-shell-command
    "f" '(:ignore t :wk "File")
    "s" '(:ignore t :wk "Search")
    "b" '(:ignore t :wk "Buffer"))

  (general-def
    :states 'visual
    "gr" 'eval-region)

  (leader
    :infix "b"
    "n" #'next-buffer
    "p" #'prev-buffer
    "b" #')

  (leader
    :infix "f"
    "s" #'save-buffer
    "f" #'find-file
    "p" #'((lambda () (interactive) (find-file "~/.config/emacs/init.el"))
	   :wk "Open init.el")))

(use-package counsel
  :ensure t
  :general
  (leader
    "SPC" #'counsel-M-x)
  (leader
    :infix "s"
    "s" #'(swiper :wk "Search buffer")
    "r" #'(counsel-rg :wk "Ripgrep"))
  :config
  (counsel-mode +1))

(use-package org
  :ensure t)

(use-package evil-magit
  :ensure t
  :defer t)

(use-package magit
  :ensure t)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages
   '(evil-surround which-key counsel swiper general use-package)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )