summary refs log tree commit diff
path: root/config/init-programming.el
blob: ca1ec4101fb6fb92ee866174622c5a0cd0c12814 (plain) (blame)
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
98
99
;;; init-programming.el --- Configure things related to programming -*- lexical-binding: t -*-
;; Author: Franck Cuny <franck@fcuny.net>

;;; Commentary:

;; Configure things related to programming

;;; Code:

(use-package compile
  :ensure nil
  :hook (compilation-filter . ansi-color-compilation-filter)
  :custom
  (compilation-always-kill t)
  (compilation-context-lines 10)
  (compilation-disable-input t)
  (compilation-scroll-output 'first-error)
  (compilation-scroll-output t)
  (compilation-skip-threshold 2)
  ;; Save all buffers on M-x `compile'
  (compilation-ask-about-save nil))

(use-package eldoc
  :diminish
  :hook ((c-mode-common emacs-lisp-mode) . eldoc-mode)
  :custom
  (eldoc-idle-delay 1)
  (eldoc-documentation-strategy #'eldoc-documentation-default)
  (eldoc-echo-area-use-multiline-p 3)
  (eldoc-echo-area-prefer-doc-buffer 'maybe)
  (eldoc-echo-area-display-truncation-message nil))

(use-package indent
  :commands indent-according-to-mode
  :custom
  (tab-always-indent 'complete))

(use-package tree-sitter
  :ensure t
  :config
  (global-tree-sitter-mode))

(use-package tree-sitter-langs
  :after tree-sitter
  :ensure t)

(use-package direnv
  :ensure t
  :custom
  (direnv-always-show-summary nil)
  :config
  (direnv-mode))

(setq prettify-symbols-unprettify-at-point 'right-edge)

(defun my/github-code-search ()
  "Search code on github for a given language."
  (interactive)
  (let ((language (completing-read
                   "Language: "
                   '("Emacs Lisp" "Python"  "Go" "Nix")))
        (code (read-string "Code: ")))
    (browse-url
     (concat "https://github.com/search?lang=" language
             "&type=code&q=" code))))

(defun my/work-code-search ()
  "Search code on sourcegraph for a given language."
  (interactive)
  (let ((language (completing-read
                   "Language: "
                   '("Ruby" "Python"  "Go")))
        (code (read-string "Code: ")))
    (browse-url
     (concat "https://sourcegraph.rbx.com/search?q=context:global+lang:" language
             "+" code))))


(require 'init-elisp)
(require 'init-go)
(require 'init-lsp)
(require 'init-nix)
(require 'init-python)
(require 'init-ruby)
(require 'init-rust)

(require 'init-flymake)

(require 'init-shell)
(require 'init-json)
(require 'init-terraform)
(require 'init-toml)
(require 'init-yaml)

(require 'init-docker)

(provide 'init-programming)

;;; init-programming.el ends here