summaryrefslogtreecommitdiff
path: root/config/init-programming.el
diff options
context:
space:
mode:
Diffstat (limited to 'config/init-programming.el')
-rw-r--r--config/init-programming.el100
1 files changed, 100 insertions, 0 deletions
diff --git a/config/init-programming.el b/config/init-programming.el
new file mode 100644
index 0000000..984485b
--- /dev/null
+++ b/config/init-programming.el
@@ -0,0 +1,100 @@
+;;; init-programming.el --- Configure things related to programming -*- lexical-binding: t -*-
+;; Author: Franck Cuny <franck@fcuny.net>
+
+;;; Commentary:
+
+;; Configure things related to programming
+
+;;; Code:
+
+(require 'compile)
+(setq compilation-always-kill t)
+;; Don't freeze when process reads from stdin
+(setq compilation-disable-input t)
+(setq compilation-ask-about-save nil)
+(setq compilation-context-lines 10)
+(setq compilation-scroll-output 'first-error)
+(setq compilation-skip-threshold 2)
+(setq compilation-window-height 100)
+
+(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))
+
+(use-package restclient
+ :ensure t
+ :mode ("\\.rest\\'" . restclient-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-lsp)
+(require 'init-go)
+(require 'init-nix)
+(require 'init-python)
+(require 'init-ruby)
+
+(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