Compare commits

...

104 Commits
0.1 ... master

Author SHA1 Message Date
c59fe9f0aa
workflows: set sourcehut like mirror 2024-08-08 03:24:29 +08:00
456d727429
Fix vscode-dark-plus-theme look 2024-05-20 03:40:50 +08:00
5eda7990e2
Remove unused packages 2024-05-19 11:33:49 +08:00
Jesus E
533ea6953f
Relax line guides 2023-07-03 13:34:09 -04:00
Jesus E
821b54fe2a
improve gui+ 2023-05-13 16:52:21 -04:00
Jesus E
749a1cb33f
add comments to init gui 2023-05-13 16:11:01 -04:00
Jesus E
c5f0d84689
improve dashboard 2023-05-13 15:40:16 -04:00
Jesus E
79cc50ce64
Remove unused lines comments 2023-05-13 14:10:49 -04:00
Jesus E
21f2cf3a08
improve init elpa 2023-05-13 14:10:28 -04:00
Jesus E
2e66e8893e
Fix mode js2-mode 2023-05-13 14:00:00 -04:00
Jesus E
af5244168e
Refactoring code 2023-05-13 01:52:06 -04:00
Jesus E
4ee79f3999
README.md: update 2023-05-13 01:23:54 -04:00
Jesus E
4efd474d08
Remove directory libs b'cause no exists 2023-05-13 01:22:05 -04:00
Jesus E
338cebea4b
Fix highlight indent guides 2023-05-13 01:20:11 -04:00
2a76be1a87
Set web browser from environment file 2022-10-18 10:03:12 +08:00
c4f5c73c0b
Update custom to current packages 2022-10-17 05:54:20 +08:00
d43f5f350a
Set vscode like default theme 2022-10-17 05:26:11 +08:00
b34a82ace3
Remove anzu from mode-line 2022-10-17 05:10:24 +08:00
66d2dafed2
Merge branch 'master' of ssh://c.hgit.ga/software/emacs-personal into master 2022-10-17 05:00:48 +08:00
9db58fdc7d
Add graphviz 2022-10-17 04:59:24 +08:00
4ef4959b4e
README.md: update 2022-10-15 01:50:17 +08:00
6ffb7fccc6
Add terraform module 2022-09-01 23:17:57 +08:00
Jesus
372ad6ff1f
README.md: update URL 2022-07-11 03:04:33 +08:00
6d5058644b
Fix path reveal.js 2022-05-05 07:31:25 +08:00
8d182df96e
add reveal.js 2022-05-05 06:57:57 +08:00
242f5ec765
Add restclient package 2022-03-07 01:24:28 +08:00
aba5e59b02
Add .env to custom configuration 2022-03-05 04:06:33 +08:00
3ddd2efd64
[.gitignore]: add snippets to ignore 2022-03-05 02:16:49 +08:00
f123b5adf9
minor fix 2022-01-17 15:11:14 -05:00
f9598f5872
init-linter: simple syntax 2022-01-17 14:12:33 -05:00
d486156ba8
relax flycheck 2022-01-16 22:01:53 -05:00
38e92905e3
Disable by default lsp
for enable please use:

