From efd323a7492570037ef467d74db9be2b5040dc76 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sun, 13 Dec 2020 13:52:41 -0300 Subject: [PATCH 1/3] Added snippets to Emacs --- emacs.d/init.el | 5 +++++ .../markdown-mode/.yas-compiled-snippets.el | 8 ++++++++ emacs.d/snippets/markdown-mode/header | 15 +++++++++++++++ .../python-mode/.yas-compiled-snippets.el | 2 ++ .../snippets/rust-mode/.yas-compiled-snippets.el | 2 ++ 5 files changed, 32 insertions(+) create mode 100644 emacs.d/snippets/markdown-mode/.yas-compiled-snippets.el create mode 100644 emacs.d/snippets/markdown-mode/header create mode 100644 emacs.d/snippets/python-mode/.yas-compiled-snippets.el create mode 100644 emacs.d/snippets/rust-mode/.yas-compiled-snippets.el diff --git a/emacs.d/init.el b/emacs.d/init.el index a5349f5..8ae8b47 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -111,6 +111,11 @@ (setq whitespace-style '(face empty tabs lines-tail trailing)) (global-whitespace-mode t) +;; Snippets +(use-package yasnippet + :ensure t) +(yas-global-mode 1) + ;; auto-pairs (electric-pair-mode 1) diff --git a/emacs.d/snippets/markdown-mode/.yas-compiled-snippets.el b/emacs.d/snippets/markdown-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..cf4baa9 --- /dev/null +++ b/emacs.d/snippets/markdown-mode/.yas-compiled-snippets.el @@ -0,0 +1,8 @@ +;;; Compiled snippets and support files for `markdown-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'markdown-mode + '(("header" "+++\ntitle = \"${1:title}\"\ndate = `(format-time-string \"%Y-%m-%d\")`\n\n[taxonomies]\ntags = [\"${3:tag}\"]\n+++\n\n$0\n\n" "Markdown header" nil nil nil "/home/juliobiason/.emacs.d/snippets/markdown-mode/header" nil nil))) + + +;;; Do not edit! File generated at Sun Dec 13 13:51:57 2020 diff --git a/emacs.d/snippets/markdown-mode/header b/emacs.d/snippets/markdown-mode/header new file mode 100644 index 0000000..043e4b8 --- /dev/null +++ b/emacs.d/snippets/markdown-mode/header @@ -0,0 +1,15 @@ +-*- mode: snippet -*- +# name: Markdown header +# key: header +# -- ++++ +title = "${1:title}" +date = `(format-time-string "%Y-%m-%d")` + +[taxonomies] +tags = ["${3:tag}"] ++++ + +$0 + + \ No newline at end of file diff --git a/emacs.d/snippets/python-mode/.yas-compiled-snippets.el b/emacs.d/snippets/python-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..133b73e --- /dev/null +++ b/emacs.d/snippets/python-mode/.yas-compiled-snippets.el @@ -0,0 +1,2 @@ +;;; Compiled snippets and support files for `python-mode' +;;; Do not edit! File generated at Sun Dec 13 13:51:57 2020 diff --git a/emacs.d/snippets/rust-mode/.yas-compiled-snippets.el b/emacs.d/snippets/rust-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..74895c0 --- /dev/null +++ b/emacs.d/snippets/rust-mode/.yas-compiled-snippets.el @@ -0,0 +1,2 @@ +;;; Compiled snippets and support files for `rust-mode' +;;; Do not edit! File generated at Sun Dec 13 13:51:57 2020 From 405ffa30475f04ad0786abc99f9e8f4bada40d30 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Wed, 16 Dec 2020 18:07:12 -0300 Subject: [PATCH 2/3] Snippets for Markdown --- emacs.d/snippets/markdown-mode/stars | 5 +++++ nvim/UltiSnips/markdown.snippets | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 emacs.d/snippets/markdown-mode/stars diff --git a/emacs.d/snippets/markdown-mode/stars b/emacs.d/snippets/markdown-mode/stars new file mode 100644 index 0000000..ae8c1e2 --- /dev/null +++ b/emacs.d/snippets/markdown-mode/stars @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: stars +# key: stars +# -- +{{ stars(stars=${1:stars}) }} \ No newline at end of file diff --git a/nvim/UltiSnips/markdown.snippets b/nvim/UltiSnips/markdown.snippets index 7c0b820..538b477 100644 --- a/nvim/UltiSnips/markdown.snippets +++ b/nvim/UltiSnips/markdown.snippets @@ -13,9 +13,27 @@ $0 endsnippet snippet pt - +$0 + + endsnippet snippet date `date +%Y-%m-%d` endsnippet + +snippet stars +{{ stars(stars=${1:stars}) }} + +$0 +endsnippet + +snippet note +{% note() %} +$1 +{% end %} + +$0 +endsnippet From 57f62c4073f4dda316283f28b7154f58c8a41278 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Wed, 16 Dec 2020 18:07:29 -0300 Subject: [PATCH 3/3] Looks better for "?" to open the context menu --- nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/init.vim b/nvim/init.vim index 9426628..6033f94 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -74,7 +74,7 @@ nnoremap ] :call LanguageClient#textDocument_definition() nnoremap k :call LanguageClient#textDocument_hover() nnoremap r :call LanguageClient#textDocument_rename() nnoremap f :call LanguageClient#textDocument_codeAction() -nnoremap ? :call LanguageClient#explainErrorAtPoint() +nnoremap ? :call LanguageClient_contextMenu() " }}} " }}}