summaryrefslogtreecommitdiff
path: root/lisp/general.el
blob: b1ae275dd4494726709275b85db7d68980a08b9f (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
96
97
(defun setup-general()
  ;; menu bars
  (menu-bar-mode -1)
  (toggle-scroll-bar -1)
  (tool-bar-mode -1)
  (setq mac-shift-modifier 'meta)

  ;; Default Values
  ;(setq-default indent-tabs-mode t)  ; use spaces only if nil
  (setq-default tab-width 4) ; Assuming you want your tabs to be four spaces wide
  (set-face-attribute 'default nil :font "Droid Sans Mono-12")
  (set-fontset-font t nil "Courier New" nil 'append)
  (set-fontset-font t '(?😊 . ?😎) "Segoe UI Emoji")

  ;;(set-face-attribute 'default nil :height 110 :family  "Consolas")
  (set-language-environment "UTF-8")
  (set-default-coding-systems 'utf-8)

  ;; Cursor
  (setq-default cursor-type 'bar)
  (blink-cursor-mode 1)

  ;; Margin
  (global-linum-mode 1)
  ;;(require 'minimap)
  ;;(minimap-mode 1)
  (require 'perfect-margin)
  (perfect-margin-mode 1)

  ;; Highlight line
  (require 'hl-line)
  (global-hl-line-mode 1)
  (set-face-background hl-line-face "#EFEFEF")

  ;; Initialization screen
  (setq inhibit-splash-screen t)
  (setq initial-scratch-message "")
  (setq initial-major-mode 'text-mode)
  (desktop-save-mode 1)

  ;; Projectile for projects
  (require 'projectile)
  (projectile-mode +1)
  (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)

  ;; Tree
  (require 'neotree)
  (global-set-key [f8] 'neotree-toggle)
  (setq neo-smart-open t)
  (setq projectile-switch-project-action 'neotree-projectile-action)
  (setq neo-theme (if (display-graphic-p) 'icons 'arrow))

  ;; Smooth scroll
  (setq redisplay-dont-pause t
		scroll-margin 1
		scroll-step 1
		scroll-conservatively 10000
		scroll-preserve-screen-position 1)
  
  ;; Show flycheck always and after save
  (use-package flycheck :ensure t)
  (global-flycheck-mode)
  (add-hook 'after-init-hook #'global-flycheck-mode)

  ;; Emojis
  (use-package emojify
	:config
	(when (member "Segoe UI Emoji" (font-family-list))
      (set-fontset-font
       t 'symbol (font-spec :family "Segoe UI Emoji") nil 'prepend))
	(setq emojify-display-style 'unicode)
	(setq emojify-emoji-styles '(unicode))
	(bind-key* (kbd "C-c e") #'emojify-insert-emoji)) ; override binding in any mode

  ;; == company-mode ==
  (use-package company
	:ensure t
	:defer t
	:init (add-hook 'after-init-hook 'global-company-mode)
	:config
	(use-package company-irony :ensure t :defer t)
	(setq company-idle-delay              nil
		  company-minimum-prefix-length   2
		  company-show-numbers            t
		  company-tooltip-limit           20
		  company-dabbrev-downcase        nil
		  company-backends                '((company-irony company-gtags))
		  )
	:bind ("C-;" . company-complete-common)
	)

  ;; Flycheck
  (eval-after-load 'flycheck
	'(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
)

(provide 'general)