Compare commits
74 Commits
Author | SHA1 | Date | |
---|---|---|---|
c59fe9f0aa | |||
456d727429 | |||
5eda7990e2 | |||
![]() |
533ea6953f | ||
![]() |
821b54fe2a | ||
![]() |
749a1cb33f | ||
![]() |
c5f0d84689 | ||
![]() |
79cc50ce64 | ||
![]() |
21f2cf3a08 | ||
![]() |
2e66e8893e | ||
![]() |
af5244168e | ||
![]() |
4ee79f3999 | ||
![]() |
4efd474d08 | ||
![]() |
338cebea4b | ||
2a76be1a87 | |||
c4f5c73c0b | |||
d43f5f350a | |||
b34a82ace3 | |||
66d2dafed2 | |||
9db58fdc7d | |||
4ef4959b4e | |||
6ffb7fccc6 | |||
![]() |
372ad6ff1f | ||
6d5058644b | |||
8d182df96e | |||
242f5ec765 | |||
aba5e59b02 | |||
3ddd2efd64 | |||
f123b5adf9 | |||
f9598f5872 | |||
d486156ba8 | |||
38e92905e3 | |||
91b3c8d6b8 | |||
2cf8a7d6a6 | |||
3eba90ddd7 | |||
19707ef86d | |||
9c7add3600 | |||
466d3c4213 | |||
46552ee63d | |||
a066539b7f | |||
79b8ed5f81 | |||
524979eb11 | |||
d2ddb582bd | |||
8f826cb8a3 | |||
f53864a714 | |||
32ca324900 | |||
cb2cb918df | |||
94d28d7a2d | |||
1c82edd5bb | |||
9fd02a16f8 | |||
085e476d0f | |||
e81308a39c | |||
feb71536a7 | |||
5c590da187 | |||
e8d4767adc | |||
3fe51a5a87 | |||
b4d28e2324 | |||
94347e9e73 | |||
6614195fd3 | |||
3cace18a5a | |||
91d8471e42 | |||
8ce00c8a0d | |||
58cc480658 | |||
d590aa16a8 | |||
e66773991b | |||
e07b3998a0 | |||
18d1f070a0 | |||
594d61e319 | |||
8f5c76f5d7 | |||
5cb1c1bec5 | |||
d6d36138cc | |||
a559c8e4e6 | |||
db581097bb | |||
3dfb64a1a1 |
13
.env.example
Normal file
13
.env.example
Normal file
@ -0,0 +1,13 @@
|
||||
# General configuration
|
||||
EMACS_USER="LibreUser."
|
||||
EMACS_EMAIL="user@example.org"
|
||||
|
||||
# Web browser
|
||||
WEB_BROWSER_APP="iceweasel-uxp"
|
||||
|
||||
# Angular configuration
|
||||
ANGULAR_SERVER_DIR="/usr/local/lib/node_modules/@angular/language-server"
|
||||
NODEJS_MODULE_DIR="/usr/local/lib/node_modules"
|
||||
|
||||
REVEAL_JS_DIR="/path/to/reveal.js"
|
||||
REVEAL_CSS_FILE="/path/to/highlight/night-owl.css"
|
39
.gitea/workflows/git-sync.yaml
Normal file
39
.gitea/workflows/git-sync.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
name: git-sync-with-mirror
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
git-sync:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: git-sync
|
||||
env:
|
||||
git_sync_source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
||||
git_sync_destination_repo: ssh://git@c.fridu.us/software/emacs-personal.git
|
||||
if: env.git_sync_source_repo && env.git_sync_destination_repo
|
||||
uses: astounds/git-sync@v1
|
||||
with:
|
||||
source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
||||
source_branch: "master"
|
||||
destination_repo: ssh://git@c.fridu.us/software/emacs-personal.git
|
||||
destination_branch: "master"
|
||||
source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}
|
||||
destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}
|
||||
|
||||
- name: git-sync-sourcehut
|
||||
env:
|
||||
git_sync_source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
||||
git_sync_destination_repo: git@git.sr.ht:~heckyel/emacs-personal
|
||||
if: env.git_sync_source_repo && env.git_sync_destination_repo
|
||||
uses: astounds/git-sync@v1
|
||||
with:
|
||||
source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
||||
source_branch: "master"
|
||||
destination_repo: git@git.sr.ht:~heckyel/emacs-personal
|
||||
destination_branch: "master"
|
||||
source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}
|
||||
destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -5,9 +5,12 @@
|
||||
.cache/
|
||||
.litable-lists.el
|
||||
.org-id-locations
|
||||
.lsp-session-v1
|
||||
.dap-breakpoints
|
||||
.session
|
||||
.smex-items
|
||||
*.eld
|
||||
.env
|
||||
*~
|
||||
/.mc-lists.el
|
||||
\#*\#
|
||||
@ -24,6 +27,7 @@ projectile*
|
||||
recentf
|
||||
session*
|
||||
smex-items
|
||||
snippets/
|
||||
srecode-map.el
|
||||
tramp
|
||||
transient/
|
||||
@ -33,3 +37,4 @@ vendor/
|
||||
|
||||
### Python Virtual ###
|
||||
.python-environments/
|
||||
elpy/
|
||||
|
85
README.md
85
README.md
@ -1,7 +1,7 @@
|
||||
<h1 align="center">emacs-personal</h1>
|
||||
Lightweight configuration of emacs with basic utilities plus personal configuration
|
||||
|
||||

|
||||