M-x: lsp [RET]
2022-01-15 20:53:15 -05:00
91b3c8d6b8
Add missing prettier-js package 2022-01-15 20:44:54 -05:00
2cf8a7d6a6
init-linter: add doc 2022-01-15 19:36:37 -05:00
3eba90ddd7
hotfix lsp 2022-01-15 19:17:32 -05:00
19707ef86d
improve javascript mode 2022-01-15 16:41:20 -05:00
9c7add3600
Add performance read-process-output 2022-01-15 16:35:41 -05:00
466d3c4213
Add lsp-ui 2022-01-15 14:04:44 -05:00
46552ee63d
Add linter support 2022-01-15 13:43:57 -05:00
a066539b7f
Add tide 2022-01-15 13:41:40 -05:00
79b8ed5f81
Add .tsx extension to web-mode 2022-01-07 19:29:04 -05:00
524979eb11
Add typescript-mode 2022-01-07 19:02:27 -05:00
d2ddb582bd
stop create-lockfiles 2022-01-07 18:51:50 -05:00
8f826cb8a3
company: change to backtab
one of the reasons why some languages use <tab> for spacing and not autocomplete
2021-12-05 16:59:59 -05:00
f53864a714
company: prevent breaks ivy's completion in minibuffer 2021-12-05 16:41:35 -05:00
32ca324900
company-mode: change to ALT+TAB 2021-12-05 15:47:30 -05:00
cb2cb918df
Autocomplete: fix company 2021-12-03 17:21:19 -05:00
94d28d7a2d
simplify git-modes package 2021-11-02 22:59:22 -05:00
1c82edd5bb
fix missing packages
Error (use-package): Failed to install gitconfig-mode: Package ‘gitconfig-mode-’ is unavailable
Error (use-package): Failed to install gitignore-mode: Package ‘gitignore-mode-’ is unavailable
Error (use-package): Failed to install gitattributes-mode: Package ‘gitattributes-mode-’ is unavailable
2021-11-02 13:33:18 -05:00
9fd02a16f8
Add kbd for mc 2021-11-02 12:27:03 -05:00
085e476d0f
Merge branch 'master' of ssh://hgit/software/emacs-personal into master 2021-11-02 12:20:05 -05:00
e81308a39c
change sudo to doas for open file with root privileges 2021-11-02 12:19:54 -05:00
feb71536a7
Add lua language 2021-10-16 11:29:26 -05:00
5c590da187
Merge branch 'master' of ssh://hgit/software/emacs-personal into master 2021-10-14 22:36:46 -05:00
e8d4767adc
Update URL 2021-10-14 22:36:17 -05:00
3fe51a5a87
Enable editorconfig package 2021-07-08 14:40:58 -05:00
b4d28e2324
change to 2 spaces in javascript 2021-07-08 14:40:19 -05:00
94347e9e73
disable capitalize word (M-c) for default
by @saravia
2021-07-02 15:52:20 -05:00
6614195fd3
[README.md] update 2021-05-25 11:23:18 -05:00
3cace18a5a
[README.md] update 2021-05-25 11:21:09 -05:00
91d8471e42
Add dockerfile-mode 2021-02-28 22:02:50 -05:00
8ce00c8a0d
[README.md]: change URL repo 2021-02-21 15:32:51 -05:00
58cc480658
minor fix TLS in emacs 26.x 2021-02-07 16:22:46 -05:00
d590aa16a8
Add dashboard 2021-02-01 16:15:16 -05:00
e66773991b
improve speed 2021-02-01 16:14:38 -05:00
e07b3998a0
go to init.el and update custom.el 2021-01-23 11:13:52 -05:00
18d1f070a0
Add go support 2021-01-23 10:58:16 -05:00
594d61e319
Change to MELPA repo 2020-12-09 21:27:12 -05:00
8f5c76f5d7
Fix conditional version 2020-12-09 21:25:14 -05:00
5cb1c1bec5
update README.md 2020-12-09 21:23:58 -05:00
d6d36138cc
update README.md 2020-12-09 21:21:20 -05:00
a559c8e4e6
Fix repo for rainbow 2020-12-07 12:44:20 -05:00
db581097bb
Add line columns to modeline 2020-11-10 23:13:51 -05:00
3dfb64a1a1
update .gitignore 2020-11-10 21:18:46 -05:00
7feda7ff72
Fix algoritm version previous to 26.x 2020-08-06 11:45:42 -05:00
b2e3793228
update doc 2020-08-04 15:29:28 -05:00
9fbc82fd78
Fix TLS emacs 26.x 2020-08-04 15:21:59 -05:00
7733624f8d
Doc for fix elpa signature 2020-07-20 19:20:52 -05:00
cb7b574da7
remove deprecated variables
is deprecated in 23.2
2019-11-10 12:08:37 -05:00
25eae9a765
Remove eslint recomendation
eslint make-depends on npm and depends on acorn, [uses-nonsecurity] depends on nodejs
2019-11-07 10:51:33 -05:00
fbc03f3e4f
Fix typo 2019-11-06 17:36:22 -05:00
fe5a4720a3
update README.md 2019-11-06 17:26:12 -05:00
c3a5ae44b0
Refactoring and cleanup code
Linum-mode is disabled for default (can be activated with F6 key), and improves the handling of large files.
2019-11-06 17:20:55 -05:00
2de9f0c2ef
Fix git-diff 2019-10-26 19:25:56 -05:00
c5ff8b4056
Added 'sudo open file option' 2019-10-26 19:12:36 -05:00
f3d6ca2ac1
Merge branch 'master' of libregit.org:heckyel/emacs-personal 2019-10-26 19:06:03 -05:00
b40b52e81e
Set Default Browser 2019-10-26 19:05:08 -05:00
5ec65a9513
improve README.md 2019-10-05 12:37:06 -05:00
a6c87e002d
Fixed signature 'Failed to download ‘GNU ELPA’ archive' closed #14 2019-10-05 12:34:45 -05:00
5f1c2fbc10
Fix: Emacs: Lisp error: (error "Invalid face" modeline) 2019-09-20 15:36:06 -05:00
b919cdf1d2
semi-dark-theme for default 2019-09-18 00:20:34 -05:00
2393b459e6
Added dark theme 2019-09-17 23:09:24 -05:00
53c9235cbe
improve colors 2019-09-17 17:05:51 -05:00
9f33cc5355
disable undo-tree-visualizer-diff 2019-09-17 14:58:46 -05:00
37a0cf57da
Markdown from MELPA 2019-09-17 14:52:54 -05:00
7b4bedd58b
Suppressing ad-handle-definition Warnings in Emacs
I looked into it and these warnings are generated when functions are redefined with defadvice.
Most of the warnings I received were coming from third-party packages I had installed,
not my own configuration. In any case, they were not helpful, just noise during Emacs startup.
2019-09-17 14:51:26 -05:00
0a423ad056
Update README.md 2019-09-17 12:56:01 -05:00
6b644ebb3b
Improve theme colors 2019-09-17 12:55:02 -05:00
f0633f08d4
Change URL to https 2019-09-15 23:35:04 -05:00
c12ccfb078
Fix neo-smart-open duplicate 2019-09-15 20:15:48 -05:00
0c04e666cb
Updated comands 2019-09-15 17:00:20 -05:00
868b60b240
Updated README.md 2019-09-15 16:58:00 -05:00
8a14e0a584
Remove ECB 2019-09-15 16:48:01 -05:00
7fd29e9a60
remove sublime-themes to doom-themes 2019-09-15 16:35:04 -05:00
40 changed files with 669 additions and 533 deletions

13
.env.example Normal file
View 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"

View 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
View File

