From d7ea081ee3ffadcb705387cc5435b4dd378adc91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 2 Sep 2020 09:14:30 +0200 Subject: [PATCH 1/7] Updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .emacs.d/emacs-custom.el | 2 +- .emacs.d/init.el | 6 ++++++ .vimrc | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.emacs.d/emacs-custom.el b/.emacs.d/emacs-custom.el index 2bd4b17..272f5f3 100644 --- a/.emacs.d/emacs-custom.el +++ b/.emacs.d/emacs-custom.el @@ -9,7 +9,7 @@ '(livedown-port 1337) '(package-selected-packages (quote - (org-jira use-package switch-window ox-reveal ox-jira markdown-mode magit htmlize dracula-theme dired-sidebar confluence)))) + (auto-complete use-package switch-window ox-reveal ox-jira org-jira markdown-mode magit htmlize dracula-theme dired-sidebar confluence)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 20dd203..da768d4 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -83,6 +83,12 @@ ; ) ;(setq jiralib-url "https://localhost/") +;; AutoComlete +(use-package auto-complete + :ensure t + ) +(ac-config-default) + ;; Theme (use-package dracula-theme :ensure t diff --git a/.vimrc b/.vimrc index 758ef08..296f782 100644 --- a/.vimrc +++ b/.vimrc @@ -138,4 +138,3 @@ autocmd BufWritePost *.md :Prettier let g:livedown_browser = "browser-x" let g:livedown_autorun = 0 let g:livedown_open = 1 -let g:livedown_port = 4242 From 268214ffc7f2939dea3437b053bdc84226741427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 2 Sep 2020 09:19:55 +0200 Subject: [PATCH 2/7] Updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .emacs.d/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index da768d4..7945a88 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -47,7 +47,6 @@ (setq browse-url-browser-function 'browse-url-generic browse-url-generic-program "browser-x") - ;; Switch-window (use-package switch-window :ensure t @@ -88,6 +87,7 @@ :ensure t ) (ac-config-default) +(global-auto-complete-mode t) ;; Theme (use-package dracula-theme From 5bc70bb1f99de6e88fd400846e4f88895ef42332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 2 Sep 2020 09:48:40 +0200 Subject: [PATCH 3/7] Updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .emacs.d/plugins/org-ac.el | 261 +++++++++++++++++++++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 .emacs.d/plugins/org-ac.el diff --git a/.emacs.d/plugins/org-ac.el b/.emacs.d/plugins/org-ac.el new file mode 100644 index 0000000..d34ff8c --- /dev/null +++ b/.emacs.d/plugins/org-ac.el @@ -0,0 +1,261 @@ +;;; org-ac.el --- Some auto-complete sources for org-mode + +;; Copyright (C) 2014 Hiroaki Otsu + +;; Author: Hiroaki Otsu +;; Keywords: org, completion +;; URL: https://github.com/aki2o/org-ac +;; Version: 0.0.2 +;; Package-Requires: ((auto-complete-pcmp "0.0.1") (log4e "0.2.0") (yaxception "0.1")) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;; +;; This extension provides auto-complete sources for org-mode. + +;;; Dependency: +;; +;; - auto-complete-pcmp.el ( see ) +;; - yaxception.el ( see ) +;; - log4e.el ( see ) + +;;; Installation: +;; +;; Put this to your load-path. +;; And put the following lines in your .emacs or site-start.el file. +;; +;; (require 'org-ac) + +;;; Configuration: +;; +;; ;; Make config suit for you. About the config item, see Customization or eval the following sexp. +;; ;; (customize-group "org-ac") +;; +;; (org-ac/config-default) + +;;; Customization: +;; +;; [EVAL] (autodoc-document-lisp-buffer :type 'user-variable :prefix "org-ac/" :docstring t) +;; `org-ac/ac-trigger-command-keys' +;; Keystrokes for doing `ac-start' with self insert. +;; +;; *** END auto-documentation + +;;; API: +;; +;; [EVAL] (autodoc-document-lisp-buffer :type 'command :prefix "org-ac/" :docstring t) +;; `org-ac/setup-current-buffer' +;; Do setup for using org-ac in current buffer. +;; +;; *** END auto-documentation +;; [Note] Functions and variables other than listed above, Those specifications may be changed without notice. + +;;; Tested On: +;; +;; - Emacs ... GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2) of 2013-08-22 on chindi02, modified by Debian +;; - auto-complete-pcmp.el ... Version 0.0.1 +;; - yaxception.el ... Version 0.1 +;; - log4e.el ... Version 0.2.0 + + +;; Enjoy!!! + + +(eval-when-compile (require 'cl)) +(require 'org) +(require 'auto-complete-pcmp) +(require 'rx) +(require 'log4e) +(require 'yaxception) + +(defgroup org-ac nil + "Auto completion for org-mode." + :group 'org + :prefix "org-ac/") + +(defcustom org-ac/ac-trigger-command-keys '("\\" "*" "SPC" ":" "[" "+") + "Keystrokes for doing `ac-start' with self insert." + :type '(repeat string) + :group 'org-ac) + + +(log4e:deflogger "org-ac" "%t [%l] %m" "%H:%M:%S" '((fatal . "fatal") + (error . "error") + (warn . "warn") + (info . "info") + (debug . "debug") + (trace . "trace"))) +(org-ac--log-set-level 'trace) + + +(defun* org-ac--show-message (msg &rest args) + (apply 'message (concat "[ORG-AC] " msg) args) + nil) + +(defun org-ac--complete-close-option-at-current-point () + (let ((pt (point))) + (yaxception:$ + (yaxception:try + (org-ac--trace "start complete close option at current point") + (when (save-excursion + (re-search-backward "#\\+\\(begin\\|BEGIN\\)_\\([a-zA-Z0-9]+\\) *\\=" nil t)) + (let* ((opennm (match-string-no-properties 1)) + (typenm (match-string-no-properties 2)) + (closenm (cond ((string= opennm "begin") "end") + ((string= opennm "BEGIN") "END"))) + (case-fold-search t)) + (if (or (not (re-search-forward "^[ \t]*#\\+" nil t)) + (not (re-search-forward (concat "\\=" closenm "_") nil t))) + (progn (goto-char pt) + (insert "\n#+" closenm "_" typenm) + (org-cycle)) + (let ((currtypenm (if (re-search-forward "\\=\\([a-zA-Z0-9]+\\)" nil t) + (match-string-no-properties 1) + ""))) + (backward-delete-char (+ (length closenm) + 1 + (length currtypenm))) + (insert closenm "_" typenm))) + (goto-char pt)))) + (yaxception:catch 'error e + (org-ac--show-message "Failed complete close option : %s" (yaxception:get-text e)) + (org-ac--error "failed complete close option at current point : %s\n%s" + (yaxception:get-text e) + (yaxception:get-stack-trace-string e)) + (goto-char pt))))) + +(defun org-ac--get-link-head-candidates () + (append (ac-pcmp/get-ac-candidates) + (mapcar (lambda (x) (concat x ":")) org-link-types))) + +(defvar ac-source-org-ac-tex + '((candidates . ac-pcmp/get-ac-candidates) + (prefix . "\\\\\\([a-zA-Z0-9_-]*\\)") + (symbol . "t") + (requires . 0) + (cache) + (action . ac-pcmp/do-ac-action))) + +(defvar ac-source-org-ac-head + '((candidates . ac-pcmp/get-ac-candidates) + (prefix . "[^\r\n*]\\*\\([^\t\r\n]*\\)") + (symbol . "h") + (requires . 0) + (cache) + (action . ac-pcmp/do-ac-action))) + +(defvar ac-source-org-ac-todo + '((candidates . ac-pcmp/get-ac-candidates) + (prefix . "^\\*+ \\([a-zA-Z0-9_-]*\\)") + (symbol . "d") + (requires . 0) + (cache) + (action . ac-pcmp/do-ac-action))) + +(defvar ac-source-org-ac-tag + '((candidates . ac-pcmp/get-ac-candidates) + (prefix . "[ \t]:\\([a-zA-Z0-9_-]*\\)") + (symbol . "t") + (requires . 0) + (cache) + (action . ac-pcmp/do-ac-action))) + +(defvar org-ac--regexp-link-head (rx-to-string `(and "[" + (* (any " \t")) + "[" + (group (* (not (any ":*]"))))))) +(defvar ac-source-org-ac-link-head + `((candidates . org-ac--get-link-head-candidates) + (prefix . ,org-ac--regexp-link-head) + (symbol . "l") + (requires . 0) + (cache) + (action . (lambda () + (ac-pcmp/do-ac-action) + (ac-start))))) + +(defvar ac-source-org-ac-option + '((candidates . ac-pcmp/get-ac-candidates) + (prefix . "^[ \t]*#\\+\\([a-zA-Z0-9_:=-]*\\)") + (symbol . "o") + (requires . 0) + (cache) + (action . (lambda () + (ac-pcmp/do-ac-action) + (org-ac--complete-close-option-at-current-point) + (auto-complete '(ac-source-org-ac-option-key)))))) + +(defvar ac-source-org-ac-option-key + '((candidates . ac-pcmp/get-ac-candidates) + (prefix . "^[ \t]*#\\+[a-zA-Z0-9_:=-]+ +\\([a-zA-Z0-9_-]*\\)") + (symbol . "k") + (requires . 0) + (cache) + (action . ac-pcmp/do-ac-action))) + +(defvar ac-source-org-ac-option-options + '((candidates . ac-pcmp/get-ac-candidates) + (prefix . "^[ \t]*#\\+\\(?:options\\|OPTIONS\\):.* +\\([a-zA-Z0-9_-]*\\)") + (symbol . "x") + (requires . 0) + (cache) + (action . ac-pcmp/do-ac-action))) + +(defvar ac-source-org-ac-file + '((init . (setq ac-filename-cache nil)) + (candidates . org-ac/file-candidate) + (prefix . "\\[file:\\(.*\\)") + (symbol . "f") + (requires . 0) + (action . ac-start) + (limit . nil))) + + +;;;###autoload +(defun org-ac/setup-current-buffer () + "Do setup for using org-ac in current buffer." + (interactive) + (when (eq major-mode 'org-mode) + (loop for stroke in org-ac/ac-trigger-command-keys + do (local-set-key (read-kbd-macro stroke) 'ac-pcmp/self-insert-command-with-ac-start)) + (add-to-list 'ac-sources 'ac-source-org-ac-tex) + (add-to-list 'ac-sources 'ac-source-org-ac-head) + (add-to-list 'ac-sources 'ac-source-org-ac-todo) + (add-to-list 'ac-sources 'ac-source-org-ac-tag) + (add-to-list 'ac-sources 'ac-source-org-ac-link-head) + (add-to-list 'ac-sources 'ac-source-org-ac-option) + (add-to-list 'ac-sources 'ac-source-org-ac-option-key) + (add-to-list 'ac-sources 'ac-source-org-ac-option-options) + (add-to-list 'ac-sources 'ac-source-org-ac-file) + (auto-complete-mode t))) + +;;;###autoload +(defun org-ac/config-default () + "Do setting recommemded configuration." + (add-to-list 'ac-modes 'org-mode) + (add-hook 'org-mode-hook 'org-ac/setup-current-buffer t)) + + +(defun org-ac/file-candidate () + "Adds [file: to the normal file completition, plus allows relative paths" + (if (string-match "^[~./]+" ac-prefix) + (ac-filename-candidate) + (let ((ac-prefix (concat "./" ac-prefix))) + (mapcar (lambda (path) (substring path 2)) + (ac-filename-candidate))))) + + +(provide 'org-ac) +;;; org-ac.el ends here From 3fe77852e69f6029a91d171b606be49853e8b501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 2 Sep 2020 11:30:37 +0200 Subject: [PATCH 4/7] Upatded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index 296f782..2b481d0 100644 --- a/.vimrc +++ b/.vimrc @@ -22,6 +22,7 @@ Plug 'jceb/vim-orgmode' Plug 'tpope/vim-speeddating' Plug 'prettier/vim-prettier', { 'do': 'npm install --force' } Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' } +Plug 'ycm-core/YouCompleteMe', { 'do': 'python3 install.py --clangd-completer --java-completer'} " Problem with vim-prettier " " git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x; From 5b5e331648ece91b57f89469c5421963615e9ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Thu, 3 Sep 2020 08:32:59 +0200 Subject: [PATCH 5/7] Updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .vimrc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.vimrc b/.vimrc index 2b481d0..66ba066 100644 --- a/.vimrc +++ b/.vimrc @@ -14,7 +14,6 @@ au BufWritePre * let &bex = '@' . strftime("%F.%H:%M") " plugins call plug#begin('~/.vim/plugged') Plug 'preservim/nerdtree' -Plug 'y0rune/vimwiki' Plug 'nmante/vim-latex-live-preview' Plug 'lervag/vimtex' Plug 'junegunn/goyo.vim' @@ -29,17 +28,6 @@ Plug 'ycm-core/YouCompleteMe', { 'do': 'python3 install.py --clangd-completer -- " npm install --force call plug#end() -" Vim wiki -let wiki = {} -let wiki.path = '~/git/notes/' -let wiki.path_html = '~/git/notes/www/' -let wiki.syntax = 'default' -let wiki.ext = '.wiki' -let text_ignore_newline = 0 -let g:vimwiki_list = [wiki] -let g:vimwiki_list_ignore_newline = 1 -let g:vimwiki_table_mappings = 0 - " Status-line set statusline= set statusline+=%#IncSearch# From b7916c11c9896565553a234e58b1a5e20097478a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Fri, 4 Sep 2020 12:09:43 +0200 Subject: [PATCH 6/7] Upated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .vimrc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.vimrc b/.vimrc index 66ba066..f6153a0 100644 --- a/.vimrc +++ b/.vimrc @@ -23,7 +23,6 @@ Plug 'prettier/vim-prettier', { 'do': 'npm install --force' } Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' } Plug 'ycm-core/YouCompleteMe', { 'do': 'python3 install.py --clangd-completer --java-completer'} " Problem with vim-prettier -" " git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x; " npm install --force call plug#end() @@ -53,6 +52,10 @@ set encoding=utf-8 " livepreviewer let g:livepreview_previewer = 'mupdf' +" markdown preview +let g:mkdp_browser = '/home/yorune/.local/bin/browser-x' +let g:mkdp_echo_preview_url = 1 + " line numbers set number set ruler @@ -121,9 +124,4 @@ autocmd BufWritePre * %s/\s\+$//e autocmd BufWritepre * %s/\n\+\%$//e " Autoformating markdown -autocmd BufWritePost *.md :Prettier - -" Livedown -let g:livedown_browser = "browser-x" -let g:livedown_autorun = 0 -let g:livedown_open = 1 +"autocmd BufWritePost *.md :Prettier From 81f4d7e697fbe5ecc8f83db96d749e0d3bba3016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Fri, 4 Sep 2020 13:12:40 +0200 Subject: [PATCH 7/7] updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index f6153a0..c31d71e 100644 --- a/.vimrc +++ b/.vimrc @@ -22,6 +22,9 @@ Plug 'tpope/vim-speeddating' Plug 'prettier/vim-prettier', { 'do': 'npm install --force' } Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' } Plug 'ycm-core/YouCompleteMe', { 'do': 'python3 install.py --clangd-completer --java-completer'} +Plug 'hashivim/vim-terraform' +Plug 'vim-syntastic/syntastic' +Plug 'juliosueiras/vim-terraform-completion' " Problem with vim-prettier " git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x; " npm install --force