Compare commits

...

2 commits

2 changed files with 74 additions and 13 deletions

View file

@ -66,7 +66,8 @@
'(dash
htmlize
ess
auctex))
auctex
magit))
(missing-packages (remove-if #'package-installed-p required-packages)))
(when missing-packages
(message "Missing packages: %s" missing-packages)
@ -99,6 +100,8 @@
(defalias 'yes-or-no-p 'y-or-n-p)
(add-hook 'org-mode-hook 'display-line-numbers-mode)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
@ -109,7 +112,7 @@
ns-use-mac-modifier-symbols nil ; display standard Emacs (and not standard Mac) modifier symbols
)
(cua-mode t)
;; (cua-mode t) to activate
(global-set-key "\M-g" 'goto-line)
@ -180,6 +183,8 @@ Entered on %U
(setq org-agenda-include-all-todo t)
(setq org-agenda-include-diary t)
;; Adding the ~/org directory to the list of directories to scan
(setq org-agenda-files '("~/org"))
(global-set-key (kbd "C-c d") 'insert-date)
(defun insert-date (prefix)
@ -207,6 +212,15 @@ Entered on %U
(global-set-key (kbd "C-c <left>") 'outline-previous-visible-heading)
(global-set-key (kbd "C-c <right>") 'outline-next-visible-heading)
(defun org-toggle-emphasis ()
"Toggle hiding/showing of org emphasize markers."
(interactive)
(if org-hide-emphasis-markers
(set-variable 'org-hide-emphasis-markers nil)
(set-variable 'org-hide-emphasis-markers t))
(org-mode-restart))
(define-key org-mode-map (kbd "C-c e") 'org-toggle-emphasis)
;; In org-mode 9 you need to have #+PROPERTY: header-args :eval never-export
;; in the beginning or your document to tell org-mode not to evaluate every
;; code block every time you export.
@ -301,9 +315,20 @@ A->B
(setq python-shell-completion-native-enable nil)
(when (require 'company-mode nil 'noerror)
package-install 'company-mode)
(let* ((wanted-packages
'(flycheck
company))
(missing-wanted-packages (remove-if #'package-installed-p wanted-packages)))
(when missing-wanted-packages
(message "Missing wanted packages: %s" missing-wanted-packages)
(package-refresh-contents)
(dolist (pkg missing-wanted-packages)
(package-install pkg)
(message "Wanted package %s has been installed" pkg))))
(global-company-mode)
;; When loading org-mode turns off auto-fill-mode
(add-hook 'org-mode-hook 'turn-off-auto-fill)
(load-theme 'leuven t)

View file

@ -90,7 +90,8 @@ document, simply =M-x org-babel-tangle=.
'(dash
htmlize
ess
auctex))
auctex
magit))
(missing-packages (remove-if #'package-installed-p required-packages)))
(when missing-packages
(message "Missing packages: %s" missing-packages)
@ -138,7 +139,8 @@ This seems to be needed on some platforms.
(transient-mark-mode t)
(require 'paren)
#+end_src
** Asking for confirmation concisely: :WEB:
** Asking for confirmation concisely: :WEB:
Link: http://org.ryuslash.org/dotfiles/emacs/init.html#sec-7-1 Being
asked to type in yes explicitly all the time gets very tedious. I
understand that it is safer since y is much easier to type in
@ -148,6 +150,11 @@ don't want is there, but I haven't had any such problems yet.
#+begin_src emacs-lisp :tangle init.el
(defalias 'yes-or-no-p 'y-or-n-p)
#+end_src
** Add the line numbers on the left :LOUIS:
Add the number lines on the left side when Org mode is active
#+begin_src emacs-lisp :tangle init.el
(add-hook 'org-mode-hook 'display-line-numbers-mode)
#+end_src
* Shortcuts:
** UTF 8 by default :ARNAUD:
#+begin_src emacs-lisp :tangle init.el
@ -171,7 +178,7 @@ fail on mac).
Yuck! Many people like this but I hate it as it conflicts with some of
my other shortcuts (e.g., the ones for spelling a region).
#+begin_src emacs-lisp :tangle init.el
(cua-mode t)
;; (cua-mode t) to activate
#+end_src
** Navigate back in text :ARNAUD:noexport:
#+begin_src emacs-lisp
@ -294,6 +301,9 @@ Entered on %U
#+begin_src emacs-lisp :tangle init.el
(setq org-agenda-include-all-todo t)
(setq org-agenda-include-diary t)
;; Adding the ~/org directory to the list of directories to scan
(setq org-agenda-files '("~/org"))
#+end_src
* Org-mode shortcuts
** Adding date with brackets with command "C-c d": :LUKA:
@ -334,6 +344,18 @@ Additional shortcuts for navigating through org-mode documents:
(global-set-key (kbd "C-c <left>") 'outline-previous-visible-heading)
(global-set-key (kbd "C-c <right>") 'outline-next-visible-heading)
#+end_src
** Toggling the visibility of emphasis markers :LOUIS:
Sourced from [[https://stackoverflow.com/questions/10969617/hiding-markup-elements-in-org-mode]["Hiding markup Elements" on StackOverflow]]
#+begin_src emacs-lisp :tangle init.el
(defun org-toggle-emphasis ()
"Toggle hiding/showing of org emphasize markers."
(interactive)
(if org-hide-emphasis-markers
(set-variable 'org-hide-emphasis-markers nil)
(set-variable 'org-hide-emphasis-markers t))
(org-mode-restart))
(define-key org-mode-map (kbd "C-c e") 'org-toggle-emphasis)
#+end_src
* Org-mode + babel:
** Seamless use of babel (no confirmation, lazy export) :ARNAUD:
#+begin_src emacs-lisp :tangle init.el
@ -482,17 +504,31 @@ This often fails, yielding an ugly warning, and isn't of any use in Org-mode any
#+begin_src emacs-lisp :tangle init.el
(setq python-shell-completion-native-enable nil)
#+end_src
* Company-mode :LOUIS:Completion:
** Installing Company-mode
* Custom Louis :LOUIS:
** Installing wanted packages
#+begin_src emacs-lisp :tangle init.el
(when (require 'company-mode nil 'noerror)
package-install 'company-mode)
(let* ((wanted-packages
'(flycheck
company))
(missing-wanted-packages (remove-if #'package-installed-p wanted-packages)))
(when missing-wanted-packages
(message "Missing wanted packages: %s" missing-wanted-packages)
(package-refresh-contents)
(dolist (pkg missing-wanted-packages)
(package-install pkg)
(message "Wanted package %s has been installed" pkg))))
#+end_src
** Global enable Company-mode
** Global enable Company-mode :completion:
#+begin_src emacs-lisp :tangle init.el
(global-company-mode)
#+end_src
* Thème
** Disabling auto-fill-mode when using org
This snippet disables the auto-fill-mode which wraps the line when it exceeds a certain length
#+begin_src emacs-lisp :tangle init.el
;; When loading org-mode turns off auto-fill-mode
(add-hook 'org-mode-hook 'turn-off-auto-fill)
#+end_src
* Theme
** Activation du thème
#+begin_src emacs-lisp :tangle init.el
(load-theme 'leuven t)