@ -5,9 +5,12 @@
.cache/ .cache/
.litable-lists.el .litable-lists.el
.org-id-locations .org-id-locations
.lsp-session-v1
.dap-breakpoints
.session .session
.smex-items .smex-items
*.eld *.eld
.env
*~ *~
/.mc-lists.el /.mc-lists.el
\#*\# \#*\#
@ -24,6 +27,7 @@ projectile*
recentf recentf
session* session*
smex-items smex-items
snippets/
srecode-map.el srecode-map.el
tramp tramp
transient/ transient/
@ -33,3 +37,4 @@ vendor/
### Python Virtual ### ### Python Virtual ###
.python-environments/ .python-environments/
elpy/

115
README.md
View File

@ -1,66 +1,133 @@
<p align="center">
<a href="http://www.gnu.org/licenses/gpl-3.0.txt">
<img src="https://img.shields.io/badge/license-GPL_3-green.svg" alt="License GPL 3" />
</a>
</p>
<h1 align="center">emacs-personal</h1> <h1 align="center">emacs-personal</h1>
Lightweight configuration of emacs with basic utilities plus personal configuration Lightweight configuration of emacs with basic utilities plus personal configuration
![emacs-personal](https://archive.org/download/libreweb/emacs-personal.png?raw=true "emacs-personal") ![emacs-personal](https://archive.org/download/libreweb/emacs-personal-1.1.png?raw=true "emacs-personal")
### Installation ### Installation
First step:
M-x package-refresh-contents [RET]
#### Main mirror #### Main mirror
1. `git clone https://libregit.org/heckyel/emacs-personal.git ~/.emacs.d/` 1. `git clone https://c.fridu.us/software/emacs-personal.git ~/.emacs.d/`
2. `cp -v ~/.emacs.d/.env.example ~/.emacs.d/.env`
2. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'` 3. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'`
#### Secundary mirror #### 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 ### Fonts
change the typography in the [init-gui.el](modules/init-gui.el#L54) file
`pacman -S ttf-hack` (for default) ### Icons
`pacman -S ttf-anonymous-pro` ```console
$ emacs --batch --eval="(progn (package-initialize)(package-install 'all-the-icons))"
> change the typography in the [init-gui.el](modules/init-gui.el#L54) file ```
### Markdown Mode ### Markdown Mode
- Require installed markdown in distro GNU+Linux, example:
`apt-get 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 ### Flycheck Mode
- Require installed the languages checking, example: - Require installed the languages checking, example:
`pacman -S shellcheck` # bash, sh #### bash, sh
`pacman -S eslint` # ECMAScript ```console
$ pacman -S shellcheck
```
`pacman -S python-pylint` # python #### python
```console
$ pacman -S python-pylint
```
### Neotree ### Neotree
Neotree comes by default in combination with all-the-icons. Neotree comes by default in combination with all-the-icons.
So pressing `[f8]` will display (you must give "yes") a one-time screen to install all-the-icons fonts. So pressing `[f8]` will display (you must give "yes") a one-time screen to install all-the-icons fonts.
### Linum
So pressing `[f6]` will display
### Mode Python ### Mode Python
- Require installed virtualenv: - Require installed virtualenv:
pacman -S python-virtualenv $ pacman -S python-virtualenv
- Enable or disable pyvenv-mode: <kdb>M-x</kdb> pyvenv-mode - Enable or disable pyvenv-mode: <kdb>M-x</kdb> pyvenv-mode
- To create virtualenv from emacs: - To create virtualenv from emacs:
pyvenv-create $ pyvenv-create
- To activate virtualenv from emacs: - To activate virtualenv from emacs:
pyvenv-activate $ pyvenv-activate
## Troubleshooting
```bash
Failed to verify signature archive-contents.sig:
No public key for 066DAFCB81E42C40 created at 2019-10-05T04:10:02-0500 using RSA
Command output:
gpg: Firmado el sáb 05 oct 2019 04:10:02 -05
gpg: usando RSA clave C433554766D3DDC64221BFAA066DAFCB81E42C40
gpg: Imposible comprobar la firma: No public key
```
### Method 0
```console
$ gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
```
### Method 1
Disable temp signature key
```console
$ sed -i "s|(setq package-check-signature 'allow-unsigned)|(setq package-check-signature nil)|g" "$HOME/.emacs.d/init.el"
```
```console
M-x package-install RET gnu-elpa-keyring-update RET
```
and enable signature key
```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>

View File

@ -3,15 +3,8 @@
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; 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)
'(ecb-options-version "2.50")
'(package-selected-packages '(package-selected-packages
(quote '(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)))
(git-gutter-fringe yaml-mode whitespace-cleanup-mode which-key web-mode vue-mode use-package undo-tree sublime-themes sml-modeline smartparens smart-mode-line-powerline-theme shrink-path 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 ecb dotenv-mode dokuwiki-mode diminish crystal-mode counsel company-quickhelp company-php apache-mode anzu all-the-icons))))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.

104
init.el
View File

