Compare commits

..

9 Commits

Author SHA1 Message Date
27a4303ff3 add eln-cache, *.elc and session.* to git ignore file 2022-06-13 09:02:48 +02:00
af497c8391 Update org mode configuration (cleanup/add ANSI color escaping management)
Remove unused org-chef package.
Set the number of lines for block outputs from which begin_exemple is used (100 lines).
Add ANSI color escaping management for the org babel ouput blocks.
Update org-fancy-priorities.
2022-06-13 08:16:01 +02:00
6699148ed9 Remove $ management from the smartparens configuration for tex mode 2022-06-13 08:06:08 +02:00
44cd5ef97b Remove unused user-lsp-mode-hook callback from lsp utility and defer lsp-mode loading 2022-06-13 08:02:36 +02:00
593ae9806c Add gdb interface to the C/C++ mode 2022-06-13 08:01:27 +02:00
14ad96d4da Python mode cleanup and pip-requirements package add.
Remove max line length from Python mode linter (use projects configuration files instead).
Use the setup.cfg instead of pyproject.toml to compute the project root dir.
Add the synxtaxic coloration for pip-requirements (pip-requirements package).
Defer the lsp server startup.
2022-06-13 08:00:57 +02:00
74f18cbcab Read video from elfeed (v on elfeed entry) and feeds update
Add elfeed-view-mpv function to elfeed to play youtube video directly from emacs and using mpv.
Add the following youtube channels to elfeed: EmacsConf, Pyjamas, Matrixdotorg, ENS, System Crafters, Emacs confs,
CommCon, Linux fondation org, Arte, Talk Python and Python Bytes posdcast.
2022-06-13 07:50:07 +02:00
79be4334bd Add php and yaml modes 2022-06-13 07:49:04 +02:00
809dcf1f21 Load vcs init from main init 2022-06-13 07:42:47 +02:00
10 changed files with 164 additions and 57 deletions

3
.gitignore vendored
View File

@@ -12,3 +12,6 @@ quelpa
request
recentf~
transient
eln-cache
*.elc
session.*

View File

@@ -21,11 +21,11 @@
;;(require 'lib/bootstrap)
;;(require 'lib/apps)
;;(require 'lib/introspection)
(require 'lib/with)
;; Load full configuration.
(require 'init-utilities)
;;(require 'init-vcs)
(require 'init-vcs)
(require 'init-modes)
(require 'init-apps)

View File

@@ -4,6 +4,27 @@
;; https://github.com/skeeto/elfeed
;; An Emacs web feeds client
(require 'elfeed)
;; From https://medium.com/emacs/using-elfeed-to-view-videos-6dfc798e51e6
(defun elfeed-v-mpv (url)
"Watch a video from URL in MPV."
(async-shell-command (format "mpv --cache=yes --cache-secs=60 %s" url)))
(defun elfeed-view-mpv (&optional use-generic-p)
"Youtube-feed link."
(interactive "P")
(let ((entries (elfeed-search-selected)))
(cl-loop for entry in entries
do (elfeed-untag entry 'unread)
when (elfeed-entry-link entry)
do (elfeed-v-mpv it))
(mapc #'elfeed-search-update-entry entries)
(unless (use-region-p) (forward-line))))
(define-key elfeed-search-mode-map (kbd "v") 'elfeed-view-mpv)
(use-package elfeed
:ensure t
:commands elfeed
@@ -15,10 +36,26 @@
"https://blog.finxter.com/feed"
"https://planet.emacslife.com/atom.xml"
"https://planetpython.org/rss20.xml"
"http://www.reddit.com/r/emacs/.rss"
;; "http://www.reddit.com/r/emacs/.rss"
"http://linuxfr.org/journaux.atom"
"https://xkcd.com/atom.xml"
"https://pyjamas.live/feed.xml"
"https://medium.com/feed/tag/python"
"https://blog.devgenius.io/feed"
"https://mathspp.com/blog.atom"
"https://lwn.net/headlines/rss"
"https://nyxt.atlas.engineer/feed"
"https://pyvideo.org/feeds/all.rss.xml"
"https://toobnix.org/feeds/videos.xml?videoChannelId=154" ;; EmacsConf
"https://www.youtube.com/feeds/videos.xml?channel_id=UCWCFzEJd7PhVulMXwGjcYAA" ;; Pyjamas
"https://www.youtube.com/feeds/videos.xml?channel_id=UCVFkW-chclhuyYRbmmfwt6w" ;; Matrixdotorg
"https://www.youtube.com/feeds/videos.xml?channel_id=UCbn8O8WwMeoZsPRxgumfvAQ" ;; ENS
"https://www.youtube.com/feeds/videos.xml?channel_id=UCAiiOTio8Yu69c3XnR7nQBQ" ;; System Crafters
"https://www.youtube.com/feeds/videos.xml?channel_id=UCwuyodzTl_KdEKNuJmeo99A" ;; Emacs confs
"https://www.youtube.com/feeds/videos.xml?channel_id=UCe_eAP4ToqFLSxzvkTlNzUQ" ;; CommCon
"https://www.youtube.com/feeds/videos.xml?channel_id=UCfX55Sx5hEFjoC3cNs6mCUQ" ;; Linux foundation Org
"https://www.youtube.com/feeds/videos.xml?channel_id=UCwI-JbGNsojunnHbFAc0M4Q" ;; Arte
"https://www.youtube.com/feeds/videos.xml?channel_id=UCKPSmMfDsXTKrCZApukcJ7A" ;; Talk Python
"https://www.youtube.com/feeds/videos.xml?channel_id=UCK_eZkV9CYCxhdf9f0dEukA" ;; Python Bytes Podcast
)))
(provide 'apps/elfeed)

View File

@@ -116,6 +116,15 @@ of FILE in the current directory, suitable for creation"
)
;;; (Packages) ;;;
(use-package gdb-mi
:quelpa (gdb-mi :fetcher git
:url "https://github.com/weirdNox/emacs-gdb.git"
:files ("*.el" "*.c" "*.h" "Makefile"))
:init
(fmakunbound 'gdb)
(fmakunbound 'gdb-enable-debug))
;; https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/cc-vars.el
;; user customization variables for CC Mod
(use-package cc-vars

View File

@@ -2,6 +2,8 @@
;;; Commentary:
;;; Code:
(require 'ob)
(defconst *user-org-data-directory*
(path-join *user-data-directory* "org")
"Path to user's org data store.")
@@ -128,6 +130,17 @@
;; (interactive)
;; (cancel-timer user/org-mobile-sync-timer))
;; From https://emacs.stackexchange.com/questions/44664/apply-ansi-color-escape-sequences-for-org-babel-results
(defun user--babel-ansi ()
"Add ANSI escaping commands."
(when-let ((beg (org-babel-where-is-src-block-result nil nil)))
(save-excursion
(goto-char beg)
(when (looking-at org-babel-result-regexp)
(let ((end (org-babel-result-end))
(ansi-color-context-region nil))
(ansi-color-apply-on-region beg end))))))
(use-package org
:init
@@ -336,6 +349,14 @@
org-id-locations-file
(path-join *user-org-data-directory* "org-id-locations")))
;; https://github.com/rougier/svg-tag-mode
;; A minor mode for Emacs that replace keywords with nice SVG labels
;; (use-package svg-tag-mode
;; :ensure t
;; :config
;; (setq svg-tag-tags '(("TODO" . ((lambda (tag) (svg-tag-make "TODO"))))))
;; )
;; https://github.com/grugrut/helm-books/tree/625aadec1541a5ca36951e4ce1301f4b6fe2bf3f
;; Book search interface for emacs helm.
(use-package helm-books
@@ -347,18 +368,6 @@
(file (concat org-directory "book.org"))
"* %(helm-books)")))
;; https://github.com/Chobbes/org-chef
;; A package for making a cookbook and managing recipes with org-mode.
(use-package org-chef
:disabled
:config
(add-to-list
'org-capture-templates
`("c" "Cookbook" entry
(file ,(path-join *user-org-data-directory* "cookbook.org"))
"%(org-chef-get-recipe-from-url)"
:empty-lines 1)))
;; https://github.com/waymondo/org-repo-todo
;; Simple repository todo management with org-mode
(use-package org-repo-todo))
@@ -367,10 +376,15 @@
;; Working with Code Blocks
(use-package ob-core
:ensure nil
:hook
((org-babel-after-execute-hook . user--babel-ansi))
:config
(validate-setq
;; Don't ask for validation.
org-confirm-babel-evaluate nil)
org-confirm-babel-evaluate nil
;; Set the number of lines for block outputs from which it'll placed
;; in a #+begin_example...#+end_example block
org-babel-min-lines-for-block-output 100)
(add-many-to-list
'org-babel-load-languages
@@ -394,6 +408,8 @@
(push '(latex . t) to-load))
(with-executable 'perl
(push '(perl . t) to-load))
(with-executable 'php
(push '(php . t) to-load))
(with-executable 'python
(push '(python . t) to-load))
(with-executable 'R
@@ -658,7 +674,10 @@
;; https://github.com/harrybournis/org-fancy-priorities
;; Display Org Mode priorities as custom strings
(use-package org-fancy-priorities
:hook (org-mode-hook . org-fancy-priorities-mode))
:hook
(org-mode-hook . org-fancy-priorities-mode)
:config
(setq org-fancy-priorities-list '("HIGH" "MID" "LOW" "OPTIONAL")))
;; https://github.com/calvinwyoung/org-autolist
;; Making it even easier to edit lists in org-mode!
(use-package org-autolist

10
lisp/modes/php.el Normal file
View File

@@ -0,0 +1,10 @@
;;; php.el --- initializes PHP modes -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(use-package php-mode
:if (executable-find "php")
:defer)
(provide 'modes/php)
;;; php.el ends here

View File

@@ -13,10 +13,21 @@
;; lsp python customization
(lsp-register-custom-settings
'(("pylsp.plugins.pyls_mypy.enabled" t t)
("pylsp.plugins.flake8.maxLineLength" 100)
;; ("pylsp.plugins.flake8.maxLineLength" 100)
;; ("pylsp.plugins.pycodestyle.maxLineLength" 100)
("pylsp.plugins.yapf.enabled" t t)
("pylsp.plugins.pylint.enabled" t t)))
;; locate the root pyproject.toml to force pylint rcfile
;; (let* ((filename "pyproject.toml")
(let* ((filename "setup.cfg")
(found (locate-dominating-file default-directory filename)))
(when found
(let ((pyproject (format "%s%s" (replace-regexp-in-string "~" (getenv "HOME") found) filename)))
(setq-local lsp-pylsp-plugins-pylint-args (vector (format "--rcfile=%s" pyproject))))))
(message (format "lsp-pylsp-plugins-pylint-args=%s" lsp-pylsp-plugins-pylint-args))
;; Enable virtualenv support.
(when(feature-p 'pyvenv)
(pyvenv-mode t))
@@ -39,8 +50,8 @@
:mode ("SCon\(struct\|script\)$" . python-mode)
:interpreter ("python[0-9.]*" . python-mode)
:hook
(python-mode-hook . lsp)
(python-mode-hook . user--python-mode-hook)
(python-mode-hook . lsp-deferred)
(python-mode-hook . (lambda ()
(add-hook 'before-save-hook #'user--python-format-before-save nil t)))
@@ -56,8 +67,8 @@
python-shell-interpreter-args ""
python-shell-prompt-regexp "In \\[[0-9]+\\]: "
python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "
python-shell-completion-setup-code "from IPython.core.completerlib import module_completion"
python-shell-completion-string-code "';'.join(get_ipython().Completer.all_completions('''%s'''))\n"))
python-shell-completion-setup-code "from IPython.core.completerlib import module_completion"))
;; python-shell-completion-string-code "';'.join(get_ipython().Completer.all_completions('''%s'''))\n"))
(with-executable 'bpython
(defun user/bpython-term()
@@ -72,6 +83,14 @@
;; https://github.com/pythonic-emacs/anaconda-mode
;; Code navigation, documentation lookup and completion for Python.
(use-package anaconda-mode)
;; https://github.com/Wilfred/pip-requirements.el
;; Major mode for editing pip requirements files
;; TODO: Find why completion does not run.
(use-package pip-requirements
:ensure t
)
;; https://github.com/tsgates/pylookup
;; Emacs mode for searching python documents with convenience
(use-package pylookup

15
lisp/modes/yaml.el Normal file
View File

@@ -0,0 +1,15 @@
;;; yaml.el --- Initializes YAML mode -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(use-package yaml-mode
:ensure t
:defer
:config
(use-package flycheck-yamllint
:if (executable-find "yamllint")
:config
(flycheck-yamllint-setup)))
(provide 'modes/yaml)
;;; yaml.el ends here

View File

@@ -2,15 +2,11 @@
;;; Commentary:
;;; Code: https://github.com/emacs-lsp/lsp-mode
(defun user--lsp-mode-hook ()
"Mode hook for LSP minor modes."
(message "user--lsp-mode-hook"))
(use-package lsp-mode
:pin "MELPA"
:defer
:commands lsp
:hook ((lsp-after-open-hook . lsp-enable-imenu)
(lsp-mode-hook . user--lsp-mode-hook))
:hook ((lsp-after-open-hook . lsp-enable-imenu))
:config
(validate-setq
;; Automatically try to figure out project root.

View File

@@ -129,7 +129,6 @@
(sp-with-modes '(tex-mode plain-tex-mode latex-mode)
(sp-local-tag "i" "\"<" "\">")
(sp-local-pair "$" nil :unless '(sp-point-before-word-p))
(sp-local-pair "\\[" " \\]")
(sp-local-pair "\\(" " \\)")
(sp-local-pair "\\{" " \\}")