|
||||
|
||||
### Installation
|
||||
|
||||
@ -11,39 +11,64 @@ First step:
|
||||
|
||||
#### Main mirror
|
||||
|
||||
1. `git clone https://libregit.org/heckyel/emacs-personal.git ~/.emacs.d/`
|
||||
|
||||
2. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'`
|
||||
1. `git clone https://c.fridu.us/software/emacs-personal.git ~/.emacs.d/`
|
||||
2. `cp -v ~/.emacs.d/.env.example ~/.emacs.d/.env`
|
||||
3. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'`
|
||||
|
||||
#### Secundary mirror
|
||||
|
||||
1. `git clone https://notabug.org/heckyel/emacs-personal.git ~/.emacs.d/`
|
||||
1. `git clone https://git.sr.ht/~heckyel/emacs-personal ~/.emacs.d/`
|
||||
2. `cp -v ~/.emacs.d/.env.example ~/.emacs.d/.env`
|
||||
3. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'`
|
||||
|
||||
2. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'`
|
||||
### Requirements
|
||||
|
||||
* [x] ttf-hack
|
||||
* [x] ttf-anonymous-pro
|
||||
* [x] hyphen
|
||||
* [x] hyphen-es
|
||||
* [x] markdown
|
||||
* [x] shellcheck
|
||||
* [x] python-virtualenv
|
||||
* [x] python-pylint
|
||||
|
||||
### Fonts
|
||||
|
||||
`pacman -S ttf-hack` (for default)
|
||||
|
||||
`pacman -S ttf-anonymous-pro`
|
||||
|
||||
> change the typography in the [init-gui.el](modules/init-gui.el#L54) file
|
||||
change the typography in the [init-gui.el](modules/init-gui.el#L54) file
|
||||
|
||||
### Icons
|
||||
|
||||
emacs --batch --eval="(progn (package-initialize)(package-install 'all-the-icons))"
|
||||
```console
|
||||
$ emacs --batch --eval="(progn (package-initialize)(package-install 'all-the-icons))"
|
||||
```
|
||||
|
||||
### Markdown Mode
|
||||
- Require installed markdown in distro GNU+Linux, example:
|
||||
|
||||
`apt install markdown` or `pacman -S markdown`
|
||||
Require installed markdown in distro GNU+Linux, example:
|
||||
|
||||
```console
|
||||
$ apt install markdown
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```console
|
||||
$ pacman -S markdown
|
||||
```
|
||||
|
||||
### Flycheck Mode
|
||||
- Require installed the languages checking, example:
|
||||
|
||||
`pacman -S shellcheck` # bash, sh
|
||||
#### bash, sh
|
||||
|
||||
`pacman -S python-pylint` # python
|
||||
```console
|
||||
$ pacman -S shellcheck
|
||||
```
|
||||
|
||||
#### python
|
||||
|
||||
```console
|
||||
$ pacman -S python-pylint
|
||||
```
|
||||
|
||||
### Neotree
|
||||
|
||||
@ -56,17 +81,17 @@ So pressing `[f6]` will display
|
||||
### Mode Python
|
||||
- Require installed virtualenv:
|
||||
|
||||
pacman -S python-virtualenv
|
||||
$ pacman -S python-virtualenv
|
||||
|
||||
- Enable or disable pyvenv-mode: <kdb>M-x</kdb> pyvenv-mode
|
||||
|
||||
- To create virtualenv from emacs:
|
||||
|
||||
pyvenv-create
|
||||
$ pyvenv-create
|
||||
|
||||
- To activate virtualenv from emacs:
|
||||
|
||||
pyvenv-activate
|
||||
$ pyvenv-activate
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@ -81,16 +106,28 @@ gpg: Imposible comprobar la firma: No public key
|
||||
|
||||
### Method 0
|
||||
|
||||
gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
|
||||
```console
|
||||
$ gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
|
||||
```
|
||||
|
||||
### Method 1
|
||||
|
||||
Disable temp signature key
|
||||
|
||||
$ sed -i "s|(setq package-check-signature 'allow-unsigned)|(setq package-check-signature nil)|g" "$HOME/.emacs.d/init.el"
|
||||
```console
|
||||
$ sed -i "s|(setq package-check-signature 'allow-unsigned)|(setq package-check-signature nil)|g" "$HOME/.emacs.d/init.el"
|
||||
```
|
||||
|
||||
M-x package-install RET gnu-elpa-keyring-update RET
|
||||
```console
|
||||
M-x package-install RET gnu-elpa-keyring-update RET
|
||||
```
|
||||
|
||||
and enable signature key
|
||||
|
||||
$ sed -i "s|(setq package-check-signature nil)|(setq package-check-signature 'allow-unsigned)|g" "$HOME/.emacs.d/init.el"
|
||||
```console
|
||||
$ sed -i "s|(setq package-check-signature nil)|(setq package-check-signature 'allow-unsigned)|g" "$HOME/.emacs.d/init.el"
|
||||
```
|
||||
|
||||
## Evaluate in buffer
|
||||
|
||||
<kbd>C-x</kbd> + <kbd>C-e</kbd>
|
||||
|
@ -3,14 +3,8 @@
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(anzu-deactivate-region t)
|
||||
'(anzu-input-idle-delay 0.1)
|
||||
'(anzu-replace-threshold 1000)
|
||||
'(anzu-replace-to-string-separator " => ")
|
||||
'(anzu-search-threshold 1000)
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(gnu-elpa-keyring-update git-gutter-fringe yaml-mode whitespace-cleanup-mode which-key web-mode vue-mode use-package undo-tree smartparens sass-mode rjsx-mode rainbow-mode py-autopep8 projectile pkgbuild-mode pip-requirements php-refactor-mode nlinum nginx-mode neotree markdown-mode log4j-mode less-css-mode json-mode js2-refactor ivy-rich ivy-hydra highlight-indent-guides gitignore-mode gitconfig-mode gitattributes-mode git-timemachine flycheck eslintd-fix emmet-mode elpy dotenv-mode doom-themes doom-modeline dokuwiki-mode diminish crystal-mode counsel company-quickhelp company-php apache-mode anzu))))
|
||||
'(ox-reveal terraform-mode restclient load-env-vars dap-mode lsp-ui lsp-treemacs graphviz-dot-mode dokuwiki-mode dockerfile-mode dotenv-mode web-mode rainbow-mode yaml-mode vue-mode typescript-mode tide sass-mode smartparens lua-mode pkgbuild-mode py-autopep8 pip-requirements elpy projectile company-php php-mode php-refactor-mode go-mode markdown-mode eslintd-fix prettier-js json-mode js2-refactor js2-mode crystal-mode editorconfig nginx-mode emmet-mode whitespace-cleanup-mode log4j-mode ivy-hydra hydra ivy-rich counsel flycheck company-quickhelp company apache-mode dashboard neotree all-the-icons highlight-indent-guides doom-modeline diminish which-key undo-tree vscode-dark-plus-theme)))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
|
58
init.el
58
init.el
@ -13,13 +13,43 @@
|
||||
(setq package-check-signature 'allow-unsigned)
|
||||
|
||||
;;; Fix TLS emacs 26.x
|
||||
(if (version< "26.0" emacs-version)
|
||||
(if (version<= emacs-version "26.2")
|
||||
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
|
||||
|
||||
;;; Welcome message
|
||||
(setq-default initial-scratch-message
|
||||
(concat ";; Happy hacking, " user-login-name " - Emacs loves you!\n\n"))
|
||||
|
||||
(defvar before-user-init-time (current-time)
|
||||
"Value of `current-time' when Emacs begins loading `user-init-file'.")
|
||||
|
||||
;;; Garbage Collector
|
||||
(progn
|
||||
;; Set this to true to find GC issues.
|
||||
(setq garbage-collection-messages nil)
|
||||
|
||||
;; Increase the gc-cons-threshold to a very high number to decrease
|
||||
;; the load and compile time. The value will be decreased
|
||||
;; significantly after initialization to avoid long GC pauses during
|
||||
;; normal usage.
|
||||
(setq gc-cons-threshold 402653184
|
||||
gc-cons-percentage 0.6)
|
||||
|
||||
(setq read-process-output-max (* 1024 1024)) ;; 1mb
|
||||
|
||||
;; Reset GC to normal values.
|
||||
(add-hook 'emacs-startup-hook
|
||||
(lambda ()
|
||||
(message
|
||||
"[STARTUP] Loading %s...done (%.3fs)" user-init-file
|
||||
(float-time (time-subtract (current-time)
|
||||
before-user-init-time)))
|
||||
|
||||
(when init-file-debug
|
||||
(message "Rolling back GC settings to sane values."))
|
||||
(setq gc-cons-threshold 16777216
|
||||
gc-cons-percentage 0.1))))
|
||||
|
||||
;;; Modules directory
|
||||
(push (concat user-emacs-directory "modules") load-path)
|
||||
|
||||
@ -40,11 +70,11 @@
|
||||
(require 'init-security)
|
||||
(require 'init-elpa)
|
||||
;; theme
|
||||
(require 'init-theme)
|
||||
;; (require 'init-doom-theme)
|
||||
(require 'init-vscode-theme)
|
||||
;; Utils
|
||||
(require 'init-utils)
|
||||
;; GUI
|
||||
(require 'init-linum)
|
||||
(require 'init-gui)
|
||||
(require 'init-editing-utils)
|
||||
(require 'init-diminish)
|
||||
@ -52,6 +82,7 @@
|
||||
(require 'init-indent-guides)
|
||||
(require 'init-icons)
|
||||
(require 'init-neotree)
|
||||
(require 'init-dashboard)
|
||||
;; Tools
|
||||
(require 'init-apache)
|
||||
(require 'init-company)
|
||||
@ -61,29 +92,38 @@
|
||||
(require 'init-whitespace)
|
||||
(require 'init-emmet-mode)
|
||||
(require 'init-nginx)
|
||||
(require 'init-git)
|
||||
;;(require 'init-editorconfig nil 'noerror)
|
||||
(require 'init-editorconfig)
|
||||
;; Languages
|
||||
(require 'init-ccc)
|
||||
(require 'init-crystal)
|
||||
(require 'init-html)
|
||||
(require 'init-js-two)
|
||||
(require 'init-markdown)
|
||||
(require 'init-go)
|
||||
(require 'init-php)
|
||||
(require 'init-projectile)
|
||||
(require 'init-python)
|
||||
(require 'init-pkgbuild)
|
||||
(require 'init-less)
|
||||
(require 'init-lua)
|
||||
(require 'init-smartparens)
|
||||
(require 'init-sass)
|
||||
(require 'init-scss)
|
||||
(require 'init-typescript)
|
||||
(require 'init-vue)
|
||||
(require 'init-yaml)
|
||||
;; Plus
|
||||
(require 'init-rainbow)
|
||||
(require 'init-web-mode)
|
||||
(require 'init-dotenv)
|
||||
(require 'init-dokuwiki))
|
||||
(require 'init-dockerfile)
|
||||
(require 'init-dokuwiki)
|
||||
(require 'init-graphviz)
|
||||
(require 'init-linter)
|
||||
(require 'init-load-env-vars)
|
||||
(require 'init-restclient)
|
||||
(require 'init-terraform)
|
||||
(require 'init-ox-reveal))
|
||||
|
||||
;;; Custom variables
|
||||
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
|
||||
@ -97,12 +137,6 @@
|
||||
(when (file-exists-p custom-file)
|
||||
(load settings-file))
|
||||
|
||||
;; Time Output
|
||||
(when window-system
|
||||
(let ((elapsed (float-time (time-subtract (current-time)
|
||||
emacs-load-start-time))))
|
||||
(message "[STARTUP] Loading %s ... done (%.3fs)" load-file-name elapsed)))
|
||||
|
||||
;; enable erase-buffer command
|
||||
(put 'erase-buffer 'disabled nil)
|
||||
|
||||
|
@ -2,14 +2,18 @@
|
||||
;;; Commentary:
|
||||
;; Company es un famework de Emacs para el completado de texto.
|
||||
|
||||
;;; CODE:
|
||||
;;; code:
|
||||
(use-package company
|
||||
:ensure t
|
||||
:defer 5
|
||||
:diminish
|
||||
:bind
|
||||
(:map company-mode-map
|
||||
("<backtab>" . company-complete))
|
||||
:config
|
||||
;; Global
|
||||
(setq company-idle-delay 1
|
||||
company-minimum-prefix-length 1
|
||||
company-show-numbers t
|
||||
company-show-numbers nil
|
||||
company-tooltip-limit 20)
|
||||
|
||||
;; Facing
|
||||
@ -21,9 +25,6 @@
|
||||
(set-face-attribute 'company-scrollbar-bg nil :inherit 'company-tooltip :background "gray20")
|
||||
(set-face-attribute 'company-scrollbar-fg nil :background "gray40"))
|
||||
|
||||
;; Default backends
|
||||
(setq company-backends '((company-files)))
|
||||
|
||||
;; Activating globally
|
||||
(global-company-mode t))
|
||||
|
||||
|
39
modules/init-dashboard.el
Normal file
39
modules/init-dashboard.el
Normal file
@ -0,0 +1,39 @@
|
||||
;;; init-dashboard.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
(use-package dashboard
|
||||
:pin "MELPA"
|
||||
:ensure t
|
||||
:config
|
||||
;; Dashboard configuration
|
||||
(dashboard-setup-startup-hook)
|
||||
(setq dashboard-banner-logo-title "Emacs personal")
|
||||
(setq dashboard-startup-banner 'logo)
|
||||
(setq dashboard-center-content t)
|
||||
(setq dashboard-show-shortcuts t)
|
||||
(setq dashboard-set-heading-icons t)
|
||||
(setq dashboard-set-file-icons t)
|
||||
(setq dashboard-set-footer nil)
|
||||
|
||||
;; Configuration of dashboard sections
|
||||
(setq num-recents 5)
|
||||
(setq num-bookmarks 5)
|
||||
(setq num-projects 5)
|
||||
(setq num-agenda 5)
|
||||
(setq num-registers 5)
|
||||
|
||||
;; Note:
|
||||
;; grave accent (`) is used to access Emacs commands known like "execute commands".
|
||||
;; syntax ,variable is used in context of backquote (`) macro to evaluate
|
||||
;; the variable and replace it with its value time of evaluation.
|
||||
;; This is known as "unquote" and is useful for constructing complex forms or lists.
|
||||
(setq dashboard-items `((recents . ,num-recents)
|
||||
(bookmarks . ,num-bookmarks)
|
||||
(projects . ,num-projects)
|
||||
(agenda . ,num-agenda)
|
||||
(registers . ,num-registers))))
|
||||
|
||||
(provide 'init-dashboard)
|
||||
;;; init-dashboard.el ends here
|
11
modules/init-dockerfile.el
Normal file
11
modules/init-dockerfile.el
Normal file
@ -0,0 +1,11 @@
|
||||
;;; init-dockerfile.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;; dockerfile-mode
|
||||
(use-package dockerfile-mode
|
||||
:mode ("Dockerfile\\'" . dockerfile-mode))
|
||||
|
||||
(provide 'init-dockerfile)
|
||||
;;; init-dockerfile.el ends here
|
@ -1,4 +1,4 @@
|
||||
;;; init-theme.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; init-doom-theme.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
@ -7,17 +7,16 @@
|
||||
:pin "MELPA"
|
||||
:ensure t
|
||||
:bind
|
||||
("C-x t d" . dark-theme)
|
||||
(("C-x t d" . dark-theme)
|
||||
("C-x t s" . semi-dark-theme)
|
||||
("C-x t l" . light-theme)
|
||||
("C-x t l" . light-theme))
|
||||
|
||||
:init
|
||||
(defun light-theme ()
|
||||
"Activate light colortheme"
|
||||
(interactive)
|
||||
(load-theme 'doom-one-light)
|
||||
(delete-selection-mode 1)
|
||||
)
|
||||
(delete-selection-mode 1))
|
||||
|
||||
(defun dark-theme ()
|
||||
"Activate dark colortheme"
|
||||
@ -25,8 +24,7 @@
|
||||
(load-theme 'doom-molokai)
|
||||
(delete-selection-mode 1)
|
||||
;; Invoke customcolors
|
||||
(darkcolor)
|
||||
)
|
||||
(darkcolor))
|
||||
|
||||
(defun semi-dark-theme ()
|
||||
"Activate semi-dark colortheme"
|
||||
@ -34,11 +32,10 @@
|
||||
(load-theme 'doom-molokai)
|
||||
(delete-selection-mode 1)
|
||||
;; Invoke customcolors
|
||||
(semidarkcolor)
|
||||
)
|
||||
(semidarkcolor))
|
||||
|
||||
;; Invoke theme
|
||||
(load-theme 'doom-molokai t) ;; global
|
||||
(load-theme 'doom-molokai t)
|
||||
|
||||
:config
|
||||
(defun darkcolor ()
|
||||
@ -49,15 +46,14 @@
|
||||
|
||||
;; Modeline
|
||||
(set-face-background 'mode-line "#0C0E10")
|
||||
(set-face-background 'modeline-inactive "#333333")
|
||||
(set-face-background 'mode-line-inactive "#333333")
|
||||
;; (set-face-foreground 'mode-line "#FFFFFF")
|
||||
|
||||
;; Fix linum current-line highlight
|
||||
(defface my-linum-hl
|
||||
'((t :background "#0C0E10" :foreground "gold"))
|
||||
"Face for the currently active Line number"
|
||||
:group 'linum)
|
||||
)
|
||||
:group 'linum))
|
||||
|
||||
(defun semidarkcolor ()
|
||||
"Simple semidarkcolor for theme."
|
||||
@ -74,13 +70,11 @@
|
||||
(defface my-linum-hl
|
||||
'((t :background "gray20" :foreground "gold"))
|
||||
"Face for the currently active Line number"
|
||||
:group 'linum)
|
||||
)
|
||||
:group 'linum))
|
||||
|
||||
;; Invoke color
|
||||
(semidarkcolor) ;; default
|
||||
)
|
||||
(semidarkcolor))
|
||||
|
||||
(provide 'init-theme)
|
||||
(provide 'init-doom-theme)
|
||||
|
||||
;;; init-theme.el ends here
|
||||
;;; init-doom-theme.el ends here
|
@ -7,6 +7,7 @@
|
||||
;; EditorConfig
|
||||
;;----------------------------------------------------------------------------
|
||||
(use-package editorconfig
|
||||
:ensure t
|
||||
:config
|
||||
(when (and (require 'editorconfig nil t)
|
||||
(fboundp 'editorconfig-mode))
|
||||
|
@ -20,16 +20,19 @@
|
||||
'(("MELPA Stable" . 10)
|
||||
("GNU ELPA" . 5)
|
||||
("ORG" . 3)
|
||||
("MELPA" . 0)))
|
||||
|
||||
("MELPA" . 0))
|
||||
package-enable-at-startup nil)
|
||||
;; =================
|
||||
|
||||
(setq package-native-compile t)
|
||||
(package-initialize)
|
||||
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-refresh-contents)
|
||||
(package-install 'use-package))
|
||||
|
||||
(require 'use-package)
|
||||
(eval-when-compile
|
||||
(require 'use-package))
|
||||
(setq use-package-always-ensure t)
|
||||
;; =====================================================
|
||||
;; End use-package
|
||||
|
@ -17,6 +17,10 @@
|
||||
:modes (php-mode php+-mode web-mode))
|
||||
|
||||
(add-to-list 'flycheck-checkers 'mix-php)
|
||||
;; enable typescript-tslint checker
|
||||
(with-eval-after-load 'tide
|
||||
(flycheck-add-mode 'typescript-tslint 'typescript-mode)
|
||||
(flycheck-add-mode 'typescript-tide 'typescript-mode))
|
||||
;; Enable for only languages
|
||||
:hook
|
||||
(c++-mode . flycheck-mode)
|
||||
|
@ -1,112 +0,0 @@
|
||||
;;; init-git.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
(setq vc-follows-symlinks t
|
||||
find-file-visit-truename t
|
||||
vc-handled-backends nil)
|
||||
|
||||
(if (display-graphic-p)
|
||||
(use-package git-gutter-fringe
|
||||
:ensure t
|
||||
:config
|
||||
(global-git-gutter-mode t)
|
||||
(setq-default fringes-outside-margins nil)
|
||||
(setq-default left-fringe-width 10)
|
||||
(set-face-foreground 'git-gutter-fr:modified "purple")
|
||||
(set-face-foreground 'git-gutter-fr:added "green")
|
||||
(set-face-foreground 'git-gutter-fr:deleted "red")
|
||||
|
||||
(defun my-reshape-git-gutter (gutter)
|
||||
"Re-shape gutter for `ivy-read'."
|
||||
(let* ((linenum-start (aref gutter 3))
|
||||
(linenum-end (aref gutter 4))
|
||||
(target-line "")
|
||||
(target-linenum 1)
|
||||
(tmp-line "")
|
||||
(max-line-length 0))
|
||||
(save-excursion
|
||||
(while (<= linenum-start linenum-end)
|
||||
(with-no-warnings
|
||||
(goto-line linenum-start))
|
||||
(setq tmp-line (replace-regexp-in-string "^[ \t]*" ""
|
||||
(buffer-substring (line-beginning-position)
|
||||
(line-end-position))))
|
||||
(when (> (length tmp-line) max-line-length)
|
||||
(setq target-linenum linenum-start)
|
||||
(setq target-line tmp-line)
|
||||
(setq max-line-length (length tmp-line)))
|
||||
|
||||
(setq linenum-start (1+ linenum-start))))
|
||||
;; build (key . linenum-start)
|
||||
(cons (format "%s %d: %s"
|
||||
(if (eq 'deleted (aref gutter 1)) "-" "+")
|
||||
target-linenum target-line)
|
||||
target-linenum)))
|
||||
|
||||
(defun my-goto-git-gutter ()
|
||||
(interactive)
|
||||
(eval-when-compile (require 'git-gutter-fringe nil t))
|
||||
(when (and (require 'git-gutter-fringe nil t)
|
||||
(fboundp 'ivy-read))
|
||||
|
||||
(if git-gutter-fr:diffinfos
|
||||
(ivy-read "git-gutters-fr:"
|
||||
(mapcar 'my-reshape-git-gutter git-gutter-fr:diffinfos)
|
||||
:action (lambda (e)
|
||||
;; ivy9+ keep `(car e)'
|
||||
;; ivy8- strip the `(car e)'
|
||||
;; we handle both data structure
|
||||
(unless (numberp e) (setq e (cdr e)))
|
||||
(with-no-warnings
|
||||
(goto-line e))))
|
||||
(message "NO git-gutters-fringe!"))
|
||||
))))
|
||||
|
||||
(use-package gitconfig-mode
|
||||
:ensure t
|
||||
:mode ("/\\.?git/?config$"
|
||||
"/\\.gitmodules$")
|
||||
:hook
|
||||
(gitconfig-mode . flyspell-mode))
|
||||
|
||||
(use-package gitignore-mode
|
||||
:ensure t
|
||||
:mode ("/\\.gitignore$"
|
||||
"/\\.git/info/exclude$"
|
||||
"/git/ignore$"))
|
||||
|
||||
(use-package gitattributes-mode
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
(use-package git-timemachine
|
||||
:ensure t
|
||||
:commands git-timemachine
|
||||
:bind (:map git-timemachine-mode
|
||||
("c" . git-timemachine-show-current-revision)
|
||||
("b" . git-timemachine-switch-branch)))
|
||||
|
||||
;;; smerge-mode video explain https://emacsgifs.github.io/public/videos/758861381898637313.mp4
|
||||
(use-package smerge-mode
|
||||
:ensure t
|
||||
:config
|
||||
(defun enable-smerge-maybe ()
|
||||
(when (and buffer-file-name (vc-backend buffer-file-name))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "^<<<<<<< " nil t)
|
||||
(smerge-mode +1)))))
|
||||
|
||||
(eval-when-compile (require 'smerge-mode nil t))
|
||||
(when (and (require 'smerge-mode nil t)
|
||||
(fboundp 'enable-smerge-maybe))
|
||||
(add-hook 'buffer-list-update-hook #'enable-smerge-maybe)))
|
||||
|
||||
(provide 'init-git)
|
||||
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (not free-vars)
|
||||
;; End:
|
||||
;;; init-git.el ends here
|
11
modules/init-go.el
Normal file
11
modules/init-go.el
Normal file
@ -0,0 +1,11 @@
|
||||
;;; init-go.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;; go-mode
|
||||
(use-package go-mode
|
||||
:mode ("\\.go\\'" . go-mode))
|
||||
|
||||
(provide 'init-go)
|
||||
;;; init-go.el ends here
|
20
modules/init-graphviz.el
Normal file
20
modules/init-graphviz.el
Normal file
@ -0,0 +1,20 @@
|
||||
;;; init-graphviz.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Graphviz Mode
|
||||
;;----------------------------------------------------------------------------
|
||||
|
||||
(use-package graphviz-dot-mode
|
||||
:pin "MELPA"
|
||||
:ensure t
|
||||
:config
|
||||
(setq graphviz-dot-indent-width 4))
|
||||
|
||||
(provide 'init-graphviz)
|
||||
|
||||
;; End:
|
||||
;;; init-graphviz.el ends here
|
@ -15,18 +15,25 @@
|
||||
(menu-bar-mode 0)
|
||||
(setq make-backup-files nil) ; stop creating backup~ files
|
||||
(setq auto-save-default nil) ; stop creating #autosave# files
|
||||
(setq create-lockfiles nil) ; stop creating #create-lockfiles
|
||||
;; Suppressing ad-handle-definition Warnings in Emacs
|
||||
(setq ad-redefinition-action 'accept)
|
||||
|
||||
;;------------------------------
|
||||
;; Core settings | UTF-8 please
|
||||
;;------------------------------
|
||||
;; Set Unicode character priority
|
||||
(set-charset-priority 'unicode)
|
||||
;; Set language environment to UTF-8
|
||||
(set-language-environment "UTF-8")
|
||||
(set-terminal-coding-system 'utf-8) ; pretty
|
||||
(set-keyboard-coding-system 'utf-8) ; pretty
|
||||
(set-selection-coding-system 'utf-8) ; please
|
||||
(prefer-coding-system 'utf-8) ; with sugar on top
|
||||
;; Set terminal coding system to UTF-8
|
||||
(set-terminal-coding-system 'utf-8)
|
||||
;; Set keyboard coding system to UTF-8
|
||||
(set-keyboard-coding-system 'utf-8)
|
||||
;; Set selection coding system to UTF-8
|
||||
(set-selection-coding-system 'utf-8)
|
||||
;; Prefer UTF-8 coding system
|
||||
(prefer-coding-system 'utf-8)
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Editor configuration
|
||||
@ -47,13 +54,10 @@
|
||||
(lambda ()
|
||||
(setq line-spacing 0)))
|
||||
|
||||
;; Font theme (Monospace, or DejaVu Sans Mono if Monospace is not
|
||||
;; present)
|
||||
(condition-case nil
|
||||
;; Font theme (DejaVu Sans Mono if Hack isn't present)
|
||||
(if (member "Hack" (font-family-list))
|
||||
(set-frame-font "Hack-9")
|
||||
;; (set-frame-font "Monospace-9")
|
||||
;; (set-frame-font "Anonymous Pro-10")
|
||||
(error (set-frame-font "DejaVu Sans Mono-10")))
|
||||
(set-frame-font "DejaVu Sans Mono-10"))
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Configure keys
|
||||
@ -64,6 +68,12 @@
|
||||
(global-set-key (kbd "s-C--") 'sacha/decrease-font-size) ; C-- decrease font size
|
||||
(global-set-key (kbd "<f12>") 'revert-buffer-no-confirm)
|
||||
(global-set-key (kbd "s-h") 'global-hl-line-mode) ; Highlight current line
|
||||
(global-set-key (kbd "M-c") nil) ; disable capitalize-word
|
||||
(global-set-key (kbd "<f6>") 'display-line-numbers-mode)
|
||||
;; muti-curses
|
||||
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
||||
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
||||
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
|
||||
|
||||
;;---------------------------------------------------------------------------
|
||||
;; FullScreen
|
||||
@ -79,15 +89,15 @@
|
||||
;; Define custom browser
|
||||
;;----------------------------------------------------------------------------
|
||||
(setq browse-url-browser-function 'browse-url-generic
|
||||
browse-url-generic-program "iceweasel-uxp")
|
||||
browse-url-generic-program (getenv "WEB_BROWSER_APP"))
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; sudo open file option
|
||||
;; doas open file option
|
||||
;;----------------------------------------------------------------------------
|
||||
(defun sudo-find-file (file-name)
|
||||
(defun doas-find-file (file-name)
|
||||
"Like find file, but opens the file as root."
|
||||
(interactive "FSudo Find File: ")
|
||||
(let ((tramp-file-name (concat "/sudo::" (expand-file-name file-name))))
|
||||
(interactive "FDoas Find File: ")
|
||||
(let ((tramp-file-name (concat "/doas::" (expand-file-name file-name))))
|
||||
(find-file tramp-file-name)))
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
|
@ -7,10 +7,25 @@
|
||||
;; This minor mode highlights indentation levels via font-lock
|
||||
|
||||
(use-package highlight-indent-guides
|
||||
:ensure t
|
||||
:config
|
||||
(setq highlight-indent-guides-method 'character)
|
||||
;; Indent character samples: fill, column or character
|
||||
(setq highlight-indent-guides-method 'character))
|
||||
(setq highlight-indent-guides-responsive 'top)
|
||||
(setq highlight-indent-guides-delay 0.3)
|
||||
(setq highlight-indent-guides-character ?\|)
|
||||
(setq highlight-indent-guides-auto-odd-face-perc 15)
|
||||
(setq highlight-indent-guides-auto-even-face-perc 20)
|
||||
(setq highlight-indent-guides-auto-character-face-perc 30)
|
||||
(set-face-attribute 'highlight-indent-guides-character-face nil
|
||||
:background "rgba(136, 136, 136, 0.1)"))
|
||||
|
||||
(defun general-toggle-highlight-indent-guides ()
|
||||
(interactive)
|
||||
(if (bound-and-true-p highlight-indent-guides-mode)
|
||||
(highlight-indent-guides-mode -1)
|
||||
(highlight-indent-guides-mode 1)))
|
||||
|
||||
(global-set-key (kbd "<f7>") 'general-toggle-highlight-indent-guides)
|
||||
|
||||
(provide 'init-indent-guides)
|
||||
|
||||
|
@ -29,6 +29,14 @@
|
||||
(ivy-set-display-transformer 'ivy-switch-buffer
|
||||
'ivy-rich-switch-buffer-transformer))
|
||||
|
||||
;; hydra
|
||||
(use-package hydra
|
||||
:pin "MELPA"
|
||||
:config (hydra-add-font-lock))
|
||||
|
||||
(use-package ivy-hydra
|
||||
:pin "MELPA")
|
||||
|
||||
(use-package swiper
|
||||
:after ivy
|
||||
:bind (("C-s" . swiper)
|
||||
|
@ -7,46 +7,36 @@
|
||||
;; js2-mode: enhanced JavaScript editing mode
|
||||
;; https://github.com/mooz/js2-mode
|
||||
(use-package js2-mode
|
||||
:mode (("\\.js$" . js2-mode))
|
||||
:hook ((js2-mode . (lambda ()
|
||||
(flycheck-mode)
|
||||
(company-mode))))
|
||||
:config
|
||||
;; have 4 space indentation by default
|
||||
(setq js-indent-level 4
|
||||
js2-basic-offset 4
|
||||
js-chain-indent t)
|
||||
|
||||
;; use eslint_d insetad of eslint for faster linting
|
||||
(setq flycheck-javascript-eslint-executable "eslint_d")
|
||||
|
||||
;; Try to highlight most ECMA built-ins
|
||||
(setq js2-highlight-level 3)
|
||||
|
||||
;; turn off all warnings in js2-mode
|
||||
(setq js2-mode-show-parse-errors t)
|
||||
(setq js2-mode-show-strict-warnings nil)
|
||||
(setq js2-strict-missing-semi-warning nil))
|
||||
|
||||
;; hydra
|
||||
(use-package hydra
|
||||
:ensure t
|
||||
:pin "MELPA"
|
||||
:config (hydra-add-font-lock))
|
||||
|
||||
(use-package ivy-hydra
|
||||
:pin "MELPA")
|
||||
:mode ("\\.js\\'" . js2-mode)
|
||||
:hook (js2-mode . company-mode)
|
||||
:custom
|
||||
(js2-include-node-externs t)
|
||||
(js2-global-externs '("customElements"))
|
||||
(js2-highlight-level 3)
|
||||
(js2r-prefer-let-over-var t)
|
||||
(js2r-preferred-quote-type 2)
|
||||
(js-indent-align-list-continuation t)
|
||||
:config
|
||||
(setq-default flycheck-javascript-eslint-executable "eslint_d")
|
||||
(setq js-indent-level 2)
|
||||
(advice-add #'js2-identifier-start-p
|
||||
:after-until
|
||||
(lambda (c) (eq c ?#))))
|
||||
|
||||
;; js2-refactor: refactoring options for emacs
|
||||
;; https://github.com/magnars/js2-refactor.el
|
||||
(use-package js2-refactor
|
||||
:pin "MELPA"
|
||||
:after js2-mode
|
||||
:bind
|
||||
(:map js2-mode-map
|
||||
("C-k" . js2r-kill)
|
||||
("C-c h r" . js2-refactor-hydra/body))
|
||||
:hook ((js2-mode . js2-refactor-mode))
|
||||
:config (js2r-add-keybindings-with-prefix "C-c C-r")
|
||||
:hook (js2-mode . js2-refactor-mode)
|
||||
:config
|
||||
;; Add keybindings for js2-refactor with prefix "C-c C-r".
|
||||
(js2r-add-keybindings-with-prefix "C-c C-r")
|
||||
;; Assign keybindings to kill an element in js2 and to open the js2-refactor's hydra menu.
|
||||
(bind-key "C-k" 'js2r-kill js2-mode-map)
|
||||
(bind-key "C-c h r" 'js2-refactor-hydra/body js2-mode-map)
|
||||
|
||||
(defhydra js2-refactor-hydra (:color blue :hint nil)
|
||||
"
|
||||
@ -87,54 +77,33 @@
|
||||
("k" js2r-kill)
|
||||
("q" nil)))
|
||||
|
||||
;; json-snatcher: get the path of any JSON element easily
|
||||
;; https://github.com/Sterlingg/json-snatcher
|
||||
(use-package json-snatcher
|
||||
:hook ((json-mode . js-mode-bindings))
|
||||
:config
|
||||
(defun js-mode-bindings ()
|
||||
"Sets a hotkey for using the json-snatcher plugin"
|
||||
(when (string-match "\\.json$" (buffer-name))
|
||||
(local-set-key (kbd "C-c C-g") 'jsons-print-path))))
|
||||
|
||||
;; json-mode: Major mode for editing JSON files with emacs
|
||||
;; https://github.com/joshwnj/json-mode
|
||||
(use-package json-mode
|
||||
:mode "\\.js\\(?:on\\|[hl]int\\(rc\\)?\\)\\'"
|
||||
:config
|
||||
(add-hook 'json-mode-hook #'prettier-js-mode)
|
||||
(setq json-reformat:indent-width 2)
|
||||
(setq json-reformat:pretty-string? t)
|
||||
(setq js-indent-level 2))
|
||||
:ensure t
|
||||
:pin "MELPA"
|
||||
:mode ("\\.json\\'" "\\.jsonld\\'")
|
||||
:custom
|
||||
(json-reformat:indent-width 2)
|
||||
(json-reformat:pretty-string? t)
|
||||
(js-indent-level 2)
|
||||
:hook
|
||||
(json-mode . (lambda ()
|
||||
(add-hook 'before-save-hook 'json-mode-before-save nil t)
|
||||
(prettier-js-mode)))
|
||||
:bind
|
||||
(:map json-mode-map
|
||||
("C-c <tab>" . json-mode-beautify)))
|
||||
|
||||
(use-package prettier-js
|
||||
:pin "MELPA"
|
||||
:hook
|
||||
((js-mode typescript-mode css-mode scss-mode less-mode web-mode json-mode) . prettier-js-mode))
|
||||
|
||||
;; eslintd-fix: Emacs minor-mode to automatically fix javascript with eslint_d.
|
||||
;; https://github.com/aaronjensen/eslintd-fix/tree/master
|
||||
(use-package eslintd-fix)
|
||||
|
||||
;; rjsx-mode: A React JSX major mode for Emacs
|
||||
;; https://github.com/felipeochoa/rjsx-mode
|
||||
(use-package rjsx-mode
|
||||
:after js2-mode
|
||||
:mode (("\\.jsx$" . rjsx-mode)
|
||||
("components/.+\\.js$" . rjsx-mode))
|
||||
:hook (rjsx-mode . (lambda ()
|
||||
(flycheck-mode)
|
||||
(company-mode)
|
||||
(js2-refactor-mode -1)))
|
||||
:init
|
||||
(defun +javascript-jsx-file-p ()
|
||||
"Detect React or preact imports early in the file."
|
||||
(and buffer-file-name
|
||||
(string= (file-name-extension buffer-file-name) "js")
|
||||
(re-search-forward "\\(^\\s-*import +React\\|\\( from \\|require(\\)[\"']p?react\\)"
|
||||
magic-mode-regexp-match-limit t)
|
||||
(progn (goto-char (match-beginning 1))
|
||||
(not (when (and (require 'smartparens nil t)
|
||||
(fboundp sp-point-in-string-or-comment))
|
||||
)))))
|
||||
(add-to-list 'magic-mode-alist '(+javascript-jsx-file-p . rjsx-mode))
|
||||
:config (unbind-key "C-c C-l" rjsx-mode-map))
|
||||
|
||||
(provide 'init-js-two)
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (not free-vars)
|
||||
|
36
modules/init-linter.el
Normal file
36
modules/init-linter.el
Normal file
@ -0,0 +1,36 @@
|
||||
;;; init-linter.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;;---------------------------
|
||||
;; Lsp Mode
|
||||
;;---------------------------
|
||||
(use-package lsp-treemacs
|
||||
:config
|
||||
(lsp-treemacs-sync-mode 1))
|
||||
(use-package lsp-ui)
|
||||
(use-package lsp-mode
|
||||
:pin "MELPA"
|
||||
:hook ((lsp-mode . lsp-enable-which-key-integration))
|
||||
:custom
|
||||
(lsp-clients-angular-language-server-command
|
||||
'("node"
|
||||
(getenv "ANGULAR_SERVER_DIR")
|
||||
"--ngProbeLocations"
|
||||
(getenv "NODEJS_MODULE_DIR")
|
||||
"--tsProbeLocations"
|
||||
(getenv "NODEJS_MODULE_DIR")
|
||||
"--stdio"))
|
||||
(lsp-diagnostics-provider :none)
|
||||
:commands (lsp lsp-deferred))
|
||||
;; require install language server for Angular
|
||||
;; npm install -g @angular/language-service@next typescript @angular/language-server
|
||||
;; require install eslint for ReactJS
|
||||
;; npm install -g eslint
|
||||
(use-package dap-mode)
|
||||
|
||||
(provide 'init-linter)
|
||||
|
||||
;; End:
|
||||
;;; init-linter.el ends here
|
@ -1,52 +0,0 @@
|
||||
;;; init-nlinum.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Line numbers
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Linum snippets from: https://www.emacswiki.org/emacs/LineNumbers
|
||||
|
||||
(use-package linum
|
||||
:config
|
||||
(defun my-linum-get-format ()
|
||||
"Defines LINUM-GET-FORMAT"
|
||||
(let* ((width (1+ (length (number-to-string
|
||||
(count-lines (point-min) (point-max))))))
|
||||
(format (concat "%" (number-to-string width) "d \u2502")))
|
||||
(setq my-linum-format-string format)))
|
||||
(add-hook 'linum-before-numbering-hook 'my-linum-get-format)
|
||||
|
||||
(defun my-linum-format (line-number)
|
||||
"Defines LINE-FORMAT"
|
||||
(propertize (format my-linum-format-string line-number) 'face
|
||||
(if (eq line-number my-current-line)
|
||||
'my-linum-hl
|
||||
'linum)))
|
||||
(setq linum-format 'my-linum-format)
|
||||
|
||||
(defadvice linum-update (around my-linum-update)
|
||||
"Defines LINUM-UPDATE for update lines"
|
||||
(let ((my-current-line (line-number-at-pos)))
|
||||
ad-do-it))
|
||||
(ad-activate 'linum-update)
|
||||
|
||||
;; Colors line active
|
||||
;; set in file init-theme.el
|
||||
;; for example:
|
||||
;; (defface my-linum-hl
|
||||
;; '((t :background "gray20" :foreground "gold"))
|
||||
;; "Face for the currently active Line number"
|
||||
;; :group 'linum)
|
||||
;; )
|
||||
|
||||
:bind
|
||||
(([f6] . linum-mode)))
|
||||
|
||||
(provide 'init-linum)
|
||||
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (not free-vars)
|
||||
;; End:
|
||||
;;; init-linum.el ends here
|
12
modules/init-load-env-vars.el
Normal file
12
modules/init-load-env-vars.el
Normal file
@ -0,0 +1,12 @@
|
||||
;;; init-load-env-vars.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;; load-env-vars
|
||||
(use-package load-env-vars
|
||||
:config
|
||||
(load-env-vars "~/.emacs.d/.env"))
|
||||
|
||||
(provide 'init-load-env-vars)
|
||||
;;; init-load-env-vars.el ends here
|
11
modules/init-lua.el
Normal file
11
modules/init-lua.el
Normal file
@ -0,0 +1,11 @@
|
||||
;;; init-lua.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;; lua-mode
|
||||
(use-package lua-mode
|
||||
:mode ("\\.lual\\'" . lua-mode))
|
||||
|
||||
(provide 'init-lua)
|
||||
;;; init-lua.el ends here
|
@ -10,29 +10,9 @@
|
||||
:pin "MELPA"
|
||||
:ensure t
|
||||
:hook (after-init . doom-modeline-mode)
|
||||
:config (setq column-number-mode t)
|
||||
)
|
||||
|
||||
(use-package anzu
|
||||
:config
|
||||
(custom-set-variables
|
||||
'(anzu-search-threshold 1000)
|
||||
'(anzu-replace-threshold 1000)
|
||||
'(anzu-deactivate-region t)
|
||||
'(anzu-input-idle-delay 0.1)
|
||||
'(anzu-replace-to-string-separator " => "))
|
||||
(global-anzu-mode +1)
|
||||
(set-face-attribute 'anzu-mode-line nil
|
||||
:foreground "yellow" :weight 'bold)
|
||||
|
||||
(define-key isearch-mode-map [remap isearch-query-replace] #'anzu-isearch-query-replace)
|
||||
(define-key isearch-mode-map [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp)
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Keyboard shortcuts in Anzu Mode
|
||||
;;----------------------------------------------------------------------------
|
||||
(global-set-key (kbd "M-%") 'anzu-query-replace)
|
||||
(global-set-key (kbd "s-<SPC>") 'anzu-query-replace))
|
||||
|
||||
(provide 'init-modeline)
|
||||
|
||||
;; End:
|
||||
|
14
modules/init-ox-reveal.el
Normal file
14
modules/init-ox-reveal.el
Normal file
@ -0,0 +1,14 @@
|
||||
;;; init-ox-reveal.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;; ox-reveal
|
||||
(use-package ox-reveal
|
||||
:ensure ox-reveal
|
||||
:config
|
||||
(setq org-reveal-root (concat "file://" (getenv "REVEAL_JS_DIR")))
|
||||
(setq org-reveal-highlight-css (getenv "REVEAL_CSS_FILE"))
|
||||
(setq org-reveal-ignore-speaker-notes t))
|
||||
(provide 'init-ox-reveal)
|
||||
;;; init-ox-reveal.el ends here
|
@ -4,15 +4,18 @@
|
||||
|
||||
;;; Code:
|
||||
(use-package php-refactor-mode
|
||||
:pin "MELPA"
|
||||
:after (php-mode)
|
||||
:mode ("\\.php\\'" . php-mode)
|
||||
:hook
|
||||
(php-mode . php-refactor-mode))
|
||||
|
||||
(use-package php-mode
|
||||
:pin "MELPA"
|
||||
:ensure t)
|
||||
|
||||
(use-package company-php
|
||||
:pin "MELPA"
|
||||
:ensure t
|
||||
:config
|
||||
(defun cfg:php-mode-hook ()
|
||||
|
@ -5,6 +5,7 @@
|
||||
;;; Code:
|
||||
;; rainbow-mode
|
||||
(use-package rainbow-mode
|
||||
:pin "GNU ELPA"
|
||||
:hook
|
||||
(css-mode . rainbow-mode)
|
||||
(sass-mode . rainbow-mode)
|
||||
|
15
modules/init-restclient.el
Normal file
15
modules/init-restclient.el
Normal file
@ -0,0 +1,15 @@
|
||||
;;; init-restclient.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Restclient, similar to postman but in emacs
|
||||
;;----------------------------------------------------------------------------
|
||||
(use-package restclient
|
||||
:mode ("\\.http\\'" . restclient-mode))
|
||||
|
||||
(provide 'init-restclient)
|
||||
|
||||
;; End:
|
||||
;;; init-restclient.el ends here
|
12
modules/init-terraform.el
Normal file
12
modules/init-terraform.el
Normal file
@ -0,0 +1,12 @@
|
||||
;;; init-terraform.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;; yaml-mode
|
||||
(use-package terraform-mode
|
||||
:pin "MELPA"
|
||||
:mode ("\\.tf\\'" . terraform-mode))
|
||||
|
||||
(provide 'init-terraform)
|
||||
;;; init-terraform.el ends here
|
12
modules/init-typescript.el
Normal file
12
modules/init-typescript.el
Normal file
@ -0,0 +1,12 @@
|
||||
;;; init-typescript.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;; typescript-mode
|
||||
(use-package tide :ensure t)
|
||||
(use-package typescript-mode
|
||||
:mode ("\\.ts\\'" . typescript-mode))
|
||||
|
||||
(provide 'init-typescript)
|
||||
;;; init-typescript.el ends here
|
@ -3,15 +3,6 @@
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;; Loads functions from libs
|
||||
(defun load-directory (dir)
|
||||
"Load functions from the libs DIR.
|
||||
read the .el files"
|
||||
(let ((load-it (lambda (f)
|
||||
(load-file (concat (file-name-as-directory dir) f)))
|
||||
))
|
||||
(mapc load-it (directory-files dir nil "\\.el$"))))
|
||||
|
||||
;;------------------------------------------------------------------------------
|
||||
;; Sachachua
|
||||
;;------------------------------------------------------------------------------
|
||||
|
50
modules/init-vscode-theme.el
Normal file
50
modules/init-vscode-theme.el
Normal file
@ -0,0 +1,50 @@
|
||||
;;; init-vscode-theme.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package vscode-dark-plus-theme
|
||||
:pin "MELPA"
|
||||
:ensure t
|
||||
:config
|
||||
(load-theme 'vscode-dark-plus t)
|
||||
|
||||
(defun current-dark-color ()
|
||||
"Simple current-dark-color for theme."
|
||||
(set-cursor-color "#2979FF")
|
||||
(set-background-color "#1C1E1F")
|
||||
|
||||
;; highlight
|
||||
(set-face-foreground 'highlight "#F4F4F4")
|
||||
(set-face-background 'highlight "#004575")
|
||||
|
||||
;; Modeline
|
||||
(set-face-foreground 'mode-line "#FFFFFF")
|
||||
(set-face-foreground 'mode-line-inactive "#f4f4f4")
|
||||
(set-face-foreground 'mode-line-highlight "#f4f4f4")
|
||||
|
||||
(set-face-background 'mode-line "#6a157e")
|
||||
(set-face-background 'mode-line-inactive "#7B1FA2")
|
||||
|
||||
(set-face-background 'fringe nil)
|
||||
|
||||
;; Define a face for the current line number
|
||||
(defface my-line-number-current-line
|
||||
'((t :background "#007ACC" :foreground "#FFFFFF"))
|
||||
"Face for the currently active line number"
|
||||
:group 'display-line-numbers)
|
||||
|
||||
;; Set the face for the current line number
|
||||
(set-face-attribute 'line-number-current-line nil
|
||||
:background "#007ACC"
|
||||
:foreground "#FFFFFF")
|
||||
)
|
||||
|
||||
;; Invoke color
|
||||
(current-dark-color))
|
||||
|
||||
(provide 'init-vscode-theme)
|
||||
|
||||
;; End:
|
||||
;;; init-vscode-theme.el ends here
|
@ -13,6 +13,7 @@
|
||||
("\\.jsp\\'" . web-mode)
|
||||
("\\.gsp\\'" . web-mode)
|
||||
("\\.scss\\'" . web-mode)
|
||||
("\\.tsx\\'" . web-mode)
|
||||
("\\.ctp\\'" . web-mode))
|
||||
:config
|
||||
;; web-modeの設定
|
||||
|
@ -3,9 +3,8 @@
|
||||
;; custom settings!!!
|
||||
|
||||
;;; Code:
|
||||
(setq user-full-name "LibreUser.")
|
||||
(setq user-mail-address "name@domain.com")
|
||||
|
||||
(setq user-full-name (getenv "EMACS_USER"))
|
||||
(setq user-mail-address (getenv "EMACS_EMAIL"))
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (not free-vars)
|
||||
;; End:
|
||||
|
Loading…
x
Reference in New Issue
Block a user