@ -7,52 +7,52 @@
;; Without this comment emacs25 adds (package-initialize) here ;; Without this comment emacs25 adds (package-initialize) here
;; (package-initialize) ;; (package-initialize)
(let* ((minver "24.4")) ;;; Time Mark
(when (version< emacs-version minver) (setq emacs-load-start-time (current-time))
(error "Emacs v%s or higher is required" minver)))
(setq package-check-signature 'allow-unsigned)
;;; Fix TLS emacs 26.x
(if (version<= emacs-version "26.2")
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
;;; Welcome message ;;; Welcome message
(setq-default initial-scratch-message (setq-default initial-scratch-message
(concat ";; Happy hacking, " user-login-name " - Emacs loves you!\n\n")) (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 ;;; Modules directory
(push (concat user-emacs-directory "modules") load-path) (push (concat user-emacs-directory "modules") load-path)
;;; Raise garbage collection threshold after init
(defvar best-gc-cons-threshold
4000000
"Best default gc threshold value. Should NOT be too big!")
;; don't GC during startup to save time
(setq gc-cons-threshold most-positive-fixnum)
(setq emacs-load-start-time (current-time))
;;----------------------------------------------------------------------------
;; Which functionality to enable (use t or nil for true and false)
;;----------------------------------------------------------------------------
(setq *is-a-mac* (eq system-type 'darwin))
(setq *win64* (eq system-type 'windows-nt))
(setq *cygwin* (eq system-type 'cygwin) )
(setq *linux* (or (eq system-type 'gnu/linux) (eq system-type 'linux)) )
(setq *unix* (or *linux* (eq system-type 'usg-unix-v) (eq system-type 'berkeley-unix)) )
(setq *emacs24* (>= emacs-major-version 24))
(setq *emacs25* (>= emacs-major-version 25))
(setq *emacs26* (>= emacs-major-version 26))
(setq *no-memory* (cond
(*is-a-mac*
(< (string-to-number (nth 1 (split-string (shell-command-to-string "sysctl hw.physmem")))) 4000000000))
(*linux* nil)
(t nil)))
;; @see https://www.reddit.com/r/emacs/comments/55ork0/is_emacs_251_noticeably_slower_than_245_on_windows/
;; Emacs 25 does gc too frequently
(when *emacs25*
;; (setq garbage-collection-messages t) ; for debug
(setq best-gc-cons-threshold (* 64 1024 1024))
(setq gc-cons-percentage 0.5)
(run-with-idle-timer 5 t #'garbage-collect))
;;;------------------------------ ;;;------------------------------
;;; Features ;;; Features
;;;------------------------------ ;;;------------------------------
@ -70,19 +70,19 @@
(require 'init-security) (require 'init-security)
(require 'init-elpa) (require 'init-elpa)
;; theme ;; theme
(require 'init-theme) ;; (require 'init-doom-theme)
(require 'init-vscode-theme)
;; Utils ;; Utils
(require 'init-utils) (require 'init-utils)
;; GUI ;; GUI
(require 'init-nlinum)
(require 'init-gui) (require 'init-gui)
(require 'init-editing-utils) (require 'init-editing-utils)
(require 'init-diminish) (require 'init-diminish)
(require 'init-ecb)
(require 'init-modeline) (require 'init-modeline)
(require 'init-indent-guides) (require 'init-indent-guides)
(require 'init-icons) (require 'init-icons)
(require 'init-neotree) (require 'init-neotree)
(require 'init-dashboard)
;; Tools ;; Tools
(require 'init-apache) (require 'init-apache)
(require 'init-company) (require 'init-company)
@ -92,29 +92,38 @@
(require 'init-whitespace) (require 'init-whitespace)
(require 'init-emmet-mode) (require 'init-emmet-mode)
(require 'init-nginx) (require 'init-nginx)
(require 'init-git) (require 'init-editorconfig)
;;(require 'init-editorconfig nil 'noerror)
;; Languages ;; Languages
(require 'init-ccc) (require 'init-ccc)
(require 'init-crystal) (require 'init-crystal)
(require 'init-html) (require 'init-html)
(require 'init-js-two) (require 'init-js-two)
(require 'init-markdown) (require 'init-markdown)
(require 'init-go)
(require 'init-php) (require 'init-php)
(require 'init-projectile) (require 'init-projectile)
(require 'init-python) (require 'init-python)
(require 'init-pkgbuild) (require 'init-pkgbuild)
(require 'init-less) (require 'init-less)
(require 'init-lua)
(require 'init-smartparens) (require 'init-smartparens)
(require 'init-sass) (require 'init-sass)
(require 'init-scss) (require 'init-scss)
(require 'init-typescript)
(require 'init-vue) (require 'init-vue)
(require 'init-yaml) (require 'init-yaml)
;; Plus ;; Plus
(require 'init-rainbow) (require 'init-rainbow)
(require 'init-web-mode) (require 'init-web-mode)
(require 'init-dotenv) (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 ;;; Custom variables
(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
@ -128,13 +137,6 @@
(when (file-exists-p custom-file) (when (file-exists-p custom-file)
(load settings-file)) (load settings-file))
(setq gc-cons-threshold best-gc-cons-threshold)
(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 ;; enable erase-buffer command
(put 'erase-buffer 'disabled nil) (put 'erase-buffer 'disabled nil)

View File

@ -2,14 +2,18 @@
;;; Commentary: ;;; Commentary:
;; Company es un famework de Emacs para el completado de texto. ;; Company es un famework de Emacs para el completado de texto.
;;; CODE: ;;; code:
(use-package company (use-package company
:ensure t :defer 5
:diminish
:bind
(:map company-mode-map
("<backtab>" . company-complete))
:config :config
;; Global ;; Global
(setq company-idle-delay 1 (setq company-idle-delay 1
company-minimum-prefix-length 1 company-minimum-prefix-length 1
company-show-numbers t company-show-numbers nil
company-tooltip-limit 20) company-tooltip-limit 20)
;; Facing ;; Facing
@ -21,9 +25,6 @@
(set-face-attribute 'company-scrollbar-bg nil :inherit 'company-tooltip :background "gray20") (set-face-attribute 'company-scrollbar-bg nil :inherit 'company-tooltip :background "gray20")
(set-face-attribute 'company-scrollbar-fg nil :background "gray40")) (set-face-attribute 'company-scrollbar-fg nil :background "gray40"))
;; Default backends
(setq company-backends '((company-files)))
;; Activating globally ;; Activating globally
(global-company-mode t)) (global-company-mode t))

39
modules/init-dashboard.el Normal file
View 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

View 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

View File

@ -0,0 +1,80 @@
;;; init-doom-theme.el --- .Emacs Configuration -*- lexical-binding: t -*-
;;; Commentary:
;;
;;; Code:
(use-package doom-themes
:pin "MELPA"
:ensure t
:bind
(("C-x t d" . dark-theme)
("C-x t s" . semi-dark-theme)
("C-x t l" . light-theme))
:init
(defun light-theme ()
"Activate light colortheme"
(interactive)
(load-theme 'doom-one-light)
(delete-selection-mode 1))
(defun dark-theme ()
"Activate dark colortheme"
(interactive)
(load-theme 'doom-molokai)
(delete-selection-mode 1)
;; Invoke customcolors
(darkcolor))
(defun semi-dark-theme ()
"Activate semi-dark colortheme"
(interactive)
(load-theme 'doom-molokai)
(delete-selection-mode 1)
;; Invoke customcolors
(semidarkcolor))
;; Invoke theme
(load-theme 'doom-molokai t)
:config
(defun darkcolor ()
"Simple dark for theme."
(set-cursor-color "#2979FF")
(set-face-background 'highlight "#2979FF")
(set-background-color "#101418")
;; Modeline
(set-face-background 'mode-line "#0C0E10")
(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))
(defun semidarkcolor ()
"Simple semidarkcolor for theme."
(set-cursor-color "#2979FF")
(set-face-background 'highlight "#2979FF")
(set-background-color "#1C1E1F")
;; Modeline
(set-face-background 'mode-line "#2D2E2E")
(set-face-background 'mode-line-inactive "#333333")
;; (set-face-foreground 'mode-line "#FFFFFF")
;; Fix linum current-line highlight
(defface my-linum-hl
'((t :background "gray20" :foreground "gold"))
"Face for the currently active Line number"
:group 'linum))
;; Invoke color
(semidarkcolor))
(provide 'init-doom-theme)
;;; init-doom-theme.el ends here

View File

@ -1,34 +0,0 @@
;;; init-ecb.el --- .Emacs Configuration -*- lexical-binding: t -*-
;;; Commentary:
;;
;;; Code:
;;----------------------------------------------------------------------------
;; ECB
;;----------------------------------------------------------------------------
(use-package ecb
:config
(custom-set-variables '(ecb-options-version "2.50"))
(setq-default ecb-tip-of-the-day nil)
(setq ecb-examples-bufferinfo-buffer-name nil)
(defun ecb-toggle ()
"Toogle ECB."
(interactive)
(eval-when-compile (require 'ecb nil t))
(when (and (require 'ecb nil t)
(fboundp 'ecb-deactivate))
(if ecb-minor-mode
(ecb-deactivate)
(ecb-activate))))
(global-set-key [f2] 'ecb-toggle)
)
(provide 'init-ecb)
;; Local Variables:
;; byte-compile-warnings: (not free-vars)
;; End:
;;; init-ecb.el ends here

View File

@ -77,7 +77,7 @@
ad-do-it)) ad-do-it))
(setf undo-tree-visualizer-timestamps t) (setf undo-tree-visualizer-timestamps t)
(setf undo-tree-visualizer-diff t) (setf undo-tree-visualizer-diff nil)
(setf undo-tree-auto-save-history nil) ;; no salva el historial de cambios (setf undo-tree-auto-save-history nil) ;; no salva el historial de cambios
:config :config

View File

@ -7,6 +7,7 @@
;; EditorConfig ;; EditorConfig
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
(use-package editorconfig (use-package editorconfig
:ensure t
:config :config
(when (and (require 'editorconfig nil t) (when (and (require 'editorconfig nil t)
(fboundp 'editorconfig-mode)) (fboundp 'editorconfig-mode))

View File

@ -20,16 +20,19 @@
'(("MELPA Stable" . 10) '(("MELPA Stable" . 10)
("GNU ELPA" . 5) ("GNU ELPA" . 5)
("ORG" . 3) ("ORG" . 3)
("MELPA" . 0))) ("MELPA" . 0))
package-enable-at-startup nil)
;; ================= ;; =================
(setq package-native-compile t)
(package-initialize) (package-initialize)
(unless (package-installed-p 'use-package) (unless (package-installed-p 'use-package)
(package-refresh-contents) (package-refresh-contents)
(package-install 'use-package)) (package-install 'use-package))
(require 'use-package) (eval-when-compile
(require 'use-package))
(setq use-package-always-ensure t) (setq use-package-always-ensure t)
;; ===================================================== ;; =====================================================
;; End use-package ;; End use-package

View File

@ -17,15 +17,19 @@
:modes (php-mode php+-mode web-mode)) :modes (php-mode php+-mode web-mode))
(add-to-list 'flycheck-checkers 'mix-php) (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 ;; Enable for only languages
:hook :hook
(c++-mode . flycheck-mode) (c++-mode . flycheck-mode)
;; (emacs-lisp-mode flycheck-mode) ;; (emacs-lisp-mode flycheck-mode)
(html-mode . flycheck-mode) (html-mode . flycheck-mode)
(js-mode . flycheck-mode) (js-mode . flycheck-mode)
(python-mode . flycheck-mode) (python-mode . flycheck-mode)
(web-mode . flycheck-mode) (web-mode . flycheck-mode)
(sh-mode . flycheck-mode)) (sh-mode . flycheck-mode))
(provide 'init-flycheck) (provide 'init-flycheck)

View File

@ -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 t)
(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
View 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
View 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

View File

@ -15,19 +15,25 @@
(menu-bar-mode 0) (menu-bar-mode 0)
(setq make-backup-files nil) ; stop creating backup~ files (setq make-backup-files nil) ; stop creating backup~ files
(setq auto-save-default nil) ; stop creating #autosave# 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 ;; Core settings | UTF-8 please
;;------------------------------ ;;------------------------------
;; Set Unicode character priority
(set-charset-priority 'unicode) (set-charset-priority 'unicode)
;; Set language environment to UTF-8
(set-language-environment "UTF-8") (set-language-environment "UTF-8")
(set-terminal-coding-system 'utf-8) ; pretty ;; Set terminal coding system to UTF-8
(set-keyboard-coding-system 'utf-8) ; pretty (set-terminal-coding-system 'utf-8)
(set-selection-coding-system 'utf-8) ; please ;; Set keyboard coding system to UTF-8
(prefer-coding-system 'utf-8) ; with sugar on top (set-keyboard-coding-system 'utf-8)
(setq locale-coding-system 'utf-8) ; pretty ;; Set selection coding system to UTF-8
(setq default-process-coding-system '(utf-8-unix . utf-8-unix)) (set-selection-coding-system 'utf-8)
(setq-default buffer-file-coding-system 'utf-8-auto-unix) ;; Prefer UTF-8 coding system
(prefer-coding-system 'utf-8)
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; Editor configuration ;; Editor configuration
@ -48,13 +54,10 @@
(lambda () (lambda ()
(setq line-spacing 0))) (setq line-spacing 0)))
;; Font theme (Monospace, or DejaVu Sans Mono if Monospace is not ;; Font theme (DejaVu Sans Mono if Hack isn't present)
;; present) (if (member "Hack" (font-family-list))
(condition-case nil
(set-frame-font "Hack-9") (set-frame-font "Hack-9")
;; (set-frame-font "Monospace-9") (set-frame-font "DejaVu Sans Mono-10"))
;; (set-frame-font "Anonymous Pro-10")
(error (set-frame-font "DejaVu Sans Mono-10")))
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; Configure keys ;; Configure keys
@ -65,6 +68,12 @@
(global-set-key (kbd "s-C--") 'sacha/decrease-font-size) ; C-- decrease font size (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 "<f12>") 'revert-buffer-no-confirm)
(global-set-key (kbd "s-h") 'global-hl-line-mode) ; Highlight current line (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 ;; FullScreen
@ -76,6 +85,21 @@
'(2 "_NET_WM_STATE_FULLSCREEN" 0))) '(2 "_NET_WM_STATE_FULLSCREEN" 0)))
(global-set-key (kbd "<f11>") 'myemacs/toggle-fullscreen) ; F11 FullScreen (global-set-key (kbd "<f11>") 'myemacs/toggle-fullscreen) ; F11 FullScreen
;;----------------------------------------------------------------------------
;; Define custom browser
;;----------------------------------------------------------------------------
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program (getenv "WEB_BROWSER_APP"))
;;----------------------------------------------------------------------------
;; doas open file option
;;----------------------------------------------------------------------------
(defun doas-find-file (file-name)
"Like find file, but opens the file as root."
(interactive "FDoas Find File: ")
(let ((tramp-file-name (concat "/doas::" (expand-file-name file-name))))
(find-file tramp-file-name)))
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; clock ;; clock
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------

View File

@ -7,10 +7,25 @@
;; This minor mode highlights indentation levels via font-lock ;; This minor mode highlights indentation levels via font-lock
(use-package highlight-indent-guides (use-package highlight-indent-guides
:ensure t
:config :config
(setq highlight-indent-guides-method 'character) (setq highlight-indent-guides-method 'character)
;; Indent character samples: fill, column or character (setq highlight-indent-guides-responsive 'top)
(setq highlight-indent-guides-method 'character)) (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) (provide 'init-indent-guides)

View File

@ -29,6 +29,14 @@
(ivy-set-display-transformer 'ivy-switch-buffer (ivy-set-display-transformer 'ivy-switch-buffer
'ivy-rich-switch-buffer-transformer)) '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 (use-package swiper
:after ivy :after ivy
:bind (("C-s" . swiper) :bind (("C-s" . swiper)

View File

@ -7,46 +7,36 @@
;; js2-mode: enhanced JavaScript editing mode ;; js2-mode: enhanced JavaScript editing mode
;; https://github.com/mooz/js2-mode ;; https://github.com/mooz/js2-mode
(use-package js2-mode (use-package js2-mode
:mode (("\\.js$" . js2-mode)) :ensure t
: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
:pin "MELPA" :pin "MELPA"
:config (hydra-add-font-lock)) :mode ("\\.js\\'" . js2-mode)
:hook (js2-mode . company-mode)
(use-package ivy-hydra :custom
:pin "MELPA") (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 ;; js2-refactor: refactoring options for emacs
;; https://github.com/magnars/js2-refactor.el ;; https://github.com/magnars/js2-refactor.el
(use-package js2-refactor (use-package js2-refactor
:pin "MELPA" :pin "MELPA"
:after js2-mode :after js2-mode
:bind :hook (js2-mode . js2-refactor-mode)
(:map js2-mode-map :config
("C-k" . js2r-kill) ;; Add keybindings for js2-refactor with prefix "C-c C-r".
("C-c h r" . js2-refactor-hydra/body)) (js2r-add-keybindings-with-prefix "C-c C-r")
:hook ((js2-mode . js2-refactor-mode)) ;; Assign keybindings to kill an element in js2 and to open the js2-refactor's hydra menu.
:config (js2r-add-keybindings-with-prefix "C-c C-r") (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) (defhydra js2-refactor-hydra (:color blue :hint nil)
" "
@ -87,54 +77,33 @@
("k" js2r-kill) ("k" js2r-kill)
("q" nil))) ("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 ;; json-mode: Major mode for editing JSON files with emacs
;; https://github.com/joshwnj/json-mode ;; https://github.com/joshwnj/json-mode
(use-package json-mode (use-package json-mode
:mode "\\.js\\(?:on\\|[hl]int\\(rc\\)?\\)\\'" :ensure t
:config :pin "MELPA"
(add-hook 'json-mode-hook #'prettier-js-mode) :mode ("\\.json\\'" "\\.jsonld\\'")
(setq json-reformat:indent-width 2) :custom
(setq json-reformat:pretty-string? t) (json-reformat:indent-width 2)
(setq js-indent-level 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. ;; eslintd-fix: Emacs minor-mode to automatically fix javascript with eslint_d.
;; https://github.com/aaronjensen/eslintd-fix/tree/master ;; https://github.com/aaronjensen/eslintd-fix/tree/master
(use-package eslintd-fix) (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) (provide 'init-js-two)
;; Local Variables: ;; Local Variables:
;; byte-compile-warnings: (not free-vars) ;; byte-compile-warnings: (not free-vars)

36
modules/init-linter.el Normal file
View 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

View 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
View 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

View File

@ -4,6 +4,7 @@
;;; Code: ;;; Code:
(use-package markdown-mode (use-package markdown-mode
:pin "MELPA"
:mode (("\\.markdown\\'" . markdown-mode) :mode (("\\.markdown\\'" . markdown-mode)
("\\.md\\'" . markdown-mode)) ("\\.md\\'" . markdown-mode))
@ -30,16 +31,7 @@
(goto-char (point-max)) (goto-char (point-max))
(insert "\n" (insert "\n"
"</body>\n" "</body>\n"
"</html>\n")) "</html>\n")))
;;----------------------------------------------------------------------------
;; Define custom browser
;;----------------------------------------------------------------------------
(defvar browse-url-generic-program)
(setq browse-url-generic-program "iceweasel-uxp")
(defadvice markdown-preview (around markdown-preview-in-generic activate compile)
(let ((browse-url-browser-function #'browse-url-generic))
ad-do-it)))
(provide 'init-markdown) (provide 'init-markdown)

View File

@ -6,47 +6,12 @@
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; Modeline configuration ;; Modeline configuration
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
(use-package doom-modeline
(use-package smart-mode-line
:pin "MELPA")
(use-package smart-mode-line-powerline-theme
:pin "MELPA")
(use-package sml-modeline
:pin "MELPA" :pin "MELPA"
:config :ensure t
;; Show number of occurrences when searching :hook (after-init . doom-modeline-mode)
(setq sml/theme 'powerline) :config (setq column-number-mode t)
)
(setq sml/no-confirm-load-theme t)
(setq sml/shorten-modes t)
;; Show EOL mode
(setq sml/show-eol t)
;; Show remote buffers
(setq sml/show-remote t)
(sml/setup)
(sml-modeline-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) (provide 'init-modeline)

View File

@ -81,8 +81,7 @@
(ignore-errors (ignore-errors
;;; Pick one: projectile or find-file-in-project ;;; Pick one: projectile or find-file-in-project
(projectile-project-root))) (projectile-project-root)))
(file-name (buffer-file-name)) (file-name (buffer-file-name)))
(neo-smart-open t))
(if (and (fboundp 'neo-global--window-exists-p) (if (and (fboundp 'neo-global--window-exists-p)
(neo-global--window-exists-p)) (neo-global--window-exists-p))
(neotree-hide) (neotree-hide)

View File

@ -1,118 +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 nlinum
:config
(add-hook 'find-file-hook (lambda () (linum-mode 1)))
(setq global-linum-mode t)
)
(use-package linum
:config
(linum-mode 1)
:hook
(apache-mode . linum-mode)
(c-mode . linum-mode)
(c++-mode . linum-mode)
(elisp-mode . linum-mode)
(html-mode . linum-mode)
(js-mode . linum-mode)
(js2-mode . linum-mode)
(less-mode . linum-mode)
(markdown-mode . linum-mode)
(nginx-mode . linum-mode)
(php-mode . linum-mode)
(scss-mode . linum-mode)
(sass-mode . linum-mode)
(web-mode . linum-mode))
(defun my-linum-get-format-string ()
"Format the string of the column in the buffer.
It helps to show the numbering plus a separation bar."
(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-string)
(defvar my-linum-current-line-number 0)
(defun my-linum-format (line-number)
"Defines LINE-NUMBER the numbering format of each.
this helps maintain the format in the numbering"
(propertize (format my-linum-format-string line-number) 'face
(if (eq line-number my-linum-current-line-number)
'my-linum-hl
'linum)))
(setq linum-format 'my-linum-format)
(defadvice linum-update (around my-linum-update)
"Defines LINUM-UPDATE for update lines.
this helps maintain the format in the numbering"
(let ((my-linum-current-line-number (line-number-at-pos)))
ad-do-it))
(ad-activate 'linum-update)
(defvar *linum-mdown-line* nil)
(defun line-at-click ()
"Funtions for position lines.
this helps maintain the move visual."
(save-excursion
(let ((click-y (cdr (cdr (mouse-position))))
(line-move-visual-store line-move-visual))
(setq line-move-visual t)
(goto-char (window-start))
(with-no-warnings
(next-line (1- click-y)))
(setq line-move-visual line-move-visual-store)
;; If you are using tabbar substitute the next line with
;; (line-number-at-pos))))
(1+ (line-number-at-pos)))))
(defun md-select-linum ()
"Funtions for position lines.
this helps maintain the move visual."
(interactive)
(with-no-warnings
(goto-line (line-at-click)))
(set-mark (point))
(setq *linum-mdown-line*
(line-number-at-pos)))
(defun mu-select-linum ()
"Funtions for position lines.
this helps maintain the move visual."
(interactive)
(when *linum-mdown-line*
(let (mu-line)
;; (goto-line (line-at-click))
(setq mu-line (line-at-click))
(with-no-warnings
(goto-line (max *linum-mdown-line* mu-line)))
(set-mark (line-end-position))
(with-no-warnings
(goto-line (min *linum-mdown-line* mu-line)))
(setq *linum-mdown*
nil))))
(global-set-key (kbd "<left-margin> <down-mouse-1>") 'md-select-linum)
(global-set-key (kbd "<left-margin> <mouse-1>") 'mu-select-linum)
(global-set-key (kbd "<left-margin> <drag-mouse-1>") 'mu-select-linum)
(provide 'init-nlinum)
;; Local Variables:
;; byte-compile-warnings: (not free-vars)
;; End:
;;; init-nlinum.el ends here

14
modules/init-ox-reveal.el Normal file
View 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

View File

@ -4,15 +4,18 @@
;;; Code: ;;; Code:
(use-package php-refactor-mode (use-package php-refactor-mode
:pin "MELPA"
:after (php-mode) :after (php-mode)
:mode ("\\.php\\'" . php-mode) :mode ("\\.php\\'" . php-mode)
:hook :hook
(php-mode . php-refactor-mode)) (php-mode . php-refactor-mode))
(use-package php-mode (use-package php-mode
:pin "MELPA"
:ensure t) :ensure t)
(use-package company-php (use-package company-php
:pin "MELPA"
:ensure t :ensure t
:config :config
(defun cfg:php-mode-hook () (defun cfg:php-mode-hook ()

View File

@ -5,6 +5,7 @@
;;; Code: ;;; Code:
;; rainbow-mode ;; rainbow-mode
(use-package rainbow-mode (use-package rainbow-mode
:pin "GNU ELPA"
:hook :hook
(css-mode . rainbow-mode) (css-mode . rainbow-mode)
(sass-mode . rainbow-mode) (sass-mode . rainbow-mode)

View 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
View 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

View File

@ -1,18 +0,0 @@
;;; init-theme.el --- .Emacs Configuration -*- lexical-binding: t -*-
;;; Commentary:
;;
;;; Code:
(use-package sublime-themes
:config
(load-theme 'spolsky t))
;; Fix linum current-line highlight. Doesn't looks good with this theme
(defface my-linum-hl
'((t :background "gray30" :foreground "gold"))
"Face for the currently active Line number"
:group 'linum)
(provide 'init-theme)
;;; init-theme.el ends here

View 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

View File

@ -3,15 +3,6 @@
;; ;;
;;; Code: ;;; 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 ;; Sachachua
;;------------------------------------------------------------------------------ ;;------------------------------------------------------------------------------

View 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

View File

@ -13,11 +13,12 @@
("\\.jsp\\'" . web-mode) ("\\.jsp\\'" . web-mode)
("\\.gsp\\'" . web-mode) ("\\.gsp\\'" . web-mode)
("\\.scss\\'" . web-mode) ("\\.scss\\'" . web-mode)
("\\.tsx\\'" . web-mode)
("\\.ctp\\'" . web-mode)) ("\\.ctp\\'" . web-mode))
:config :config
;; web-modeの設定 ;; web-modeの設定
(setq web-mode-enable-current-element-highlight t) (setq web-mode-enable-current-element-highlight t)
(set-face-background 'web-mode-current-element-highlight-face "#a3a3a3") (set-face-background 'web-mode-current-element-highlight-face "#616161")
;; Fix smarty ;; Fix smarty
(setq web-mode-engines-alist (setq web-mode-engines-alist

View File

@ -3,9 +3,8 @@
;; custom settings!!! ;; custom settings!!!
;;; Code: ;;; Code:
(setq user-full-name "LibreUser.") (setq user-full-name (getenv "EMACS_USER"))
(setq user-mail-address "name@domain.com") (setq user-mail-address (getenv "EMACS_EMAIL"))
;; Local Variables: ;; Local Variables:
;; byte-compile-warnings: (not free-vars) ;; byte-compile-warnings: (not free-vars)
;; End: ;; End: