Compare commits
No commits in common. "master" and "0.1" have entirely different histories.
13
.env.example
13
.env.example
@ -1,13 +0,0 @@
|
||||
# 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"
|
@ -1,39 +0,0 @@
|
||||
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,12 +5,9 @@
|
||||
.cache/
|
||||
.litable-lists.el
|
||||
.org-id-locations
|
||||
.lsp-session-v1
|
||||
.dap-breakpoints
|
||||
.session
|
||||
.smex-items
|
||||
*.eld
|
||||
.env
|
||||
*~
|
||||
/.mc-lists.el
|
||||
\#*\#
|
||||
@ -27,7 +24,6 @@ projectile*
|
||||
recentf
|
||||
session*
|
||||
smex-items
|
||||
snippets/
|
||||
srecode-map.el
|
||||
tramp
|
||||
transient/
|
||||
@ -37,4 +33,3 @@ vendor/
|
||||
|
||||
### Python Virtual ###
|
||||
.python-environments/
|
||||
elpy/
|
||||
|
115
README.md
115
README.md
@ -1,133 +1,66 @@
|
||||
<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>
|
||||
Lightweight configuration of emacs with basic utilities plus personal configuration
|
||||
|
||||

|
||||

|
||||
|
||||
### Installation
|
||||
|
||||
First step:
|
||||
|
||||
M-x package-refresh-contents [RET]
|
||||
|
||||
#### Main mirror
|
||||
|
||||
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")'`
|
||||
1. `git clone https://libregit.org/heckyel/emacs-personal.git ~/.emacs.d/`
|
||||
|
||||
2. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'`
|
||||
|
||||
#### Secundary mirror
|
||||
|
||||
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")'`
|
||||
1. `git clone https://notabug.org/heckyel/emacs-personal.git ~/.emacs.d/`
|
||||
|
||||
### Requirements
|
||||
|
||||
* [x] ttf-hack
|
||||
* [x] ttf-anonymous-pro
|
||||
* [x] hyphen
|
||||
* [x] hyphen-es
|
||||
* [x] markdown
|
||||
* [x] shellcheck
|
||||
* [x] python-virtualenv
|
||||
* [x] python-pylint
|
||||
2. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'`
|
||||
|
||||
### Fonts
|
||||
change the typography in the [init-gui.el](modules/init-gui.el#L54) file
|
||||
|
||||
### Icons
|
||||
`pacman -S ttf-hack` (for default)
|
||||
|
||||
```console
|
||||
$ emacs --batch --eval="(progn (package-initialize)(package-install 'all-the-icons))"
|
||||
```
|
||||
`pacman -S ttf-anonymous-pro`
|
||||
|
||||
> change the typography in the [init-gui.el](modules/init-gui.el#L54) file
|
||||
|
||||
### Markdown Mode
|
||||
- Require installed markdown in distro GNU+Linux, example:
|
||||
|
||||
Require installed markdown in distro GNU+Linux, example:
|
||||
|
||||
```console
|
||||
$ apt install markdown
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```console
|
||||
$ pacman -S markdown
|
||||
```
|
||||
`apt-get install markdown` or `pacman -S markdown`
|
||||
|
||||
### Flycheck Mode
|
||||
- Require installed the languages checking, example:
|
||||
|
||||
#### bash, sh
|
||||
`pacman -S shellcheck` # bash, sh
|
||||
|
||||
```console
|
||||
$ pacman -S shellcheck
|
||||
```
|
||||
`pacman -S eslint` # ECMAScript
|
||||
|
||||
#### python
|
||||
|
||||
```console
|
||||
$ pacman -S python-pylint
|
||||
```
|
||||
`pacman -S python-pylint` # python
|
||||
|
||||
### Neotree
|
||||
|
||||
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.
|
||||
|
||||
### Linum
|
||||
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
|
||||
|
||||
## 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>
|
||||
pyvenv-activate
|
||||
|
@ -3,8 +3,15 @@
|
||||
;; 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)
|
||||
'(ecb-options-version "2.50")
|
||||
'(package-selected-packages
|
||||
'(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)))
|
||||
(quote
|
||||
(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 was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
|
104
init.el
104
init.el
@ -7,52 +7,52 @@
|
||||
;; Without this comment emacs25 adds (package-initialize) here
|
||||
;; (package-initialize)
|
||||
|
||||
;;; Time Mark
|
||||
(setq emacs-load-start-time (current-time))
|
||||
|
||||
(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"))
|
||||
(let* ((minver "24.4"))
|
||||
(when (version< emacs-version minver)
|
||||
(error "Emacs v%s or higher is required" minver)))
|
||||
|
||||
;;; 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)
|
||||
|
||||
;;; 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
|
||||
;;;------------------------------
|
||||
@ -70,19 +70,19 @@
|
||||
(require 'init-security)
|
||||
(require 'init-elpa)
|
||||
;; theme
|
||||
;; (require 'init-doom-theme)
|
||||
(require 'init-vscode-theme)
|
||||
(require 'init-theme)
|
||||
;; Utils
|
||||
(require 'init-utils)
|
||||
;; GUI
|
||||
(require 'init-nlinum)
|
||||
(require 'init-gui)
|
||||
(require 'init-editing-utils)
|
||||
(require 'init-diminish)
|
||||
(require 'init-ecb)
|
||||
(require 'init-modeline)
|
||||
(require 'init-indent-guides)
|
||||
(require 'init-icons)
|
||||
(require 'init-neotree)
|
||||
(require 'init-dashboard)
|
||||
;; Tools
|
||||
(require 'init-apache)
|
||||
(require 'init-company)
|
||||
@ -92,38 +92,29 @@
|
||||
(require 'init-whitespace)
|
||||
(require 'init-emmet-mode)
|
||||
(require 'init-nginx)
|
||||
(require 'init-editorconfig)
|
||||
(require 'init-git)
|
||||
;;(require 'init-editorconfig nil 'noerror)
|
||||
;; 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-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))
|
||||
(require 'init-dokuwiki))
|
||||
|
||||
;;; Custom variables
|
||||
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
|
||||
@ -137,6 +128,13 @@
|
||||
(when (file-exists-p custom-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
|
||||
(put 'erase-buffer 'disabled nil)
|
||||
|
||||
|
@ -2,18 +2,14 @@
|
||||
;;; Commentary:
|
||||
;; Company es un famework de Emacs para el completado de texto.
|
||||
|
||||
;;; code:
|
||||
;;; CODE:
|
||||
(use-package company
|
||||
:defer 5
|
||||
:diminish
|
||||
:bind
|
||||
(:map company-mode-map
|
||||
("<backtab>" . company-complete))
|
||||
:ensure t
|
||||
:config
|
||||
;; Global
|
||||
(setq company-idle-delay 1
|
||||
company-minimum-prefix-length 1
|
||||
company-show-numbers nil
|
||||
company-show-numbers t
|
||||
company-tooltip-limit 20)
|
||||
|
||||
;; Facing
|
||||
@ -25,6 +21,9 @@
|
||||
(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))
|
||||
|
||||
|
@ -1,39 +0,0 @@
|
||||
;;; 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
|
@ -1,11 +0,0 @@
|
||||
;;; 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,80 +0,0 @@
|
||||
;;; 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
|
34
modules/init-ecb.el
Normal file
34
modules/init-ecb.el
Normal file
@ -0,0 +1,34 @@
|
||||
;;; 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
|
@ -77,7 +77,7 @@
|
||||
ad-do-it))
|
||||
|
||||
(setf undo-tree-visualizer-timestamps t)
|
||||
(setf undo-tree-visualizer-diff nil)
|
||||
(setf undo-tree-visualizer-diff t)
|
||||
(setf undo-tree-auto-save-history nil) ;; no salva el historial de cambios
|
||||
|
||||
:config
|
||||
|
@ -7,7 +7,6 @@
|
||||
;; EditorConfig
|
||||
;;----------------------------------------------------------------------------
|
||||
(use-package editorconfig
|
||||
:ensure t
|
||||
:config
|
||||
(when (and (require 'editorconfig nil t)
|
||||
(fboundp 'editorconfig-mode))
|
||||
|
@ -20,19 +20,16 @@
|
||||
'(("MELPA Stable" . 10)
|
||||
("GNU ELPA" . 5)
|
||||
("ORG" . 3)
|
||||
("MELPA" . 0))
|
||||
package-enable-at-startup nil)
|
||||
;; =================
|
||||
("MELPA" . 0)))
|
||||
|
||||
(setq package-native-compile t)
|
||||
;; =================
|
||||
(package-initialize)
|
||||
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-refresh-contents)
|
||||
(package-install 'use-package))
|
||||
|
||||
(eval-when-compile
|
||||
(require 'use-package))
|
||||
(require 'use-package)
|
||||
(setq use-package-always-ensure t)
|
||||
;; =====================================================
|
||||
;; End use-package
|
||||
|
@ -17,10 +17,6 @@
|
||||
: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)
|
||||
|
112
modules/init-git.el
Normal file
112
modules/init-git.el
Normal file
@ -0,0 +1,112 @@
|
||||
;;; 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
|
@ -1,11 +0,0 @@
|
||||
;;; 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
|
@ -1,20 +0,0 @@
|
||||
;;; 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,25 +15,19 @@
|
||||
(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 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)
|
||||
(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
|
||||
(setq locale-coding-system 'utf-8) ; pretty
|
||||
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
|
||||
(setq-default buffer-file-coding-system 'utf-8-auto-unix)
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Editor configuration
|
||||
@ -54,10 +48,13 @@
|
||||
(lambda ()
|
||||
(setq line-spacing 0)))
|
||||
|
||||
;; Font theme (DejaVu Sans Mono if Hack isn't present)
|
||||
(if (member "Hack" (font-family-list))
|
||||
;; Font theme (Monospace, or DejaVu Sans Mono if Monospace is not
|
||||
;; present)
|
||||
(condition-case nil
|
||||
(set-frame-font "Hack-9")
|
||||
(set-frame-font "DejaVu Sans Mono-10"))
|
||||
;; (set-frame-font "Monospace-9")
|
||||
;; (set-frame-font "Anonymous Pro-10")
|
||||
(error (set-frame-font "DejaVu Sans Mono-10")))
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Configure keys
|
||||
@ -68,12 +65,6 @@
|
||||
(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
|
||||
@ -85,21 +76,6 @@
|
||||
'(2 "_NET_WM_STATE_FULLSCREEN" 0)))
|
||||
(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
|
||||
;;----------------------------------------------------------------------------
|
||||
|
@ -7,25 +7,10 @@
|
||||
;; This minor mode highlights indentation levels via font-lock
|
||||
|
||||
(use-package highlight-indent-guides
|
||||
:ensure t
|
||||
:config
|
||||
(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)
|
||||
;; Indent character samples: fill, column or character
|
||||
(setq highlight-indent-guides-method 'character))
|
||||
|
||||
(provide 'init-indent-guides)
|
||||
|
||||
|
@ -29,14 +29,6 @@
|
||||
(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,36 +7,46 @@
|
||||
;; js2-mode: enhanced JavaScript editing mode
|
||||
;; https://github.com/mooz/js2-mode
|
||||
(use-package js2-mode
|
||||
:ensure t
|
||||
: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)
|
||||
:mode (("\\.js$" . js2-mode))
|
||||
:hook ((js2-mode . (lambda ()
|
||||
(flycheck-mode)
|
||||
(company-mode))))
|
||||
: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 ?#))))
|
||||
;; 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"
|
||||
:config (hydra-add-font-lock))
|
||||
|
||||
(use-package ivy-hydra
|
||||
:pin "MELPA")
|
||||
|
||||
;; js2-refactor: refactoring options for emacs
|
||||
;; https://github.com/magnars/js2-refactor.el
|
||||
(use-package js2-refactor
|
||||
:pin "MELPA"
|
||||
:after js2-mode
|
||||
: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)
|
||||
: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")
|
||||
|
||||
(defhydra js2-refactor-hydra (:color blue :hint nil)
|
||||
"
|
||||
@ -77,33 +87,54 @@
|
||||
("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
|
||||
: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))
|
||||
: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))
|
||||
|
||||
;; 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)
|
||||
|
@ -1,36 +0,0 @@
|
||||
;;; 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,12 +0,0 @@
|
||||
;;; 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
|
@ -1,11 +0,0 @@
|
||||
;;; 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
|
@ -4,7 +4,6 @@
|
||||
|
||||
;;; Code:
|
||||
(use-package markdown-mode
|
||||
:pin "MELPA"
|
||||
:mode (("\\.markdown\\'" . markdown-mode)
|
||||
("\\.md\\'" . markdown-mode))
|
||||
|
||||
@ -31,7 +30,16 @@
|
||||
(goto-char (point-max))
|
||||
(insert "\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)
|
||||
|
||||
|
@ -6,12 +6,47 @@
|
||||
;;----------------------------------------------------------------------------
|
||||
;; 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"
|
||||
:ensure t
|
||||
:hook (after-init . doom-modeline-mode)
|
||||
:config (setq column-number-mode t)
|
||||
)
|
||||
:config
|
||||
;; Show number of occurrences when searching
|
||||
(setq sml/theme 'powerline)
|
||||
|
||||
(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)
|
||||
|
||||
|
@ -81,7 +81,8 @@
|
||||
(ignore-errors
|
||||
;;; Pick one: projectile or find-file-in-project
|
||||
(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)
|
||||
(neo-global--window-exists-p))
|
||||
(neotree-hide)
|
||||
|
118
modules/init-nlinum.el
Normal file
118
modules/init-nlinum.el
Normal file
@ -0,0 +1,118 @@
|
||||
;;; 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
|
@ -1,14 +0,0 @@
|
||||
;;; 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,18 +4,15 @@
|
||||
|
||||
;;; 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,7 +5,6 @@
|
||||
;;; Code:
|
||||
;; rainbow-mode
|
||||
(use-package rainbow-mode
|
||||
:pin "GNU ELPA"
|
||||
:hook
|
||||
(css-mode . rainbow-mode)
|
||||
(sass-mode . rainbow-mode)
|
||||
|
@ -1,15 +0,0 @@
|
||||
;;; 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
|
@ -1,12 +0,0 @@
|
||||
;;; 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
|
18
modules/init-theme.el
Normal file
18
modules/init-theme.el
Normal file
@ -0,0 +1,18 @@
|
||||
;;; 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
|
@ -1,12 +0,0 @@
|
||||
;;; 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,6 +3,15 @@
|
||||
;;
|
||||
|
||||
;;; 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
|
||||
;;------------------------------------------------------------------------------
|
||||
|
@ -1,50 +0,0 @@
|
||||
;;; 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,12 +13,11 @@
|
||||
("\\.jsp\\'" . web-mode)
|
||||
("\\.gsp\\'" . web-mode)
|
||||
("\\.scss\\'" . web-mode)
|
||||
("\\.tsx\\'" . web-mode)
|
||||
("\\.ctp\\'" . web-mode))
|
||||
:config
|
||||
;; web-modeの設定
|
||||
(setq web-mode-enable-current-element-highlight t)
|
||||
(set-face-background 'web-mode-current-element-highlight-face "#616161")
|
||||
(set-face-background 'web-mode-current-element-highlight-face "#a3a3a3")
|
||||
|
||||
;; Fix smarty
|
||||
(setq web-mode-engines-alist
|
||||
|
@ -3,8 +3,9 @@
|
||||
;; custom settings!!!
|
||||
|
||||
;;; Code:
|
||||
(setq user-full-name (getenv "EMACS_USER"))
|
||||
(setq user-mail-address (getenv "EMACS_EMAIL"))
|
||||
(setq user-full-name "LibreUser.")
|
||||
(setq user-mail-address "name@domain.com")
|
||||
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (not free-vars)
|
||||
;; End:
|
||||
|
Loading…
x
Reference in New Issue
Block a user