Add your own custom snippets
This commit is contained in:
parent
bd480d3c12
commit
107a59f9b0
14 changed files with 80 additions and 25 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -11,3 +11,5 @@ tramp
|
||||||
url/*
|
url/*
|
||||||
transient/*
|
transient/*
|
||||||
.lsp-session-*
|
.lsp-session-*
|
||||||
|
eshell/*
|
||||||
|
.yas-compiled-snippets.el
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer t
|
:defer t
|
||||||
:bind ("<f5> c" . magit-checkout)
|
:bind ("<f5> c" . magit-checkout)
|
||||||
("<f5> b" . magit-blame)
|
("<f5> b" . magit-blame-addition)
|
||||||
("<f5> g" . magit-status)
|
("<f5> g" . magit-status)
|
||||||
(:map magit-blame-mode-map
|
(:map magit-blame-mode-map
|
||||||
("<f5> b" . 'magit-blame-quit)))
|
("<f5> b" . 'magit-blame-quit)))
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,8 @@
|
||||||
:hook (((prog-mode text-mode) . rainbow-delimiters-mode))
|
:hook (((prog-mode text-mode) . rainbow-delimiters-mode))
|
||||||
:init
|
:init
|
||||||
;;; Match parenthasis (left-right)
|
;;; Match parenthasis (left-right)
|
||||||
(electric-pair-mode t))
|
(electric-pair-mode t)
|
||||||
|
(show-paren-mode t))
|
||||||
|
|
||||||
;;; Show hex (#aaa) colors as colors
|
;;; Show hex (#aaa) colors as colors
|
||||||
(use-package rainbow-mode
|
(use-package rainbow-mode
|
||||||
|
|
@ -69,3 +70,6 @@
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer t
|
:defer t
|
||||||
:config (global-column-enforce-mode t))
|
:config (global-column-enforce-mode t))
|
||||||
|
|
||||||
|
(provide '05prog-mode)
|
||||||
|
;;; 05prog-mode ends here
|
||||||
|
|
|
||||||
|
|
@ -31,19 +31,21 @@
|
||||||
(yas-global-mode t)
|
(yas-global-mode t)
|
||||||
|
|
||||||
(setq-default
|
(setq-default
|
||||||
company-minimum-prefix-length 2 ; minimum prefix character number for auto complete.
|
company-minimum-prefix-length 2 ;; minimum prefix character number for auto complete.
|
||||||
company-idle-delay 0.1
|
company-idle-delay 0.1
|
||||||
company-echo-delay 0 ;; company-show-numbers t
|
company-echo-delay 0 ;;;; company-show-numbers t
|
||||||
company-tooltip-align-annotations t ; align annotations to the right tooltip border.
|
company-tooltip-align-annotations t ;; align annotations to the right tooltip border.
|
||||||
company-tooltip-flip-when-above t
|
company-tooltip-flip-when-above t
|
||||||
company-tooltip-limit 10 ; tooltip candidates max limit.
|
company-tooltip-limit 10 ;; tooltip candidates max limit.
|
||||||
company-tooltip-minimum 2 ; minimum candidates limit.
|
company-tooltip-minimum 2 ;; minimum candidates limit.
|
||||||
company-tooltip-minimum-width 10 ; The minimum width of the tooltip's inner area.
|
company-tooltip-minimum-width 10 ;; The minimum width of the tooltip's inner area.
|
||||||
; This doesn't include the margins and the scroll bar.
|
;; This doesn't include the margins and the scroll bar.
|
||||||
company-tooltip-margin 2 ; width of margin columns to show around the tooltip
|
company-tooltip-margin 2 ;; width of margin columns to show around the tooltip
|
||||||
company-tooltip-offset-display 'lines ; 'lines - how to show tooltip unshown candidates number.
|
company-tooltip-offset-display 'lines ;; 'lines - how to show tooltip unshown candidates number.
|
||||||
company-show-numbers nil ; t: show quick-access numbers for the first ten candidates.
|
company-show-numbers nil ;; t: show quick-access numbers for the first ten candidates.
|
||||||
company-selection-wrap-around t ; loop over candidates
|
company-selection-wrap-around t ;; loop over candidates
|
||||||
|
company-dabbrev-other-buffers t ;; Only offer dabbrev from the same major mode
|
||||||
|
company-dabbrev-downcase nil ;; Preserve case of candidates
|
||||||
;; company-async-wait 0.03
|
;; company-async-wait 0.03
|
||||||
;; company-async-timeout 2
|
;; company-async-timeout 2
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -17,16 +17,17 @@
|
||||||
:defer t
|
:defer t
|
||||||
:ensure t)
|
:ensure t)
|
||||||
|
|
||||||
|
(setq-local indent-tabs-mode nil)
|
||||||
|
|
||||||
(defun activate-my-clojure-mode ()
|
(defun activate-my-clojure-mode ()
|
||||||
"Goodies for clojure files."
|
"Goodies for clojure files."
|
||||||
(set-indent 2) ;; Default indentation of 2 characters
|
(set-indent 2) ;; Default indentation of 2 characters
|
||||||
(column-enforce-n 80)
|
(column-enforce-n 80)
|
||||||
(clj-refactor-mode 1)
|
(clj-refactor-mode 1)
|
||||||
(cider-mode 1)
|
(cider-mode 1)
|
||||||
|
(paredit-mode 1)
|
||||||
;; Do not show separate error window when in REPL
|
;; Do not show separate error window when in REPL
|
||||||
(setq cider-show-error-buffer 'except-in-repl)
|
(setq cider-show-error-buffer 'except-in-repl))
|
||||||
(paredit-mode 1))
|
|
||||||
|
|
||||||
(add-hook 'clojure-mode-hook 'activate-my-clojure-mode)
|
(add-hook 'clojure-mode-hook 'activate-my-clojure-mode)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
"Goodies for editing emacs files."
|
"Goodies for editing emacs files."
|
||||||
(set-indent 2) ;; Default indentation of 2 characters
|
(set-indent 2) ;; Default indentation of 2 characters
|
||||||
(column-enforce-n 80)
|
(column-enforce-n 80)
|
||||||
|
(setq-default indent-tabs-mode nil)
|
||||||
|
|
||||||
;; Company list override
|
;; Company list override
|
||||||
(add-to-list (make-local-variable 'company-backends)
|
(add-to-list (make-local-variable 'company-backends)
|
||||||
'(company-elisp company-yasnippet))
|
'(company-elisp company-yasnippet))
|
||||||
|
|
||||||
(paredit-mode 1)
|
(paredit-mode 1))
|
||||||
)
|
|
||||||
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'activate-emacs-lisp-mode)
|
(add-hook 'emacs-lisp-mode-hook 'activate-emacs-lisp-mode)
|
||||||
|
|
|
||||||
|
|
@ -66,14 +66,27 @@
|
||||||
(setq-local
|
(setq-local
|
||||||
ctags/refresh-command
|
ctags/refresh-command
|
||||||
(format
|
(format
|
||||||
"ctags -e -R --languages=erlang -f %sTAGS %s. %slib/stdlib-* %slib/kernel-*"
|
"ctags -e -R --languages=erlang -f %sTAGS %ssrc %sdeps %sapps %s_build %slib/stdlib-* %slib/kernel-*"
|
||||||
(projectile-project-root) (projectile-project-root)
|
(projectile-project-root) (projectile-project-root)
|
||||||
|
(projectile-project-root) (projectile-project-root)
|
||||||
|
(projectile-project-root)
|
||||||
(plist-get erlang/current-erlang :erlang-path)
|
(plist-get erlang/current-erlang :erlang-path)
|
||||||
(plist-get erlang/current-erlang :erlang-path)))
|
(plist-get erlang/current-erlang :erlang-path)))
|
||||||
|
|
||||||
|
;; Add include path so that Erlang does not complain about
|
||||||
|
;; missing header files.
|
||||||
|
(setq-local flycheck-erlang-include-path
|
||||||
|
(list (format "%sdeps" (projectile-project-root))
|
||||||
|
(format "%sinclude" (projectile-project-root))
|
||||||
|
(format "%sapps" (projectile-project-root))))
|
||||||
|
|
||||||
|
;; (setq-local flycheck-erlang-library-path
|
||||||
|
;; (list (format "%sdeps" (projectile-project-root))
|
||||||
|
;; (format "%sapps" (projectile-project-root))))
|
||||||
|
|
||||||
;; Company list override
|
;; Company list override
|
||||||
(add-to-list (make-local-variable 'company-backends)
|
(add-to-list (make-local-variable 'company-backends)
|
||||||
'(company-etags company-yasnippet)))
|
'(company-yasnippet company-etags company-dabbrev)))
|
||||||
|
|
||||||
(add-hook 'erlang-mode-hook 'erlang/activate-erlang-mode)
|
(add-hook 'erlang-mode-hook 'erlang/activate-erlang-mode)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,10 @@
|
||||||
(setq js2-mode-show-strict-warnings nil)
|
(setq js2-mode-show-strict-warnings nil)
|
||||||
(tide-hl-identifier-mode +1)
|
(tide-hl-identifier-mode +1)
|
||||||
|
|
||||||
(flycheck-add-next-checker 'javascript-standard 'javascript-tide 'append)
|
(if (string-match-p "rebelroam" (buffer-file-name))
|
||||||
|
(flycheck-add-next-checker 'javascript-standard 'javascript-tide 'append))
|
||||||
|
|
||||||
|
|
||||||
(setq-local flycheck-check-syntax-automatically '(save mode-enabled))
|
(setq-local flycheck-check-syntax-automatically '(save mode-enabled))
|
||||||
|
|
||||||
;; "Company list override."
|
;; "Company list override."
|
||||||
|
|
|
||||||
8
snippets/emacs-lisp-mode/preambule
Normal file
8
snippets/emacs-lisp-mode/preambule
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
;;;-------------------------------------------------------------------
|
||||||
|
;;; author: Maciej Szlosarczyk (${1: maciej@sosek.net})
|
||||||
|
;;; copyright (C) (${2:`(format-time-string "%Y")`}) Maciej Szlosarczyk
|
||||||
|
;;; @doc
|
||||||
|
;;;
|
||||||
|
;;; @end
|
||||||
|
;;; Created: ${3:`(format-time-string "%d %b %Y")`}
|
||||||
|
;;;-------------------------------------------------------------------
|
||||||
12
snippets/erlang-mode/preambule
Normal file
12
snippets/erlang-mode/preambule
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: preambule
|
||||||
|
# --
|
||||||
|
%%%-------------------------------------------------------------------
|
||||||
|
%%% @author Maciej Szlosarczyk (${1: maciej@sosek.net})
|
||||||
|
%%% @copyright (C) (${2:`(format-time-string "%Y")`}) Maciej Szlosarczyk
|
||||||
|
%%% @doc
|
||||||
|
%%%
|
||||||
|
%%% @end
|
||||||
|
%%% Created: ${3:`(format-time-string "%d %b %Y")`}
|
||||||
|
%%%-------------------------------------------------------------------
|
||||||
|
$0
|
||||||
3
snippets/js-mode/ar
Normal file
3
snippets/js-mode/ar
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
(${1:a}) => {
|
||||||
|
$0
|
||||||
|
}
|
||||||
3
snippets/tide-mode/ar
Normal file
3
snippets/tide-mode/ar
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
(${1:a}) => {
|
||||||
|
$0
|
||||||
|
}
|
||||||
3
snippets/web-mode/ar
Normal file
3
snippets/web-mode/ar
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
(${1:a}) => {
|
||||||
|
$0
|
||||||
|
}
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
(load "$HOME/.emacs.d/themes/themes-base16-not-harmonic.el" 'f 't)
|
(load "$HOME/.emacs.d/themes/themes-base16-not-harmonic.el" 'f 't)
|
||||||
(load-theme 'base16-mexico-light t t)
|
(load-theme 'base16-mexico-light t t)
|
||||||
|
(load-theme 'base16-ia-dark t t)
|
||||||
(load-theme 'manoj-dark t t)
|
(load-theme 'manoj-dark t t)
|
||||||
(load-theme 'base16-one-light t t)
|
(load-theme 'base16-one-light t t)
|
||||||
(load-theme 'base16-zenburn t t)
|
(load-theme 'base16-zenburn t t)
|
||||||
|
|
@ -26,7 +27,7 @@
|
||||||
(if (display-graphic-p)
|
(if (display-graphic-p)
|
||||||
(progn
|
(progn
|
||||||
(sml/apply-theme 'respectful)
|
(sml/apply-theme 'respectful)
|
||||||
(enable-theme 'base16-mocha))
|
(enable-theme 'base16-not-harmonic))
|
||||||
(progn
|
(progn
|
||||||
(enable-theme 'base16-mexico-light)
|
(enable-theme 'base16-mexico-light)
|
||||||
(setq base16-theme-256-color-source "base16-shell")))
|
(setq base16-theme-256-color-source "base16-shell")))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue