Compare commits

...

326 Commits
evil ... master

Author SHA1 Message Date
KJ 8d8a60878f Remake readme. 2024-05-15 21:27:25 -04:00
KJ 5c45a7890a Add htmlize package. 2024-05-15 21:21:40 -04:00
KJ 536c9d30e3 Remove unused screenshot function. 2024-05-09 19:06:58 -04:00
KJ e54a28bb9d feat: Add css-mode config.
Set indent spaces to 2 instead the 4 (the default value).
2024-05-09 13:30:30 -04:00
KJ e663c02d97 Remove multiple-cursors. 2024-05-09 12:01:54 -04:00
KJ 4a1d3afb85 Remove unused shortcuts. 2024-05-09 11:57:36 -04:00
KJ 38254302e4 Temporal fix on hl-todo version not defined for elpaca. 2024-05-09 08:39:58 -04:00
KJ 47554e0bca Set corfu quit on tab. 2024-05-08 10:46:54 -04:00
KJ e7f8104cb6 Add tramp shell config for ssh and sshx. 2024-05-06 01:00:39 -04:00
KJ 4569080000 Add doc-view config. 2024-05-03 04:41:06 -04:00
KJ fc802c0db0 Add git-timemachine. 2024-05-02 14:32:56 -04:00
KJ 63f76373a5 Remove god mode.
Again, I feel this is not neccesary for me. Maybe is later I
return to evil.
2024-05-02 14:31:43 -04:00
KJ 5144fd405e Change default model for gptel.
The dolphin-llama3 model is more fast and, in theory,
give better answers.
2024-04-30 16:16:03 -04:00
KJ e45141b894 Add quickrun shortcuts. 2024-04-27 09:56:15 -04:00
KJ b8cb8e3ad6 Improve emacs startup with a new hook. 2024-04-27 01:24:25 -04:00
KJ 2fd710ea54 Add new navigation keybinding. 2024-04-27 00:37:23 -04:00
KJ c292ca77d0 Add ignore to vterm to god-mode. 2024-04-26 23:27:22 -04:00
KJ 02577be8c7 Add function to toggle hide titlebar when frame is maximized. 2024-04-26 18:54:54 -04:00
KJ a3ea9985e0 Increase corfu-auto delay from 0.2 (default) to 0.5. 2024-04-26 17:41:33 -04:00
KJ f5c35fd03c Disable org-modern for list. 2024-04-26 17:41:00 -04:00
KJ 2e210421e3 Remove unnecesary code. 2024-04-26 11:52:41 -04:00
KJ b5a30921a7 Disable corfu-complete when hits tab. 2024-04-26 11:52:27 -04:00
KJ a980735bd8 Disable evil and try to use god-mode. 2024-04-26 03:37:09 -04:00
KJ b95c3258ab Add anzu package. 2024-04-26 03:36:07 -04:00
KJ e276cc0eec Inprove corfu key mapping.
Escape key now is not globally taken, tab do nothing and
also all keys only was triggered when the corfu pop is open.
2024-04-26 02:52:40 -04:00
KJ 7eaa783f2e Add defer and after to improve emacs startup. 2024-04-26 02:20:53 -04:00
KJ 48afb56d36 Improve emacs startup. 2024-04-26 01:24:39 -04:00
KJ 3c6a7b371a Disable poly-org and polymode.
It create some visual bugs. For now is better use
org-edit-special (C-c ').
2024-04-25 16:54:11 -04:00
KJ baeb0a640b Add configuration for vterm with tramp. 2024-04-25 14:57:58 -04:00
KJ 3660933143 Update ollama models. 2024-04-24 20:50:53 -04:00
KJ d196afbe89 Fix: save place was not working. 2024-04-23 23:59:40 -04:00
KJ f6d5e2f925 Add translator prompt for gptel. 2024-04-23 23:59:04 -04:00
KJ f5a28724b0 Add BUG keyword to hl-todo. 2024-04-22 00:20:32 -04:00
KJ 30fbba45db Change todo keyword from WAITING to HOLD. 2024-04-22 00:19:26 -04:00
KJ dd1398415d Set default font. 2024-04-21 23:59:51 -04:00
KJ 07b4050a0d Clear themes config. 2024-04-21 23:59:15 -04:00
KJ 5ecf229620 Fix error with some versions of emacs-nox.
Only disable scroll-bar-mode on emacs gui.
2024-04-21 23:57:41 -04:00
KJ 4274a147f4 Disable ctags config.
After all, whe never use it. Eglots do all the work alone.

I will try improve the config, but for now is not needed as is.
2024-04-21 23:55:42 -04:00
KJ 5d728d3a2f Bring back org-bullets.
Org-modern give me a bug with the indentation.

Maybe i will check it again for a fix, but for now org-bullets
do the work.
2024-04-21 21:18:20 -04:00
KJ 438baf6022 Auto enable org-modern-mode for org-mode and org-agenda. 2024-04-21 21:17:31 -04:00
KJ 96ad111227 Add org-modern and remove org-bullets on its favor. 2024-04-21 21:00:06 -04:00
KJ 806c4c035f Disable hook to auto-enable org-appear-mode. 2024-04-21 20:24:28 -04:00
KJ 65e3ae4bd9 Manually set bullets for org-bullet. 2024-04-21 20:20:52 -04:00
KJ e9bc16a1a4 Disable request confirmation to eval code with org-babel. 2024-04-21 20:20:16 -04:00
KJ c90c19323b Change babel sh to shell (it allows bash, sh, etc.). 2024-04-21 20:19:33 -04:00
KJ 2c63d19cf4 Enable calc babel. 2024-04-21 20:18:42 -04:00
KJ 1a4795f6e9 Add html abbrevs. 2024-04-21 20:18:08 -04:00
KJ d588a9ed2e Add org babel config. 2024-04-21 19:20:54 -04:00
KJ d22f24ad4b Gitignore eshell history. 2024-04-21 18:09:34 -04:00
KJ d3c68d1ac6 Set quickrun shortcut only when is needed (prog modes). 2024-04-21 18:07:47 -04:00
KJ 04a3c86321 Add package quickrun. 2024-04-21 17:56:25 -04:00
KJ 6e7836ffb7 Simplify cape shortcuts. 2024-04-20 23:34:47 -04:00
KJ 05249c8a2e Remove case sensitivity for vertigo/orderless. 2024-04-18 21:59:53 -04:00
KJ 7a38ae22bc Change hints on hydra-git-gutter. 2024-04-18 15:45:08 -04:00
KJ 870e9a44ac Add abbreviations file. 2024-04-18 07:26:32 -04:00
KJ 71367398d6 Minify citre config. 2024-04-18 07:26:16 -04:00
KJ 055b5151df Improve cape config. 2024-04-18 07:25:37 -04:00
KJ f48e747299 Move functions to the functions file. 2024-04-18 05:32:51 -04:00
KJ 887255253d Improve gptel-directives. 2024-04-18 05:31:51 -04:00
KJ 0b3138b6c7 Remove unnecessary comments. 2024-04-18 05:26:15 -04:00
KJ bdaef62ba5 Add eglot-booster. 2024-04-18 05:25:55 -04:00
KJ ff85e08450 Testing news completion functions on cape. 2024-04-16 23:36:00 -04:00
KJ 0c636e3ce3 Improve some consult keyboard shortcuts. 2024-04-13 19:47:19 -04:00
KJ a1aab4a3fc Remove projectile.el in favor of project.el 2024-04-13 19:02:22 -04:00
KJ cb1b5058fd Delete unused config file. 2024-04-13 18:52:01 -04:00
KJ 954cfe64c7 Set scroll with C-v on motion modes. 2024-04-13 16:21:05 -04:00
KJ 370651ebec Add hydra config for git-gutter. 2024-04-13 01:19:05 -04:00
KJ d96a05fb7e Add hydra. 2024-04-12 14:01:27 -04:00
KJ 2da8c0346b Add ediff config.
By default ediff shows a ugly floating window.
With this config we improve a lot that default behaviour.
2024-04-12 08:30:37 -04:00
KJ f6633ee2ed Change evil-normal-state cursor to default (box). 2024-04-12 08:13:16 -04:00
KJ 8ec7f0b425 Change completion styles. 2024-04-12 08:11:04 -04:00
KJ d753809a27 Increase recentf saved items. 2024-04-12 08:08:49 -04:00
KJ 24abfebfe7 Add evil-org. 2024-04-06 14:42:25 -04:00
KJ 8a31842c17 Add TODO list inside code.
You can view the complete list using consult (consult-todo)
and on magit. Also the keywords like TODO or FIXME was
highlighted on code comments.
2024-04-03 19:19:21 -04:00
KJ 886284c70d Replace :elpaca to :ensure following the elpaca update.
Using :elpaca was DEPRECATED on elpaca 0.7.
2024-04-03 18:40:00 -04:00
KJ c72edac318 Update elpaca version. 2024-04-03 18:38:19 -04:00
KJ 669ca64f6c Change html-mode to mhtml-mode. 2024-03-29 14:27:55 -04:00
KJ a18650a700 Add C-<return> as a new shortcut on minibuffer and add comments.
The Ctrl-Enter key combination is a more universally employed
method of line termination in text input interfaces than the
Enter key is reserved for submitting the input.
2024-03-29 12:42:33 -04:00
KJ aba4022837 Set normal-state as default state of dashboard. 2024-03-29 12:41:41 -04:00
KJ 80664b0033 Add useful shortcuts for motion modes for order code quickly.
Utilize tab for line indentation, leader+y to access
kill-ring history, and leader++ to execute expand-region.
2024-03-28 22:48:59 -04:00
KJ db73de0718 Add shortcut to add new line without leaving evil normal state. 2024-03-28 22:06:24 -04:00
KJ c6c18aab3c Remove auto enable auto-rename-tag-mode. 2024-03-28 22:05:23 -04:00
KJ 8c5f9ecd14 Put emacs on insert state by default.
This way will be a more easy transition.
2024-03-25 00:24:32 -04:00
KJ 81626c4584 Setting keybindings. 2024-03-25 00:22:56 -04:00
KJ 05aabebf6f Trying evil enabled by default... again. 2024-03-25 00:19:55 -04:00
KJ 25c794daf2 Remove ellama in favor to gptel. 2024-03-21 10:21:20 -04:00
KJ 34029f173e Add devdocs. 2024-03-20 22:58:23 -04:00
KJ 264a4d61fa Add gptel. 2024-03-20 21:41:11 -04:00
KJ 821494dd22 Add ef themes. 2024-03-20 21:40:08 -04:00
KJ 1768ee428f Change default theme. 2024-03-03 02:20:25 -04:00
KJ cbaed77f63 Update php treesiter config. 2024-03-03 02:18:57 -04:00
KJ 32f53f09a4 Remove nov and add nginx-mode. 2024-02-19 00:08:11 -04:00
KJ 05da03b836 Remove straight form treemacs config. 2024-02-19 00:07:36 -04:00
KJ 1b7d286415 Update elpaca installer. 2024-01-25 23:39:08 -04:00
KJ 70bc86518d Add epub reader (nov.el package). 2023-11-13 17:34:29 -04:00
KJ d04c3baf44 Create a new config file for themes. 2023-11-06 20:55:18 -04:00
KJ e40aa8d194 Add ellama package.
This package depends of ollama server installed and started
with the model (by default zephyr) pulled prevoiusly.
2023-10-25 14:55:50 -04:00
KJ be51f082f7 Remove hook that close buffers used on emacsclient. 2023-10-25 14:54:31 -04:00
KJ f29a3bb673 Update readme.md 2023-10-23 21:01:26 -04:00
KJ eba6324658 Continue playig with the themes :). 2023-10-16 19:50:55 -04:00
KJ 970e63b565 Disable lock editor while lsp server is loading. 2023-10-16 18:16:41 -04:00
KJ 0f29b5e516 Use partial autocomplete instead select first on minibuffer. 2023-10-16 08:45:59 -04:00
KJ 887b7f068a Load theme after elpaca-after-init. 2023-10-15 11:56:32 -04:00
KJ 21a052895c Improve speed-type config.
Add hook to disable line numbres, enable visual-line-mode and
visual-fill-column-mode.
2023-10-15 10:32:13 -04:00
KJ 412ae58717 Change theme.
For some time I will use modus-themes instead dracula.
2023-10-15 10:14:59 -04:00
KJ c2f8cc244d Beauty some code lines.
A change for more easily read the code.
2023-10-15 10:13:48 -04:00
KJ a6cd373b2b Fix comment.
The config now is using elpaca, not straight.
2023-10-15 10:12:35 -04:00
KJ 78c20da3b1 Disable vc-comment-return.
Not worth the effort.
2023-10-15 10:08:06 -04:00
KJ 730d3bd0fd Update leader key shortcuts. 2023-10-14 10:29:55 -04:00
KJ 1ad7877974 Disable auto-maximize emacs at startup. 2023-09-30 17:49:28 -04:00
KJ 9399a3e372 Move function inside the apropiate block. 2023-09-30 17:47:50 -04:00
KJ 5aedee6f8e Remove some prettify-symbols. 2023-09-30 17:46:46 -04:00
KJ 7658e199fc Comment not necesary lines. 2023-09-30 17:45:42 -04:00
KJ fc5afd432d Disable variable-pitch-mode.
It causes bad indentation.
2023-09-30 17:44:13 -04:00
KJ f41cde5c3c Add custom faces. 2023-09-24 21:34:06 -04:00
KJ 5738e49658 Add org-appear. 2023-09-24 21:33:16 -04:00
KJ 695a669b60 Add polymode. 2023-09-24 21:32:18 -04:00
KJ 138aa48811 Change org-fancy-priorities to prettify-symbols-mode.
prettify-symbols-mode is a mode build-in into org-mode.
So, we use the one that already have instead add another
package that do the same.
2023-09-24 16:08:26 -04:00
KJ 29328974c2 Migrate from ivy+counsel to vertico+consult. 2023-09-24 11:15:01 -04:00
KJ e9eb786eaf Enable use-short-answers. 2023-09-24 11:14:06 -04:00
KJ d2772d6a6e Remove project directories config.
It is not neccesary now.
2023-09-24 02:54:26 -04:00
KJ 8ab0564ad8 Remove superfluous lines. 2023-09-24 02:52:31 -04:00
KJ c60c4b8a11 Undo latest commit. 2023-09-23 20:24:15 -04:00
KJ 53f615cabd Add autoinstall nerd-icons if is not. 2023-09-23 20:08:25 -04:00
KJ cef7d4e78a Enable evil-mode but without autostart mode. 2023-09-23 17:32:38 -04:00
KJ 1ae42b518e Fix: corfu and evil auto-init mode. 2023-09-16 15:54:28 -04:00
KJ 637f04ae26 Fix: ivy and projectile mode do not starting after init. 2023-09-16 15:36:26 -04:00
KJ 503bf53890 Migrate from straight.el to elpaca.
Idk why, I only can try it.

For now the emacs-init-time whas improved.
2023-09-16 14:05:56 -04:00
KJ 04e3e2ec29 Add another keybind to isearch. 2023-09-09 01:37:29 -04:00
KJ e6456414d7 Remove alpha by default. 2023-09-09 01:11:51 -04:00
KJ 0179d8ab20 Add defer for yt-dl.
Is not neccesary, but idc.
2023-09-09 01:11:16 -04:00
KJ beaca9c60d Remove ctags path.
Works better not setting it.
2023-09-09 01:10:16 -04:00
KJ 0a89a44121 Disable evil mode.
Really I not need it, sometimes I want use it again,
but the emacs shortcuts are fine and using it is
better at the end.

And for other thing, the commands are better that
any shotcut of VIM or Emacs.
2023-09-09 01:08:42 -04:00
KJ 0be516d313 Disable corfu delay. 2023-08-31 21:21:24 -04:00
KJ 4b43539553 Return to emacs state by default. 2023-08-30 11:31:42 -04:00
KJ ff9435b717 Set orderless completion style. 2023-08-26 14:10:20 -04:00
KJ 329b6ba040 Change the default cursor of evil normal state. 2023-08-22 12:39:12 -04:00
KJ 61f849a922 Update evil-mode config. 2023-08-22 00:45:24 -04:00
KJ 45a2cde1e5 Disable dired sidebar follow. 2023-08-17 10:20:55 -04:00
KJ e63e2b0e21 Add vterm fast shortcut. 2023-08-10 16:00:42 -04:00
KJ b9afc66ee2 Remove company-mode config.
This config is not necessary anymore because now corfu make
the same and for now is the preferred option for me.
2023-08-02 03:33:34 -04:00
KJ 0288bf609f Add delay of 0.5 to corfu auto completion. 2023-08-02 03:30:58 -04:00
KJ 06cdcfbab7 Add prettier package. 2023-07-04 16:59:44 -04:00
KJ c9c268d824 Changed priority emojis for TODO on org-mode. 2023-06-26 09:49:35 -04:00
KJ 1e5e583b40 Setup hl-line-mode.
Disable global mode and enable automatically on dired-mode.
2023-06-24 13:22:35 -04:00
KJ 6e1b1b74f5 Add defer to buffer-move load. 2023-06-23 19:38:54 -04:00
KJ 5342a6b4f1 Enable follow file on dired-sidebar. 2023-06-23 09:40:02 -04:00
KJ 0a291773fa Fix global-hl-line-mode. 2023-06-23 09:39:27 -04:00
KJ 01737264b9 Remove windmove shortcuts.
I will try use other-window only.
2023-06-23 06:16:53 -04:00
KJ 956ed75ed9 Change shortcut for ace-window to a new for other-window. 2023-06-23 06:07:48 -04:00
KJ 73935d3bc4 Re-order packages alphabetically. 2023-06-23 06:07:22 -04:00
KJ e1c915d261 Change all-the-icons to nerd-icons. 2023-06-23 05:34:43 -04:00
KJ ff3cb53fb6 Fix corfu-terminal package load. 2023-06-23 05:31:48 -04:00
KJ fb69ae0828 Remove not lsp-mode config in favor to eglot.
I will no longer maintain the lsp-mode config
just now, eglot is better for me and just fits
really well with my necesities.
2023-06-23 04:51:08 -04:00
KJ 9b0bb0ea95 Remove treemacs in favor of dired-sidebar. 2023-06-23 04:40:02 -04:00
KJ ffd2fba015 Add shortcut for ace-window. 2023-06-23 04:10:04 -04:00
KJ 4384c37823 Disable global-so-long-mode.
I think that is better if the user can enable
long-lines-mode manually when consider necessary.
2023-06-21 06:54:47 -04:00
KJ a673f8c939 Remove unnecesary hook. 2023-06-21 05:59:18 -04:00
KJ 1318e21c21 Add so-long-mode config. 2023-06-21 05:55:02 -04:00
KJ 0643d7a3cc Remove ideas.org on org-mode files for tasks. 2023-06-17 06:14:39 -04:00
KJ 8ee98d7966 Set normal as default evil-state on dashboard-mode. 2023-06-17 06:13:53 -04:00
KJ 79b1cab10e Move function to lsp.el 2023-06-02 13:14:35 -04:00
KJ 3bfb4508df add empty .custom.el 2023-05-23 14:41:53 -04:00
KJ c1b7a9b120 Fix dashboard on daemon/emacsclient. 2023-05-18 10:11:24 -04:00
kj 023f11c25e Add corfu config (replacement for company). 2023-05-02 00:32:14 -04:00
kj 6cda0d1d5e Remove unused and commented package. 2023-05-02 00:30:53 -04:00
kj 6364157efd remove fymake legacy hook. 2023-05-02 00:29:31 -04:00
kj 50568de7eb Change way to start maximized. 2023-04-30 12:45:46 -04:00
kj cdf1478322 Change splash image from a .png to the original svg. 2023-04-29 19:46:23 -04:00
kj fc9e1bf17e Improve transparency for only do transparent to the background. 2023-04-26 20:49:35 -04:00
kj 8e9a3fc301 Add tree-sitter config for various languages. 2023-04-18 18:49:47 -04:00
kj 765680a051 Undo last commit. 2023-04-18 15:49:07 -04:00
kj fa9c5e7cf5 Another small improvement to startup time. 2023-04-18 13:55:08 -04:00
kj 0b14aeba36 Improve startup time. 2023-04-18 01:21:36 -04:00
kj 811ff581cf Add eldoc-box and a shortcut (F1) to show eldoc buffer as a popup. 2023-04-14 23:37:36 -04:00
kj 026549eff7 Fix conflict with vs-comment-return-mode and php-doc-block. 2023-04-14 22:39:15 -04:00
kj f929aad937 Update git ignore. 2023-04-14 22:38:48 -04:00
kj 36885ac135 Add smex for ordering on M-x. 2023-04-14 15:43:55 -04:00
kj 2cd55bc3a7 Add comments and reorder config files. 2023-04-14 12:39:19 -04:00
kj 7603b69925 Remove amx package in favor of counsel-M-x and add vc-msg 2023-04-14 12:34:57 -04:00
kj 2d91024820 Enable evil mode with emacs as default state. 2023-04-13 20:40:26 -04:00
kj e8be9f4264 Add background to org-block. 2023-04-13 20:39:58 -04:00
kj c05eee7657 Change emacs opacity at startup. 2023-04-13 20:35:45 -04:00
kj 6c3949e3aa Add org-present. 2023-04-13 18:31:51 -04:00
kj 599fe4bb8e Disable unused shortcuts. 2023-04-13 18:30:48 -04:00
kj 3b73728c41 Start emacs maximized. 2023-04-13 15:53:15 -04:00
kj 5ad90cc437 Add expand region. 2023-04-13 13:04:04 -04:00
kj 61e9b7d89d Enable pending mode. 2023-04-13 12:54:47 -04:00
kj b0abc9d6cf Remove some packages and add others.
Removed:
        - Anzu
        - Desktop
        - Origami

Added:
        - buffer-move
        - csv-mode
        - highlight-escape-sequences
        - keypression
        - license-templates
        - vs-comments-return
2023-04-13 07:13:59 -04:00
kj 0d84b2d066 Add comments and org-fancy-priorities package. 2023-04-13 05:11:39 -04:00
kj 6ba69a8dcc Bind context menu to the mouse right click. 2023-04-13 04:24:21 -04:00
kj e747f0d61e Improve company-mode. 2023-04-13 03:28:20 -04:00
kj 6d0b0a6abc Change evil keybind from rg to counsel-rg. 2023-04-13 02:01:17 -04:00
kj 4f90e837eb Add shortcut to sort-lines. 2023-04-13 02:00:23 -04:00
kj 16aab9416c Create a config file for HTML languaje. 2023-04-13 01:57:17 -04:00
kj 5526684a4b Disable unused packages. 2023-04-07 23:15:33 -04:00
kj 97519e6920 Update readme.md 2023-03-25 15:54:07 -04:00
kj 1475a86c75 Change intelephense to phpactor LSP for PHP. 2023-03-25 13:01:11 -04:00
kj 75cf33384c Remove duplicated code for startup optimization. 2023-03-24 15:49:28 -04:00
kj 575db84bb4 Arreglar keybinding
- M-y ahora ejecuta yank-pop en normal mode.
- C-p y C-n ya no están bindeaados a evil, funcionan normalmente.
2023-03-24 14:53:41 -04:00
kj 07097201dd Start on evil normal mode on org-mode. 2023-03-19 11:48:01 -04:00
kj 5c4fe71b09 Remove pomidor (I never ise it). 2023-02-05 17:29:30 -04:00
kj 8743e40381 Configure eglot+rust. 2023-02-05 17:28:21 -04:00
kj 92e3f98271 Evil: Set undo system and keybinding. 2023-01-21 22:38:30 -04:00
kj c01fb4f69c Improve a few more the evil config. 2023-01-21 22:11:44 -04:00
kj 0a23b5b19d Change prg-capture shortcut key. 2022-12-16 01:15:05 -04:00
kj bd450ea034 Ad more evil configurations. 2022-11-29 03:46:08 -04:00
kj e1775bda51 Fix comment block of functions. 2022-11-29 03:45:36 -04:00
kj 69c904cffa Remove yasnippets. 2022-11-29 03:45:09 -04:00
kj a6848f631f Remove unused packages and move amx to init-packages.el 2022-11-28 22:47:21 -04:00
kj 92ac29ee5d Preparation to be evil again >:) 2022-11-28 07:23:27 -04:00
kj 76e9e4062c Replace smartparens to electric-pair (built-in). 2022-11-28 06:18:05 -04:00
kj 003dd5db24 Remove unused commented packages. 2022-11-28 06:07:25 -04:00
kj 156c544f73 Fix foregroun nil error. 2022-11-23 20:47:30 -04:00
kj 900e6d181b Remove comment. 2022-11-23 20:47:08 -04:00
kj 38d53dc5c1 Autostart eglot on sh-mode. 2022-11-23 12:30:07 -04:00
kj 816a2188af Add autoload flymake and diagnostic at point popup-tip on hover. 2022-11-22 23:06:05 -04:00
kj 4d0fe6e385 Update new init-packages loading. 2022-11-22 23:05:42 -04:00
kj 1ec4cd79eb Rename "init-extensions" to a better name. 2022-11-22 23:04:38 -04:00
kj 14ecdc2269 Try eglot with flymake instead flycheck. 2022-11-22 19:35:03 -04:00
kj 099ddda6db Move flycheck to LSP. 2022-11-22 19:34:06 -04:00
kj f0ba1006e5 Disable eglot and re-enable LSP. 2022-11-19 15:44:48 -04:00
kj 330063d212 Remove flycheck and flymake for eglot. 2022-11-19 15:44:14 -04:00
kj d683d3cbf7 Fix flycheck + eglot integration. 2022-11-19 14:53:04 -04:00
kj 017566a9dd Use flycheck on eglot. 2022-11-19 14:25:30 -04:00
kj a7c0b5de66 Disable lsp-mode on sql-mode. 2022-11-19 14:16:29 -04:00
kj 42e325db91 Final touchs for eglot configuration. 2022-11-19 13:59:47 -04:00
kj f696234932 Fix dashboard.el on emacs 29.0.50. 2022-11-19 02:16:53 -04:00
kj c81fc52b8c Remove unnecesary hook (projectile runs alone). 2022-11-19 01:31:49 -04:00
kj c4c8b98c93 Change origami reto to another more updated. 2022-11-19 01:31:16 -04:00
kj d74f9db1fe Delete not more necesary client runner bash script. 2022-11-19 01:29:53 -04:00
kj db3aeec98e Fix warning message. 2022-11-19 01:29:13 -04:00
kj 918396efc6 Fix missconfig. 2022-11-18 23:35:01 -04:00
kj dc74b4bde0 Rename config files. 2022-11-18 23:33:22 -04:00
kj 52db45d968 Disable citre (base-ctags.el) 2022-11-18 23:01:47 -04:00
kj 8f90cfcf1b Remove unnecesary ensure. 2022-11-18 22:58:54 -04:00
kj a86d9e4eb7 Change form lsp-mode to eglot. 2022-11-18 22:58:15 -04:00
kj 5cf22a5451 Move lsp-treemas to base-lsp.el 2022-11-18 22:56:57 -04:00
kj 2d02d9e5bc Add eglot. 2022-11-18 22:56:34 -04:00
kj 051e902d64 Reconfigure org-agenda and org-refile-targets files. 2022-09-10 16:32:50 -04:00
kj c6d8b14feb Remove defer saveplace. 2022-09-10 16:32:09 -04:00
kj 42d34290e2 Add image config for org mode. 2022-09-06 21:57:18 -04:00
kj f19c62f75a Add multi-session (by project) desktop write/read. 2022-08-22 19:42:46 -04:00
kj 33fa8c56d8 Remove tree-sitter (for now). 2022-08-21 23:31:18 -04:00
kj 4d47c23808 Remove unused shortcuts and add one for counsel-rg. 2022-08-21 23:29:55 -04:00
kj 284a01cabc Remove treemacs-persp. 2022-08-21 23:28:30 -04:00
kj 83f311024a Change web-mode default lsp languaje to html. 2022-08-18 16:48:25 -04:00
kj cddf20683e Change multi-web-mode to web-mode. 2022-08-11 12:16:02 -04:00
kj 8d430b9d3c Change default startup folding on org files. 2022-08-11 12:15:30 -04:00
kj 3f7fc4ec29 Add shortcut key to multi-web-mode. 2022-08-07 13:14:41 -04:00
kj 5a2f94bc32 Change hooks to improve (a few) startup time. 2022-08-07 13:12:35 -04:00
kj ef6bbf94f7 Add multi-web-mode. 2022-08-07 12:14:12 -04:00
kj b5de8f34b3 Add trasaparency to emacs by default :). 2022-08-01 08:45:56 -04:00
kj adb2034d24 Update straight.el installation url file. 2022-08-01 08:43:57 -04:00
kj 492571645b Change org cycle separator. 2022-07-17 16:12:43 -04:00
kj be00c17615 More changes to try improve LSP. 2022-07-12 16:38:53 -04:00
kj a6c1c113df Set shortcut for counsel-mark-ring. 2022-07-12 16:38:24 -04:00
kj 23b14da665 Set allways ensure for use package. 2022-07-12 16:37:53 -04:00
kj fb41d46922 Uodate reame. 2022-07-12 16:37:40 -04:00
kj 9ee088a832 Add 2 ways to take code screenshots (maybe unnesearry, but why not). 2022-07-12 16:36:51 -04:00
kj a27d677716 Disable open *messages* when click on minibuffer. 2022-07-10 21:57:05 -04:00
kj cf059895f9 Change lsp for html/php switching and set counsel-register. 2022-06-29 20:52:39 -04:00
kj 5fa858af78 Remove unused functions and change 2 shortcuts.
- Modify comment/uncomment region to comment current line and change
to shortcut to C-S-c.
- Change duplicate line shortcut to C-S-d.
2022-06-27 23:52:52 -04:00
kj ee4c9c351f LSP improvements.
- Disconnect from flycheck: I finded that it hangs with lsp (checked
with profiler-start/stop/report) and freeze emacs for a few seconsand
other errors apears like bad syntax highlighting.
- Re-enable lsp with prog-mode.
- Enable automatic project root detection vía
projectile (lsp-auto-guess-root).
- Lsp idle delay changed to 0.5 (default value).
2022-06-27 16:02:41 -04:00
kj d8f91e3dac Change dashboard agenda to daily and also show the time of the task. 2022-06-27 16:01:08 -04:00
kj 88c8049a6f Add org-autolist. 2022-06-27 16:00:04 -04:00
kj cf49ec2618 Disable LSP Lens. 2022-06-19 13:41:32 -04:00
kj 4aa5217915 Update gitignore. 2022-06-18 20:37:40 -04:00
kj eea36dbe80 Disable yasnipets TAB keybidding. 2022-06-18 20:37:11 -04:00
kj fe46f716eb Remove polymode. 2022-06-18 20:36:05 -04:00
kj cea7e3ace6 Fix citre. 2022-06-11 02:48:01 -04:00
kj e6e6c20c9c Disable autoload lsp on prog-mode. 2022-06-11 02:47:09 -04:00
kj 787e23525c Add polymode. 2022-06-11 02:46:49 -04:00
kj 5a889964e7 Fix setting treeemacs git straight to true. 2022-06-09 16:10:50 -04:00
kj b7873f48de Add gcmh package to manage the valoue of gc-cons-threshold. 2022-06-09 04:14:23 -04:00
kj 93bee419e8 Add treemacs. 2022-06-09 03:53:59 -04:00
kj b59e654bbd Improve lsp (it freezes a lot). 2022-06-09 03:53:28 -04:00
kj d50f434788 Revove books with bad orthography. 2022-06-08 03:01:55 -04:00
kj ac79a60aee Change company-idle-delay. 2022-06-08 02:49:56 -04:00
kj cb445f95c0 Add dap mode for debug and lsp for java. 2022-06-07 03:36:36 -04:00
kj 6dbf0e9746 Increase lsp read-process-output-max to 3MB. 2022-06-07 03:09:10 -04:00
kj f8b5174274 Retore part of the old org-capture templates. 2022-06-07 03:08:03 -04:00
kj 553694530e Disable lsp-ui-doc on mouse hover and set F1 key to trigger it. 2022-06-06 17:11:28 -04:00
kj 42ff8f3cbd Change org-capture key, template and remove an agenda file. 2022-06-06 15:01:38 -04:00
kj 8fa7bc9ed7 Fix bucle at native compilation. 2022-06-05 13:38:28 -04:00
kj f38ca8a4c9 Remove book with bad orthography from speed-test-type config. 2022-06-05 13:37:15 -04:00
kj a7045d3b30 Mixed changes.
- Rename org-config.el to base-org.el.
- Enable lsp by default.
- Improve lsp.
- Add citre package (ctags IDE).
- Add ripgrep search.
- Add pomidor  (pomodoro timer).
- Move keybinding for improve load time (some are deleted or changed).
- Add C-x C-r keybinding for recent files.
- And more...
2022-06-01 09:18:06 -04:00
kj 7ee9bd4492 Change from package.el to straight.el. 2022-05-27 17:04:28 -04:00
kj fb890c4ceb Disable lsp mode by default on rust and enable php. 2022-05-27 12:23:09 -04:00
kj 98174ef392 Add shortcut for fast change to rust major mode. 2022-05-27 12:22:02 -04:00
kj 2baff92bf0 Fix projectile warning setting the frame title. 2022-05-18 03:43:24 -04:00
kj 52a7058da6 On daemon mode, kill all buffer except dashboard on close frame. 2022-05-18 03:31:22 -04:00
kj 290243835f Enable lsp on Rust. 2022-05-18 03:08:59 -04:00
kj f75b9eda35 Update gitignore. 2022-05-18 03:08:39 -04:00
kj e98d12e7e8 Change windmove shortcut keys. 2022-05-18 03:07:54 -04:00
kj 0411b624da Fix lsp to works with another company-backends. 2022-05-18 03:07:05 -04:00
kj 97ec0558dd Change to alphabetical order. 2022-05-16 00:13:25 -04:00
kj cfb3279f52 Disable maximize at start. 2022-05-09 21:16:56 -04:00
kj 1ade083d25 Move notes and agenda to another path. 2022-05-09 20:28:50 -04:00
kj 18a43a404c Change C-c C-d shortcut to C-c l d. 2022-05-08 19:06:23 -04:00
kj f654c2889b Add shortcut to duplicate line. 2022-05-08 19:00:49 -04:00
kj 28e1e3d4b1 Add org-roam-ui... and it's beautifull :D. 2022-05-08 19:00:07 -04:00
kj 935cb9e70b Set org-mode case-sensitive at autocompete. 2022-05-07 23:33:21 -04:00
kj 97c7ea774b Reorder config and php-doc-block shortcut now works only on php-mode. 2022-05-07 14:21:20 -04:00
kj 87c61ac6e9 Fix origami-toggle-all-nodes shortcut. 2022-05-07 14:20:41 -04:00
kj e7750197c9 Update readme.md 2022-05-07 11:32:39 -04:00
kj 19750d202d Fix indentation in org files. 2022-05-06 19:56:31 -04:00
kj 9166630294 Configure Agenda dashboard. 2022-05-06 18:37:31 -04:00
kj d1c00e505c Add rust lang. 2022-05-06 17:29:24 -04:00
kj 9cddf59c1d Improve yasnippets and enable yas-minor-mode on html-mode. 2022-05-06 16:07:54 -04:00
kj 0aed1d01a2 Fix autostart of smoothscrolling-mode. 2022-05-06 12:36:46 -04:00
kj d39a050a04 Add org-roam. 2022-05-05 20:04:23 -04:00
kj 38b36468f8 Add comments to base-functions.el. 2022-05-05 02:08:01 -04:00
kj aced36ad35 Refining org config. 2022-05-05 01:59:45 -04:00
kj 7b0757f128 Start emacs maximized. 2022-05-05 01:47:17 -04:00
kj 0522d5085f Show recent files on startup dashboard. 2022-05-05 01:46:16 -04:00
kj 0e48c679ef Fix error of recompiling (native comp) every emacs startup. 2022-05-04 00:12:32 -04:00
kj fe386ce0d8 Move al keybindings to base-keys. 2022-05-03 23:55:00 -04:00
kj 25e4d3ec05 Update readme.md 2022-05-03 23:54:22 -04:00
kj 52f8c664e6 Improve emacs startup. 2022-05-03 23:25:07 -04:00
kj b4e1c001ab Add shortcuts to origami (code folding). 2022-05-03 23:24:33 -04:00
kj 1678f7b283 Add some prettify changes to org-mode. 2022-05-03 23:23:46 -04:00
kj 5536818ec3 Move org config to 'org-config.el' file. 2022-04-21 13:45:31 -04:00
kj 9125667700 remove all evil and treemacs related. 2022-04-13 00:44:58 -04:00
kj 6598b63079 set font height. 2022-04-13 00:41:13 -04:00
kj b7bd232410 update gitignore. 2022-04-12 23:39:48 -04:00
312 changed files with 27786 additions and 2962 deletions

31
.gitignore vendored
View File

@ -1,6 +1,33 @@
elpa
transient
eln-cache
private/.*
private/cache
private/
bookmarks
.lsp-session*
projectile-bookmarks.eld
.org-id-locations
org-roam.db
lsp-cache/
.cache/
url/
straight/
amx-items
projects
speed-type/
var/
.dap-breakpoints
eclipse.jdt.ls/
workspace/
/.extension/
/diary
/history
/projectile.cache
/request/
/smex-items
/tree-sitter/
/elpaca/
/tramp
/nov-places
/devdocs/
/.mc-lists.el
/eshell/

31
abbrev_defs Normal file
View File

@ -0,0 +1,31 @@
;;-*-coding: utf-8;-*-
(define-abbrev-table 'mhtml-mode-abbrev-table
'(
("doc" "<!DOCTYPE html>
<html>
<head>
<meta charset=\"UTF-8\"/>
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<title>Document</title>
</head>
<body>
</body>
</html>" nil :count 1)
("doctype" "<!DOCTYPE html>" nil :count 0)
))
(define-abbrev-table 'web-mode-abbrev-table
'(
("doc" "<!DOCTYPE html>
<html>
<head>
<meta charset=\"UTF-8\"/>
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<title>Document</title>
</head>
<body>
</body>
</html>" nil :count 9)
("doctype" "<!DOCTYPE html>" nil :count 1)
))

View File

@ -1,650 +0,0 @@
;;; base-extensions.el --- Extenciones/paquetes instalados y su configuración
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;;; Code:
(setq evil-want-keybinding nil)
;; use-package - No necesita presentación
(use-package use-package
:config
(setq use-package-always-ensure t) ; auto-instalar extenciones que no lo estén
)
;; Auto-actualizar los paquetes
(use-package auto-package-update
:custom
(auto-package-update-interval 7)
(auto-package-update-prompt-before-update t)
(auto-package-update-hide-results t)
:config
(auto-package-update-maybe)
(auto-package-update-at-time "06:00")
:init
(setq
auto-package-update-last-update-day-filename
(expand-file-name ".last-package-update-day" private-dir)))
;; Iconos principalmente para ser usados por neotree
(use-package all-the-icons :defer t)
;; Terminal
(use-package vterm :ensure t :defer t)
;; Multiple vterm
(use-package multi-vterm :ensure t :defer t)
;; Highlight en los números.
(use-package highlight-numbers
:defer t
:ensure t
:hook
(prog-mode . highlight-numbers-mode))
;; Mover líneas o regiones
(use-package drag-stuff
:config
(drag-stuff-global-mode 1)
(drag-stuff-define-keys))
;; Recentf - Guarda registro de los archivos abiertos recientemente
(use-package recentf
:config
(setq recentf-save-file
(recentf-expand-file-name (concat temp-dir "/recentf")))
(recentf-mode 1))
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
(use-package saveplace
:config
(save-place-mode 1)
(setq save-place-file (locate-user-emacs-file (concat temp-dir "/places"))))
;; Emmet - Una ayuda para escribir HTML rápidamente (escribre doc, luego preciona C-j y lo entenderás)
(use-package emmet-mode
:config
(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes
(add-hook 'html-mode-hook 'emmet-mode)
(add-hook 'css-mode-hook 'emmet-mode)
)
;; Modo markdown
(use-package markdown-mode :defer t)
;; Git Gutter - Marca a la izq. si una linea ha sido agregada, editada o eliminada desde el último commit.
(use-package git-gutter
:config
(global-git-gutter-mode +1) ; Habilitar git gutter de manera global
)
;; Mejorando el scroll
(use-package smooth-scrolling
:config
(smooth-scrolling-mode 1) ; Cambia el salto de líneas cuando el cursor llega al final.
(setq mouse-wheel-scroll-amount
'(8 ((shift) . 1) ((control) . nil))) ; Cambia el scroll a 8 líneas a la vez, 1 cuando se preciona SHIFT y saltos de página cuando presionas CTRL
(setq mouse-wheel-progressive-speed nil) ; Deshabilita la velocidad progresiva del scroll (mientras más scroll haces, mas rápido va)
)
;; Esa línea bonita de abajo del editor que dice cosas xD
(use-package telephone-line
:defer t
:custom
(telephone-line-primary-left-separator 'telephone-line-cubed-left)
(telephone-line-secondary-left-separator 'telephone-line-cubed-hollow-left)
(telephone-line-primary-right-separator 'telephone-line-cubed-right)
(telephone-line-secondary-right-separator 'telephone-line-cubed-hollow-right)
(telephone-line-evil-use-short-tag t)
(setq telephone-line-lhs
'((evil . (telephone-line-evil-tag-segment))
(accent . (telephone-line-vc-segment
telephone-line-erc-modified-channels-segment
telephone-line-process-segment))
(nil . (;telephone-line-minor-mode-segment
telephone-line-buffer-segment))))
(setq telephone-line-rhs
'((nil . (telephone-line-misc-info-segment))
(accent . (telephone-line-major-mode-segment))
(evil . (telephone-line-airline-position-segment))))
(telephone-line-mode t)
)
;; Hacer uso de Emacs con las ventajas de vim.
(use-package evil
:defer t
:init
(evil-mode 1)
(setq evil-want-keybinding nil)
:config
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq evil-want-C-u-scroll t)
(setq evil-want-C-i-jump nil)
(setq evil-want-fine-undo t)
(setq evil-respect-visual-line-mode t)
(setq evil-toggle-key "C-'") ; Cambiar toggle-key cambiar entre evil states y emacs.
;; (setq evil-default-state 'emacs) ; Modo por defecto en emacs mode
(define-key evil-normal-state-map (kbd "g b") 'evil-jump-backward)
;; Seleccionar todo con C-a en insert mode
(evil-global-set-key 'insert (kbd "C-a") 'mark-whole-buffer)
;; **
;; Atajos personalizados con leader key
;; **
;; Definiendo la leader key
(evil-set-leader 'normal (kbd "SPC"))
(evil-set-leader 'visual (kbd "SPC"))
;; Atajos para counsel-projectile y switch buffer con leader key
(evil-define-key 'normal 'global (kbd "<leader>b") 'ivy-switch-buffer)
(evil-define-key 'visual 'global (kbd "<leader>b") 'ivy-switch-buffer)
(evil-define-key 'normal 'global (kbd "<leader>v") 'counsel-projectile)
(evil-define-key 'normal 'global (kbd "<leader>cp") 'projectile-switch-project)
(evil-define-key 'visual 'global (kbd "<leader>v") 'counsel-projectile)
(evil-define-key 'visual 'global (kbd "<leader>cp") 'projectile-switch-project)
(evil-define-key 'normal 'global (kbd "<leader>ff") 'counsel-find-file)
(evil-define-key 'visual 'global (kbd "<leader>ff") 'counsel-find-file)
;; Atajos windmove con leader key
(evil-define-key 'normal 'global (kbd "<leader>wh") 'windmove-left)
(evil-define-key 'normal 'global (kbd "<leader>wj") 'windmove-down)
(evil-define-key 'normal 'global (kbd "<leader>wk") 'windmove-up)
(evil-define-key 'normal 'global (kbd "<leader>wl") 'windmove-right)
;; Atajos con leader key para frames
(evil-define-key 'normal 'global (kbd "<leader>0") 'delete-window)
(evil-define-key 'normal 'global (kbd "<leader>1") 'delete-other-windows)
(evil-define-key 'normal 'global (kbd "<leader>2") 'split-window-below)
(evil-define-key 'normal 'global (kbd "<leader>3") 'split-window-right)
(evil-define-key 'normal 'global (kbd "<leader>kb") 'kill-buffer)
(evil-define-key 'normal 'global (kbd "<leader>wb") 'winner-undo)
(evil-define-key 'normal 'global (kbd "<leader>wr") 'winner-redo)
;; Atajos para cambiar entre major modes
(evil-define-key 'normal 'global (kbd "<leader>mh") 'html-mode)
(evil-define-key 'normal 'global (kbd "<leader>mj") 'js-mode)
(evil-define-key 'normal 'global (kbd "<leader>mp") 'php-mode)
;; Atajo para abrir vterm
(evil-define-key 'normal 'global (kbd "<leader>tt") 'multi-vterm-dedicated-toggle)
(evil-define-key 'normal 'global (kbd "<leader>tf") 'multi-vterm)
(evil-define-key 'normal 'global (kbd "<leader>tp") 'multi-vterm-project)
;; Cambiar el cursor según el estado
(setq evil-emacs-state-cursor 'bar)
(setq evil-motion-state-cursor 'bar)
(setq evil-normal-state-cursor 'box)
(setq evil-visual-state-cursor 'box)
(setq evil-insert-state-cursor 'bar)
(setq evil-replace-state-cursor 'hollow)
(setq evil-operator-state-cursor 'hollow)
;; Establecer modos por defecto en algunos modos
(evil-set-initial-state 'shell-mode 'insert)
(evil-set-initial-state 'vterm-mode 'emacs)
(evil-set-initial-state 'term-mode 'emacs)
(evil-set-initial-state 'help-mode 'emacs)
(evil-set-initial-state 'helm-grep-mode 'emacs)
(evil-set-initial-state 'grep-mode 'emacs)
(evil-set-initial-state 'dired-mode 'emacs)
(evil-set-initial-state 'Buffer-menu-mode 'emacs)
(evil-set-initial-state 'wdired-mode 'normal)
;; Por defecto usar emcas mode.
;;(setq evil-default-state 'emacs)
)
;; Edición múltiple con evil (Atajos por defecto: C-d y C-D)
(use-package evil-multiedit
:defer t
:config
(evil-multiedit-default-keybinds)
)
;; evil keybinding
(use-package evil-collection
:custom (evil-collection-setup-minibuffer t)
:init (evil-collection-init))
;; Barra lateral de archivos
(use-package treemacs
:defer t
:ensure t
:hook (treemacs-mode . (lambda() (display-line-numbers-mode -1)))
:bind ([mouse-1] . treemacs-single-click-expand-action)
:config
(progn
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0)
treemacs-deferred-git-apply-delay 0.5
treemacs-directory-name-transformer #'identity
treemacs-display-in-side-window t
treemacs-eldoc-display 'simple
treemacs-file-event-delay 5000
treemacs-file-extension-regex treemacs-last-period-regex-value
treemacs-file-follow-delay 0.2
treemacs-file-name-transformer #'identity
treemacs-follow-after-init t
treemacs-expand-after-init t
treemacs-find-workspace-method 'find-for-file-or-pick-first
treemacs-git-command-pipe ""
treemacs-goto-tag-strategy 'refetch-index
treemacs-indentation 2
treemacs-indentation-string " "
treemacs-is-never-other-window nil
treemacs-max-git-entries 5000
treemacs-missing-project-action 'ask
treemacs-move-forward-on-expand nil
treemacs-no-png-images nil
treemacs-no-delete-other-windows t
treemacs-project-follow-cleanup nil
treemacs-persist-file (expand-file-name "cache/treemacs-persist" private-dir)
treemacs-position 'left
treemacs-read-string-input 'from-child-frame
treemacs-recenter-distance 0.1
treemacs-recenter-after-file-follow nil
treemacs-recenter-after-tag-follow nil
treemacs-recenter-after-project-jump 'always
treemacs-recenter-after-project-expand 'on-distance
treemacs-litter-directories '("/node_modules" "/.venv" "/.cask")
treemacs-show-cursor nil
treemacs-show-hidden-files t
treemacs-silent-filewatch nil
treemacs-silent-refresh nil
treemacs-sorting 'alphabetic-asc
treemacs-select-when-already-in-treemacs 'move-back
treemacs-space-between-root-nodes t
treemacs-tag-follow-cleanup t
treemacs-tag-follow-delay 1.5
treemacs-text-scale nil
treemacs-user-mode-line-format nil
treemacs-user-header-line-format nil
treemacs-wide-toggle-width 70
treemacs-width 35
treemacs-width-increment 1
treemacs-width-is-initially-locked t
treemacs-workspace-switch-cleanup nil)
;; The default width and height of the icons is 22 pixels. If you are
;; using a Hi-DPI display, uncomment this to double the icon size.
;;(treemacs-resize-icons 44)
(treemacs-follow-mode t)
(treemacs-filewatch-mode t)
(treemacs-fringe-indicator-mode 'always)
(pcase (cons (not (null (executable-find "git")))
(not (null treemacs-python-executable)))
(`(t . t)
(treemacs-git-mode 'deferred))
(`(t . _)
(treemacs-git-mode 'simple)))
(treemacs-hide-gitignored-files-mode nil))
:bind
(:map global-map
("M-0" . treemacs-select-window)
("C-x t 1" . treemacs-delete-other-windows)
("<f9>" . treemacs)
("<f8>" . treemacs-display-current-project-exclusively)
("<f7>" . treemacs-add-and-display-current-project)
("C-x t d" . treemacs-select-directory)
("C-x t B" . treemacs-bookmark)
("C-x t C-t" . treemacs-find-file)
("C-x t M-t" . treemacs-find-tag)))
(use-package treemacs-evil
:defer t
:after (treemacs evil)
:ensure t
:config
;; Atajos de tecla con leader key de evil-mode.
(evil-set-leader 'treemacs (kbd "SPC"))
(evil-define-key 'treemacs 'global (kbd "<leader>b") 'ivy-switch-buffer)
(evil-define-key 'treemacs 'global (kbd "<leader>v") 'counsel-projectile)
(evil-define-key 'treemacs 'global (kbd "<leader>p") 'counsel-projectile)
(evil-define-key 'treemacs 'global (kbd "<leader>cp") 'treemacs-projectile)
(evil-define-key 'treemacs 'global (kbd "<leader>d") 'treemacs-remove-project-from-workspace))
(use-package treemacs-projectile
:defer t
:after (treemacs projectile)
:ensure t)
(use-package treemacs-icons-dired
:defer t
:hook (dired-mode . treemacs-icons-dired-enable-once)
:ensure t)
(use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode
:defer t
:after (treemacs persp-mode) ;;or perspective vs. persp-mode
:ensure t
:config (treemacs-set-scope-type 'Perspectives))
(use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode
:defer t
:after (treemacs)
:ensure t
:config (treemacs-set-scope-type 'Tabs))
;; Code Folding
(use-package origami
:defer t
:config
(global-origami-mode))
;; Automcompletado
(use-package company
:defer t
:bind (:map company-active-map
("<tab>" . company-indent-or-complete-common)) ; autocompletar con tab como se haría en bash-competition en la terminal de linux
(:map company-active-map
("<escape>" . company-abort)) ; cerrar las sugerencias de autocompletado precionando escape.
:config
(global-company-mode)
(setq company-dabbrev-downcase nil) ; autocompletado case-sensitive.
(setq company-idle-delay 0) ; mostrar autocompletado lo más rápido posible
(setq company-minimum-prefix-length 1) ; mostrar autocompletado desde que se coloca la primera letra.
(setq company-backends '((company-files :with company-yasnippet)
(company-capf :with company-yasnippet)
(company-dabbrev-code company-gtags company-etags company-keywords :with company-yasnippet)
(company-dabbrev :with company-yasnippet)))
)
;; Poner la info acerca del autocompletado del autocompletado mas rápido
(use-package company-quickhelp
:defer t
:ensure t
:custom
(company-quickhelp-delay 2)
(company-quickhelp-mode))
;; Hacer que el autocompletado se vea más bonito con íconos
(use-package company-box
:defer t
:hook (company-mode . company-box-mode))
;; Usar autocompletado con ctags y company
(use-package company-ctags
:config
(add-to-list 'company-backends '(company-ctags))
)
;; Snippets
(use-package yasnippet
:defer t
:ensure t
:custom
(yas-prompt-functions '(yas-completing-prompt))
:config
(yas-reload-all)
:hook
((prog-mode feature-mode) . yas-minor-mode))
;; Restaurar el estado de los frames
(use-package winner
:init
(winner-mode 1))
(use-package lsp-mode
:defer t
:hook (js-mode . lsp-deferred)
:custom
(lsp-headerline-breadcrumb-enable nil))
(use-package lsp-ui)
;; Revisar sintaxis en vivo
(use-package flycheck
;; :diminish flycheck-mode
:defer t
:hook (after-init . global-flycheck-mode) ; Habilitar flycheck en todos los modos
)
;; Mostrar los errores de flycheck en un pop up
(use-package flycheck-popup-tip
:defer t
:hook (flycheck-mode . flycheck-popup-tip-mode))
;; Un bonito y sencillo panel de inicio
(use-package dashboard
:config
(setq dashboard-set-file-icons t)
(setq dashboard-startup-banner
(expand-file-name "duck-small.png" user-emacs-directory))
(setq dashboard-items '(
;;(recents . 5)
;;(projects . 5)
))
(dashboard-setup-startup-hook)
)
;; Autocompletado para shell scripting.
(use-package company-shell
:defer t
:config
(add-to-list 'company-backends '(company-shell company-shell-env company-fish-shell))
)
;; Autocompletado para el minibuffer (counsel e ivy)
(use-package counsel
:defer t
:bind
("M-x" . counsel-M-x)
("C-x C-m" . counsel-M-x)
("C-x C-f" . counsel-find-file)
("C-x c k" . counsel-yank-pop))
(use-package projectile
:defer t
:diminish projectile-mode
:config
(projectile-mode)
:custom ((projectile-completion-system 'ivy))
:bind-keymap
("C-c p" . projectile-command-map)
:init
;; Rutas de archivos temporales.
(setq projectile-cache-file (expand-file-name "projectile.cache" temp-dir))
(setq projectile-known-projects-file (expand-file-name
"projectile-bookmarks.eld" temp-dir))
;; Carpetas donde tienes tus proyectos (deben tener un archivo .projectile o un repro git iniciado).
(when (file-directory-p "~/Proyectos")
(setq projectile-project-search-path '("~/Proyectos")))
(when (file-directory-p "~/Docker/Nginx")
(setq projectile-project-search-path (append
projectile-project-search-path
'("~/Docker/Nginx"))))
(when (file-directory-p "~/Docker/Nginx2")
(setq projectile-project-search-path (append
projectile-project-search-path
'("~/Docker/Nginx2"))))
(when (file-directory-p "~/Docker/NginxTwitch")
(setq projectile-project-search-path (append
projectile-project-search-path
'("~/Docker/NginxTwitch"))))
(setq projectile-switch-project-action #'projectile-dired) ; Usar dired cuando se elija un proyecto.
;; Cambiar el título de la ventana de emacs
(setq frame-title-format
'(
(:eval
(let ((project-name (projectile-project-name)))
(unless (string= "-" project-name)
(format "[%s] " project-name))))
"%b"
" - Emacs")
)
)
;; Autocompletado de proyectos en counsel (projectile)
(use-package counsel-projectile
:defer t
:config
(global-set-key (kbd "C-x v") 'counsel-projectile)
(counsel-projectile-mode))
;; Mostrar info del panel inferior de otra manera
(use-package ivy
:defer t
:bind
("C-x s" . swiper)
("C-x C-r" . ivy-resume)
("C-x b" . ivy-switch-buffer)
:config
(ivy-mode 1)
(setq ivy-use-virtual-buffers nil)
(define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial)
(define-key read-expression-map (kbd "C-r") 'counsel-expression-history)
(define-key ivy-minibuffer-map (kbd "<escape>") 'minibuffer-keyboard-quit)
)
;; Iconos en Ivy (allthe icons)
(use-package all-the-icons-ivy-rich
:ensure t
:init (all-the-icons-ivy-rich-mode 1)
:config
(setq all-the-icons-ivy-rich-color-icon t))
(use-package ivy-rich
:ensure t
:init (ivy-rich-mode 1))
;; Cuando iniicias un atajo de teclas te muestra las posibilidades
(use-package which-key
:config
(which-key-mode))
;; Autocompletado de parentesis, corchetes, llaves, etc.
(use-package smartparens
:config
(smartparens-global-mode t))
;; Org-Mode
(defun efs/org-font-setup ()
"ORG font faces setup."
;; Set faces for heading levels
(dolist (face '((org-level-1 . 1.2)
(org-level-2 . 1.1)
(org-level-3 . 1.05)
(org-level-4 . 1.0)
(org-level-5 . 1.1)
(org-level-6 . 1.1)
(org-level-7 . 1.1)
(org-level-8 . 1.1)))
(set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face)))
;; Ensure that anything that should be fixed-pitch in Org files appears that way
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
(set-face-attribute 'line-number nil :inherit 'fixed-pitch)
(set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch))
(defun efs/org-mode-setup ()
"Set some configs on 'org-mode'."
(display-line-numbers-mode 0)
(org-indent-mode)
(variable-pitch-mode 1)
(visual-line-mode 1)
(setq evil-auto-indent nil)
)
(use-package org
:defer t
:pin org
:hook (org-mode . efs/org-mode-setup)
:config
(setq org-ellipsis "")
(setq org-hide-emphasis-markers t)
(setq org-agenda-start-with-log-mode t)
(setq org-log-done 'time)
(setq org-log-into-drawer t)
;; Palabras claves del To Do de org-mode
(setq org-todo-keywords
;;'((sequence "☐" "✔" "⌛" "❌")))
'((sequence "TODO(t)" "DOING(n)" "WAITING(w)" "|" "DONE(d!)" "CANCELED(c!)")))
(setq org-todo-keyword-faces
'(("TODO" . "#ff6464")
("DOING" . "yellow")
("DONE" . "green")
("WAITING" . "orange")
("CANCELED" . "#aaa"))
)
;; Archivos a usarse en org-agenda
(setq org-agenda-files
'("~/Proyectos/ORGenda/Ideas.org"
"~/Proyectos/ORGenda/IdeasTwitch.org"
"~/Proyectos/ORGenda/Proyectos.org"
"~/Proyectos/ORGenda/Tareas.org")
)
;; Archivos entre los que se moverán las tareas
(setq org-refile-targets
'(("Archivo.org" :maxlevel . 1)
("Proyectos.org" :maxlevel . 1)
("IdeasTwitch.org" :maxlevel . 1)
("Ideas.org" :maxlevel . 1)
("Tareas.org" :maxlevel . 1)))
;; Guardar los archivos cuando se muevan tareas entre ellos
(advice-add 'org-refile :after 'org-save-all-org-buffers)
(setq org-capture-templates
`(("t" "Tareas / Projectos")
("tt" "Tareas" entry (file+olp "~/Proyectos/ORGenda/Tareas.org")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
("tp" "Proyectos" entry (file+olp "~/Proyectos/ORGenda/Proyectos.org")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
("i" "Ideas")
("ii" "Ideas General" entry
(file+olp "~/Proyectos/ORGenda/ideas.org")
"* TODO %?\n %a\n %i" :empty-lines 1)
("it" "Ideas Twitch" entry
(file+olp "~/Proyectos/ORGenda/IdeasTwitch.org")
"* TODO %?\n %a\n %i" :empty-lines 1)
)
)
(efs/org-font-setup))
(use-package org-superstar
:hook
(org-mode . org-superstar-mode)
:config
(setq org-superstar-special-todo-items t)
)
(defun efs/org-mode-visual-fill ()
"Visual mode fill columns."
(visual-fill-column-mode 1))
(use-package visual-fill-column
:hook (org-mode . efs/org-mode-visual-fill)
:config
;; Tamaño de la columna
(setq visual-fill-column-width 150)
;; Centrar el texto
(setq-default visual-fill-column-center-text t)
)
(provide 'base-extensions)
;;; base-extensions.el ends here

View File

@ -1,46 +0,0 @@
(provide 'base-functions)
;; Buscar el texto actualmente seleccionado
(defun kj-isearch-with-region ()
"Use region as the isearch text."
(when mark-active
(let ((region (funcall region-extract-function nil)))
(deactivate-mark)
(isearch-push-state)
(isearch-yank-string region))))
(add-hook 'isearch-mode-hook #'kj-isearch-with-region)
;; Borrar espacios, tabs y saltos de línea innecesarios al guardar
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Generar archivo TAGS
(defun create-tags (dir-name)
"Create tags file."
(interactive "DDirectory: ")
(shell-command
(format "cd '%s' && ctags -f TAGS -e -R --exclude=*.min.js"
(directory-file-name (file-truename dir-name))
)
)
(message "Archivo TAGS generado.")
)
;; Hacer emacs transparente (no funciona perfecto, pero sirve)
(defun toggle-transparency ()
(interactive)
(let ((alpha (frame-parameter nil 'alpha)))
(set-frame-parameter
nil 'alpha
(if (eql (cond ((numberp alpha) alpha)
((numberp (cdr alpha)) (cdr alpha))
;; Also handle undocumented (<active> <inactive>) form.
((numberp (cadr alpha)) (cadr alpha)))
100)
'(60 . 60) '(100 . 100)))))
(defun transparency (value)
"Sets the transparency of the frame window. 0=transparent/100=opaque"
(interactive "nTransparency Value 0 - 100 opaque:")
(set-frame-parameter (selected-frame) 'alpha value))

View File

@ -1,29 +0,0 @@
;;; base-keys.el --- Archivo de configuración de atajos
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Aquí se configuran los atajos globales.
;; Es posible que haya otros, ya que muchos se configuran
;; directamente en los paquetes/extensiones y dependen de los mismos.
;;; Code:
(define-key minibuffer-local-map (kbd "<escape>")
'keyboard-escape-quit) ; Cancelar el minibuffer con un solo ESC.
(global-set-key (kbd "C-x C-z") nil) ; Unbind C-x C-z (don't minimize)
(global-set-key (kbd "C-a") 'mark-whole-buffer) ; Seleccionar todo con CTRL+A.
(global-set-key (kbd "M-c") 'comment-or-uncomment-region) ; Comentar/descomentar en lote
(global-set-key (kbd "C-<f6>") 'create-tags) ; Generar o Regeneral el archivo TAGS
(global-set-key (kbd "C-<f11>") 'toggle-frame-maximized) ; Maximizar / restaurar
(global-set-key (kbd "C-c a") 'org-agenda) ; Abrir la agenda.
(global-set-key (kbd "C-c c") 'org-capture) ; Abrir la crear una entrada.
(provide 'base-keys)
;;; base-keys.el ends here

View File

@ -1,135 +0,0 @@
;;; base.el --- Configuración base de emacs
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Configuración base de Emacs, no incluye extensiones,
;; pero si el theme y los fonts.
;;; Code:
;; The default is 800 kilobytes. Measured in bytes.
(setq gc-cons-threshold (* 50 1000 1000))
;; Native compilation
(when (and (fboundp 'native-comp-available-p)
(native-comp-available-p))
(progn
(setq native-comp-async-report-warnings-errors nil)
(setq comp-deferred-compilation t)
(add-to-list 'native-comp-eln-load-path (expand-file-name "private/cache/eln-cache/" user-emacs-directory))
(setq package-native-compile t)
))
;; Initialize package sources
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/")))
(package-initialize)
;; Actualizar repositorios si aún no esta actualizados
(unless package-archive-contents
(package-refresh-contents))
;; Instalar use-package si no está instalado
(unless (package-installed-p 'use-package)
(package-install 'use-package))
;; Theme
(use-package dracula-theme
:config
(load-theme 'dracula t)
(set-face-attribute 'default nil :font "Fira Code Retina" :height 112) ; Font
)
;; Instalar use-package en caso de no tenerlo
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(defconst private-dir (expand-file-name "private" user-emacs-directory))
(defconst temp-dir (format "%s/cache" private-dir)
"Hostname-based elisp temp directories.")
;; UTF-8 please
(set-charset-priority 'unicode)
(setq locale-coding-system 'utf-8) ; pretty
(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 default-process-coding-system '(utf-8-unix . utf-8-unix))
;; Emacs customizations
(menu-bar-mode 0) ; Quitar menús.
(tool-bar-mode 0) ; Quitar toolbar.
(scroll-bar-mode -1) ; Quitar scrollbar.
(tooltip-mode -1) ; Disable tooltips.
(global-display-line-numbers-mode) ; Mostar número de línea.
(show-paren-mode 1) ; Habilitar resaltado de brackets.
;;(cua-mode t) ; Usar CTRL+X, CTRL+C, CTRL+V y CTRL+Z para cortar, copiar, pegar y deshacer.
(setq-default
cursor-type 'bar ; Usar la barrita como cursor
cursor-in-non-selected-windows nil ; Desaparecer el cursor en frames no activos.
indent-tabs-mode nil ; Cambiar tabs por espacios.
inhibit-startup-message t ; Eliminar el mensaje de inicio.
)
(setq
custom-file (concat private-dir "/.custom.el") ; Cabiar la ruta del código que se genera al isntalar un theme o package
ac-ignore-case nil ; Desactivar el autocapitalizado.
ac-disable-faces nil ; Auto-complete hablitado incluso entre comillas (fuente: https://bit.ly/3a9wCB4).
global-hl-line-mode 1 ; Resaltar línea actual por defecto.
tags-revert-without-query 1 ; Recargar tags (ctags) sin pedir confirmación.
)
;; Backups enabled, use nil to disable
(setq
history-length 1000
backup-inhibited nil
make-backup-files nil
auto-save-default nil
auto-save-list-file-name (concat temp-dir "/autosave")
create-lockfiles nil
backup-directory-alist `((".*" . ,(concat temp-dir "/backup/")))
auto-save-file-name-transforms `((".*" ,(concat temp-dir "/auto-save-list/") t)))
;; Configuración cuando es un server
(defun setup-daemon ()
(message "Corriendo en modo daemon.")
(set-face-attribute 'default nil :font "Fira Code Retina")
;; Set the fixed pitch face
;;(set-face-attribute 'fixed-pitch nil :font "Fira Code Retina")
;; Set the variable pitch face
;;(set-face-attribute 'variable-pitch nil :font "Cantarell" :weight 'regular)
;; Abrir primero el dashboard
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
;; Cerrar buffers al cerrar emacsclient
(add-hook 'delete-frame-functions
(lambda (frame)
(let* ((window (frame-selected-window frame))
(buffer (and window (window-buffer window))))
(when (and buffer (buffer-file-name buffer))
(kill-buffer buffer)))))
)
(if (daemonp)
(add-hook 'after-make-frame-functions
(lambda (frame)
(with-selected-frame frame
(setup-daemon))))
(message "Corriendo en modo normal."))
(load custom-file)
(provide 'base)
;;; base.el ends here

149
configs/init-base.el Normal file
View File

@ -0,0 +1,149 @@
;;; init-base.el --- Configuración base de emacs -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Configuración general de Emacs.
;; No incluye paquetes/extensiones, solo configuraciones generales.
;;; Code:
;; Native compilation
(when (and (fboundp 'native-comp-available-p)
(native-comp-available-p))
(progn
(setq native-comp-async-report-warnings-errors nil)
(setq comp-deferred-compilation t)
(setq package-native-compile t)
))
;; Instalar elpaca.el (reemplpazando package.el)
(defvar elpaca-installer-version 0.7)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
:ref nil
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
:build (:not elpaca--activate-package)))
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
(build (expand-file-name "elpaca/" elpaca-builds-directory))
(order (cdr elpaca-order))
(default-directory repo))
(add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo)
(make-directory repo t)
(when (< emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (call-process "git" nil buffer t "clone"
(plist-get order :repo) repo)))
((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo)))
(progn (message "%s" (buffer-string)) (kill-buffer buffer))
(error "%s" (with-current-buffer buffer (buffer-string))))
((error) (warn "%s" err) (delete-directory repo 'recursive))))
(unless (require 'elpaca-autoloads nil t)
(require 'elpaca)
(elpaca-generate-autoloads "elpaca" repo)
(load "./elpaca-autoloads")))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
;; Instalar use-package si no está instalado
(elpaca elpaca-use-package
;; Enable :elpaca use-package keyword.
(elpaca-use-package-mode)
;; Assume :elpaca t unless otherwise specified.
(setq elpaca-use-package-by-default t))
;; Block until current queue processed.
(elpaca-wait)
(defconst private-dir (expand-file-name "private" user-emacs-directory))
(defconst temp-dir (format "%s/cache" private-dir)
"Hostname-based elisp temp directories.")
;; UTF-8 please
(set-charset-priority 'unicode)
(setq locale-coding-system 'utf-8) ; pretty
(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 default-process-coding-system '(utf-8-unix . utf-8-unix))
;; Emacs customizations
(when (display-graphic-p)
(scroll-bar-mode -1) ; Quitar scrollbar.
)
(tooltip-mode -1) ; Disable tooltips.
(global-display-line-numbers-mode) ; Mostar número de línea.
(show-paren-mode 1) ; Habilitar resaltado de brackets.
(pending-delete-mode t) ; Cuando selecciono un texto y escribo, el texto se borra (emacs por defecto solo escribe donde está el cursor).
;; (global-hl-line-mode) ; Resaltar línea actual por defecto.
(setq use-short-answers t) ; Usar respuesta cortas (y/n) en lugar de las largas (yes/no)
(setq-default
cursor-type 'bar ; Usar la barrita como cursor
cursor-in-non-selected-windows nil ; Desaparecer el cursor en frames no activos.
indent-tabs-mode nil ; Cambiar tabs por espacios.
inhibit-startup-message t ; Eliminar el mensaje de inicio.
)
(setq
custom-file (concat private-dir "/.custom.el") ; Cabiar la ruta del código que se genera al isntalar un theme o package
ac-ignore-case nil ; Desactivar el autocapitalizado.
ac-disable-faces nil ; Auto-complete hablitado incluso entre comillas (fuente: https://bit.ly/3a9wCB4).
tags-revert-without-query 1 ; Recargar tags (ctags) sin pedir confirmación.
)
;; Leve transparencia en emacs por defecto.
;; (set-frame-parameter nil 'alpha-background 95)
;; Font por defecto
(set-face-attribute 'default nil :font "Fira Code Retina" :height 112)
;; Backups enabled, use nil to disable
(setq
history-length 1000
backup-inhibited nil
make-backup-files nil
auto-save-default nil
auto-save-list-file-name (concat temp-dir "/autosave")
create-lockfiles nil
backup-directory-alist `((".*" . ,(concat temp-dir "/backup/")))
auto-save-file-name-transforms `((".*" ,(concat temp-dir "/auto-save-list/") t)))
;; Configuración cuando es un server
(defun setup-daemon ()
"Carga la configuración del modo daemon."
(message "Corriendo en modo daemon.")
(set-face-attribute 'default nil :font "Fira Code Retina" :height 112)
;; Abrir primero el dashboard
(setq initial-buffer-choice (lambda ()
(get-buffer "*dashboard*")
(dashboard-refresh-buffer)))
;; Cerrar buffers al cerrar emacsclient
;; (add-hook 'delete-frame-functions
;; (lambda (frame)
;; (mapc 'kill-buffer (delq (get-buffer "*dashboard*") (buffer-list)))
;; ))
)
(if (daemonp)
(add-hook 'after-make-frame-functions
(lambda (frame)
(with-selected-frame frame
(setup-daemon))))
(message "Corriendo en modo normal."))
(add-hook 'elpaca-after-init-hook (lambda () (load custom-file 'noerror)))
(provide 'init-base)
;;; init-base.el ends here

86
configs/init-corfu.el Normal file
View File

@ -0,0 +1,86 @@
;;; init-corfu.el --- Autocompletado con corfu -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Archivo de configuración específico para el paquete corfu.
;; Corfu, de manera resumida, es el que nos muestra el autocompletado
;; en Emacs, tanto para código como para otro tipo de textos.
;;
;; Este paquete viene a ser una alternativa a Company, por lo
;; que no se deberían activar los 2 al mismo tiempo.
;;; Code:
(use-package corfu
:defer t
:ensure (:files (:defaults "extensions/*")
:includes (corfu-info corfu-history))
:hook ((elpaca-after-init . global-corfu-mode)
(corfu-mode . corfu-popupinfo-mode))
:bind (:map corfu-map
("<tab>" . corfu-quit)
("<escape>" . corfu-quit)
("<SPC>" . corfu-insert-separator))
:custom
(corfu-auto t)
:config
(setq corfu-popupinfo-delay 0
corfu-auto-delay 0.5
corfu-auto-prefix 1
corfu-cycle t
corfu-preview-current nil
corfu-quit-no-match t)
)
;; Cambia la forma de mostrar y buscar sugerencias (afecta a corfu, pero también a otros como vertico).
(use-package orderless
:defer t
:init
(setq completion-styles '(flex orderless basic)
completion-category-overrides '((file (styles partial-completion)))))
;; Set de funciones de para las sugerencias de corfu.
(use-package cape
:defer t
:ensure (:host github :repo "minad/cape")
:after corfu
:bind (("C-c f" . cape-file)
("C-c l" . cape-line)
("C-c _" . cape-tex))
:init
;; (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
(advice-add #'eglot-completion-at-point :around #'cape-wrap-nonexclusive)
;; (add-to-list 'completion-at-point-functions #'cape-line) ;; Completar línea actual en función de lo que dice otras líneas de buffer.
;; (add-to-list 'completion-at-point-functions #'cape-tex) ;; Completar Latex (caracteres unicode).
(add-to-list 'completion-at-point-functions #'cape-dict) ;; Completar desde un diccionario (por defecto toma el de linux que está en /usr/share/dict/words).
(add-to-list 'completion-at-point-functions #'cape-dabbrev) ;; Completar desde otras la palabras del buffer.
(add-to-list 'completion-at-point-functions #'cape-abbrev) ;; Completar desde una abreviaciónes configuradas con add-global-abbrev (añadir abreviación global) o add-mode-abbrev (abreviación para el modo actual).
(add-to-list 'completion-at-point-functions #'cape-file) ;; Completar rutas de archivos.
(add-to-list 'completion-at-point-functions #'cape-keyword) ;; Completar desde keyword del lenguaje.
)
;; Hacer que corfu funcione en la terminal
(unless (display-graphic-p)
(use-package corfu-terminal
:after corfu
:ensure (:repo "https://codeberg.org/akib/emacs-corfu-terminal.git")
:config
(corfu-terminal-mode +1))
)
;; Iconos en corfu
(use-package kind-icon
:ensure t
:after corfu
:custom
(kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly
:config
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
(provide 'init-corfu)
;;; init-corfu.el ends here

69
configs/init-ctags.el Normal file
View File

@ -0,0 +1,69 @@
;;; init-ctags.el --- Configuracíón de TAGS -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;;; Code:
;; En esta sección está la configuración para ctags.
;; Quizá con la aparición de lsp sea menos necesaria,
;; pero dado a que sigue teniendo potencial para aportar
;; además de tener un rendimiento muy bueno es mejor
;; no dejarla de lado.
;; Ctags IDE on the True Editor
;; @see https://github.com/universal-ctags/citre#quick-start
(use-package citre
:defer t
:ensure t
:diminish
:bind (("C-x c ." . citre-jump)
("C-x c ," . citre-jump-back)
("C-x c p" . citre-peek)
("C-x c a" . citre-ace-peek)
("C-x c u" . citre-update-this-tags-file))
:init
(setq citre-auto-enable-citre-mode-modes '(prog-mode)
citre-default-create-tags-file-location 'global-cache
citre-prompt-language-for-ctags-command t)
:config
(with-no-warnings
;; Integrate with `lsp-mode' and `eglot'
(define-advice xref--create-fetcher (:around (fn &rest args) fallback)
(let ((fetcher (apply fn args))
(citre-fetcher
(let ((xref-backend-functions '(citre-xref-backend t)))
(ignore xref-backend-functions)
(apply fn args))))
(lambda ()
(or (with-demoted-errors "%s, fallback to citre"
(funcall fetcher))
(funcall citre-fetcher)))))
(defun lsp-citre-capf-function ()
"A capf backend that tries lsp first, then Citre."
(let ((lsp-result (if (fboundp #'eglot-completion-at-point)
(eglot-completion-at-point)
(when (fboundp #'lsp-completion-at-point)
(lsp-completion-at-point)))))
(if (and lsp-result
(try-completion
(buffer-substring (nth 0 lsp-result)
(nth 1 lsp-result))
(nth 2 lsp-result)))
lsp-result
(citre-completion-at-point))))
(defun enable-lsp-citre-capf-backend ()
"Enable the lsp + Citre capf backend in current buffer."
(add-hook 'completion-at-point-functions #'lsp-citre-capf-function nil t))
(add-hook 'citre-mode-hook #'enable-lsp-citre-capf-backend)
))
(provide 'init-ctags)
;;; init-ctags.el ends here

83
configs/init-eglot.el Normal file
View File

@ -0,0 +1,83 @@
;;; init-eglot.el --- Configuración de eglot (LSP) -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Este archivo tiene todo lo relacionado con eglot.
;; Eglot es un cliente LSP para Emacs que desde la
;; versión 29 viene integrado dentro del mismo.
;;
;; El nombre Eglot es un apócope de "Emacs polyglot"
;; ya que con este cliente podemos añadir soporte para
;; muchísimos lenguajes, puesto que actualente el que
;; un lenguaje tenga su propio LSP es muy normal.
;;
;; Como añadido:
;;
;; Un Languaje Server Provider (LSP), es un protocolo
;; mediante el cual existen servidores para lenguajes
;; en específico, los cuales proveen cosas como el
;; autocompletado, linting, documentación, ir a la
;; definición, etc.
;;
;; Este protocolo viene a solucionar el problema de
;; que cada herramienta de programación tenga que
;; volver a crear su propio soporte para cada uno
;; de los lenguajes (DRY).
;;; Code:
(use-package eglot
:defer t
;; :ensure nil
:hook ((css-mode . eglot-ensure)
(html-mode . eglot-ensure)
(php-mode . eglot-ensure)
(rust-mode . eglot-ensure)
(sh-mode . eglot-ensure))
:config
(setq eglot-sync-connect 0)
)
;; Mejorar la velocidad de eglot (un binario en rust )
(use-package eglot-booster
:defer t
:ensure (:host github :repo "jdtsmith/eglot-booster")
:after eglot
:config
;;
(if (executable-find "emacs-lsp-booster")
(eglot-booster-mode)
(message "No está instalado emacs-lsp-booster. Eglot se usará de modo normal."))
)
;; Emmet (mientras veo como hacer funcionar emmet-ls)
(use-package emmet-mode
:defer t
:hook
((html-mode . emmet-mode)
(web-mode . emmet-mode))
)
;; Revisar por errores en el código
(use-package flymake
:defer t
:ensure nil
:hook (prog-mode . (lambda ()
(unless (derived-mode-p 'makefile-mode)
(flymake-mode))))
:config
(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)
)
;; Mostar los errores de flymake en un popup-tip
(use-package flymake-diagnostic-at-point
:defer t
:ensure t
:after flymake
:hook (flymake-mode . flymake-diagnostic-at-point-mode))
(provide 'init-eglot)
;;; init-eglot.el ends here

122
configs/init-evil.el Normal file
View File

@ -0,0 +1,122 @@
;;; init-evil.el --- VIM dentro de emacs -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; En este archivo está toda la configuración relacionada
;; con el paquete Evil.
;;
;; Evil es un paquete para Emacs, que básicamente nos
;; permite tener VIM dentro de Emacs.
;;; Code:
(use-package evil
:defer t
:hook (elpaca-after-init . evil-mode)
:config
;; Configuraciones básicas
;; (setq evil-default-state 'emacs) ;; Modo por defecto en emacs
(setq evil-default-state 'insert) ;; Modo por defecto en emacs
(setq evil-emacs-state-cursor 'bar) ;; Cursor de emacs state en bar
;; (setq evil-normal-state-cursor 'bar) ;; Cursor de normal state en bar en lugar de box
(evil-set-leader 'motion (kbd "SPC")) ;; Leader key
(evil-set-undo-system 'undo-redo)
;; Habilitar atajos de de tecla de emacs en insert state
(setq evil-insert-state-map (make-sparse-keymap))
;; (evil-define-key 'normal 'global (kbd "<escape>") 'corfu-quit)
;; Cambiar a mode emacs con escape
;; (evil-define-key 'emacs 'global (kbd "<escape>") 'evil-normal-state)
;; Cambiar Insert state por emacs state.
;; (defalias 'evil-insert-state 'evil-emacs-state)
;; Variales locales (todos los estados o solo los estados de VIM)
(setq all-states '(normal insert visual replace operator motion emacs))
(setq vim-states '(normal insert visual replace operator motion))
;; Cambiar entre modo emacs y evil (Mi pripio evil toggle)
;; (evil-define-key vim-states 'global (kbd "C-'") 'evil-emacs-state)
;; (evil-define-key 'emacs 'global (kbd "C-'") 'evil-normal-state)
;; Cambiar C-z a deshacer
(evil-define-key all-states 'global (kbd "C-z") 'undo)
;; Cambiar C-r a ripgrep y U hasta hacer redo
(evil-define-key vim-states 'global (kbd "C-r") 'consult-ripgrep)
(evil-define-key 'normal 'global (kbd "U") 'undo-redo)
(evil-define-key 'normal 'global (kbd "C-S-z") 'undo-redo)
(evil-define-key 'normal 'global (kbd "M-.") 'xref-find-definitions)
;; Arreglar yank-pop en normal mode
(evil-define-key 'normal 'global (kbd "M-y") 'consult-yank-pop)
;; Re-bindear keys a como funcionan en emacs.
(evil-define-key 'normal 'global (kbd "C-p") 'previous-line)
(evil-define-key 'normal 'global (kbd "C-n") 'next-line)
(evil-define-key 'normal 'global (kbd "C-e") 'move-end-of-line)
;; Navegación entre frames
(evil-define-key 'motion 'global (kbd "<leader>o") 'other-window)
;; Habilitar el scrolear con C-v como en emacs en evil
(evil-define-key 'motion 'global (kbd "C-v") 'scroll-up-command)
;; Añadir nueva linea sin salir del modo normal
(evil-define-key 'motion 'global (kbd "<leader><RET>") 'newline)
;; Abrir historial del kill-ring/portapapeles
(evil-define-key vim-states 'global (kbd "<leader>y") 'consult-yank-pop)
;; Expand region desde motion states
(evil-define-key 'motion 'global (kbd "<leader>+") 'er/expand-region)
;; Identado en motion modes.
(evil-define-key 'motion 'global (kbd "<tab>") 'indent-for-tab-command)
;; Atajos con leader key para frames
(evil-define-key 'motion 'global (kbd "<leader>0") 'delete-window)
(evil-define-key 'motion 'global (kbd "<leader>1") 'delete-other-windows)
(evil-define-key 'motion 'global (kbd "<leader>2") 'split-window-below)
(evil-define-key 'motion 'global (kbd "<leader>3") 'split-window-right)
(evil-define-key 'motion 'global (kbd "<leader>k") 'kill-buffer)
(evil-define-key 'motion 'global (kbd "<leader>wu") 'winner-undo)
(evil-define-key 'motion 'global (kbd "<leader>wr") 'winner-redo)
;; Cambios de modos
(evil-define-key 'normal 'global (kbd "<leader>mh") 'html-mode)
(evil-define-key 'normal 'global (kbd "<leader>mj") 'js-mode)
(evil-define-key 'normal 'global (kbd "<leader>mp") 'php-mode)
(evil-define-key 'normal 'global (kbd "<leader>mr") 'rust-mode)
(evil-define-key 'normal 'global (kbd "<leader>mw") 'web-mode)
;; Otros atajos
(evil-define-key 'motion 'global (kbd "<leader>xb") 'consult-buffer) ;; Cambiar de buffer
(evil-define-key 'motion 'global (kbd "<leader>xp") 'consult-project-extra-find) ;; Archivos del proyecto (o abrir proyecto si no hay alguno)
(evil-define-key 'motion 'global (kbd "<leader>cp") 'project-switch-project) ;; Cambiar proyecto
(evil-define-key 'motion 'global (kbd "<leader>xf") 'find-file) ;; Abrir archivo
(evil-define-key 'motion 'global (kbd "<leader>xr") 'consult-recent-file) ;; Lista de archivos recientes
(evil-define-key 'motion 'global (kbd "<leader>rg") 'consult-ripgrep) ;; Búsqueda rápida con ripgrep
(evil-define-key 'motion 'global (kbd "<leader>gi") 'imenu) ;; imenu
;; Iniciar en normal state si es un lenguaje de programación u org-mode
;; (evil-set-initial-state 'prog-mode 'normal)
;; (evil-set-initial-state 'org-mode 'normal)
(evil-set-initial-state 'dashboard-mode 'normal)
(evil-set-initial-state 'dired 'normal)
(evil-set-initial-state 'vterm-mode 'emacs)
)
;; Funciones y atajos de teclas especiales para evil cuando estamo en org-mode.
;; Por ejemplo, para que evil-open-below funcione similar a org-return cuando
;; estamos dentro de una lista.
(use-package evil-org
:ensure t
:defer t
:after org
:hook (org-mode . evil-org-mode))
(provide 'init-evil)
;;; init-evil.el ends here

93
configs/init-functions.el Normal file
View File

@ -0,0 +1,93 @@
;;; init-functions.el --- Configuración de org-mode -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Aqui se encuentran funciones sueltas de Emacs.
;;; Code:
;; Permite cambiar la transparencia de emacs.
(defun transparency (value)
"Change the transparency of the frame window, setting VALUE from 0 to 100."
(interactive "nTransparency Value 0 - 100 opaque:")
(set-frame-parameter nil 'alpha-background value))
;; Comentar línea o región
(defun comment-or-uncomment-region-or-line ()
"Comments or uncomments the region or the current line."
(interactive)
(let (beg end)
(if (region-active-p)
(setq beg (region-beginning) end (region-end))
(setq beg (line-beginning-position) end (line-end-position)))
(comment-or-uncomment-region beg end)
;;(next-line) ;; saltar a la siguiente línea
))
;; Duplicar la línea actual
(defun duplicate-current-line (&optional n)
"Duplicate current line, make more than 1 copy given a numeric (N) argument."
(interactive "p")
(save-excursion
(let ((nb (or n 1))
(current-line (thing-at-point 'line)))
;; when on last line, insert a newline first
(when (or (= 1 (forward-line 1)) (eq (point) (point-max)))
(insert "\n"))
;; now insert as many time as requested
(while (> n 0)
(insert current-line)
(decf n)))))
;; Borrar espacios, tabs y saltos de línea innecesarios al guardar
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Mostrar y ocultar el diff de la línea de git-gutter
(defun git-gutter:toggle-popup-hunk ()
"Toggle 'git-gutter' hunk window."
(interactive)
(if (and (get-buffer "*git-gutter:diff*") (window-live-p (git-gutter:popup-buffer-window)))
(delete-window (git-gutter:popup-buffer-window))
(git-gutter:popup-hunk)))
;; Obtener el nombre del proyecto desde project.el
(defun kj/project-name (&optional project)
"Return the name for PROJECT.
If PROJECT is not specified, assume current project root."
(when-let (root (or project (kj/project-root)))
(file-name-nondirectory
(directory-file-name
(file-name-directory root)))))
;; Obtener la raíz del proyecto desde project.el
(defun kj/project-root ()
"Return the current project root."
(when-let (project (project-current))
(project-root project)))
;; Cambia entre ocultar o no la barra de título cuando está maximizado
(defun toggle-hide-title-bar()
"Toggle hide title bar when the frame is maximed."
(interactive)
(if (and (boundp 'title-bar-maximixed) title-bar-maximixed)
(progn
(remove-hook 'window-size-change-functions 'frame-hide-title-bar-when-maximized)
(setq title-bar-maximixed nil))
(progn
(add-hook 'window-size-change-functions 'frame-hide-title-bar-when-maximized)
(setq title-bar-maximixed t)))
)
;; Creando un hook para luego de que el theme ha cargado
(defvar after-load-theme-hook nil
"Hook run after a color theme is loaded using `load-theme'.")
(defadvice load-theme (after run-after-load-theme-hook activate)
"Run `after-load-theme-hook'."
(run-hooks 'after-load-theme-hook))
(provide 'init-functions)
;;; init-functions.el ends here.

48
configs/init-keys.el Normal file
View File

@ -0,0 +1,48 @@
;;; init-keys.el --- Archivo de configuración de atajos -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Aquí se configuran los atajos de teclas generales.
;; Los atajos de teclas relacionados con paquetes en
;; específico estarán en el archivo donde se esté
;; configurando dicho paquete o dentro del paquete
;; mismo, para aquellos que vengan con atajos ya
;; configurados desde su instalación.
;;; Code:
(global-set-key (kbd "C-x C-z") nil) ; Unbind C-x C-z (don't minimize)
(global-set-key (kbd "C-z") 'undo) ; Unbind C-z y hacerlo funcionar para deshacer cambios
(global-set-key (kbd "C-S-z") 'undo-redo) ; Rehacer cambios con C-S-z
(global-set-key (kbd "C-S-c")
'comment-or-uncomment-region-or-line) ; Comentar/descomentar línea o selección
(global-set-key (kbd "C-<f11>") 'toggle-frame-maximized) ; Maximizar / restaurar
(global-set-key (kbd "C-S-d") 'duplicate-current-line) ; Duplicar línea
(global-set-key (kbd "<mouse-3>") 'context-menu-open) ; Abrir menú contextal al hacer clic derecho
;; Cambios rápidos de major modes
(global-set-key (kbd "C-x m") nil) ; Unbind mail on C-x m
(global-set-key (kbd "C-x mh") 'mhtml-mode)
(global-set-key (kbd "C-x mj") 'js-mode)
(global-set-key (kbd "C-x mp") 'php-mode)
(global-set-key (kbd "C-x mr") 'rust-mode)
(global-set-key (kbd "C-x mw") 'web-mode)
;; Cambiar de ventana
(global-set-key (kbd "C-S-o") 'other-window)
;; Saltar entre párrafos
(define-key global-map "\M-p" 'backward-paragraph)
(define-key global-map "\M-n" 'forward-paragraph)
;; Meta atajos (atajos de atajos)
;;(global-set-key (kbd "C-c l d") "\C-a\C- \C-n\M-w\C-y") ; Duplicar línea
;; Deactivar el abrir *messages* al cliquear en el minibuffer
(define-key minibuffer-inactive-mode-map [mouse-1] #'ignore)
(provide 'init-keys)
;;; init-keys.el ends here

158
configs/init-minibuffer.el Normal file
View File

@ -0,0 +1,158 @@
;;; init-minibuffer.el --- Ayuditas y autocompletado del minibufer -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Aquí se encuentran todos los paquetes que tienen como
;; objetivo mejorar el minibuffer de Emacs.
;;; Code:
;; UI para completado
(use-package vertico
:defer t
:bind (:map vertico-map
("RET" . vertico-directory-enter)
("DEL" . vertico-directory-delete-char)
("TAB" . minibuffer-complete)
("M-DEL" . vertico-directory-delete-word))
:hook ((elpaca-after-init . vertico-mode)
(elpaca-after-init . savehist-mode) ;; savehist sirve para recordar el último comando de M-x
(rfn-eshadow-update-overlay . vertico-directory-tidy))
:config
(setq read-file-name-completion-ignore-case t
read-buffer-completion-ignore-case t
completion-ignore-case t)
)
;; Reemplazo para counsel
(use-package consult
:defer t
:bind (;; C-c bindings in `mode-specific-map'
("C-s" . consult-line)
("C-r" . consult-ripgrep)
("C-S-s" . isearch-forward)
("C-S-r" . isearch-backward)
("M-m" . consult-mode-command)
("C-c h" . consult-history)
("C-c k" . consult-kmacro)
([remap Info-search] . consult-info)
([remap imenu] . consult-imenu)
([remap recentf-open-files] . consult-recent-file)
;; C-x bindings in `ctl-x-map'
("C-x M-." . consult-complex-command) ;; orig. repeat-complex-command
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
("C-c p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
("C-c p p" . project-switch-project) ;; orig. project-switch-to-buffer
;; Consult search
("C-c p f" . consult-find) ;; Búsqueda de archivos en todo el projecto incluso en carpetas
("C-c p l" . consult-line-multi) ;; Búsqueda en todos los buffers del projecto abiertos
;; Custom M-# bindings for fast register access
("C-'" . consult-register-load)
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
("M-¡" . consult-register)
;; Other custom bindings
("M-y" . consult-yank-pop) ;; orig. yank-pop
;; M-g bindings in `goto-map'
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
("M-g g" . consult-goto-line) ;; orig. goto-line
("M-g M-g" . consult-goto-line) ;; orig. goto-line
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
("M-g m" . consult-mark)
("M-g k" . consult-global-mark)
("M-g i" . consult-imenu)
("M-g I" . consult-imenu-multi)
;; Minibuffer history
:map minibuffer-local-map
("<escape>" . minibuffer-keyboard-quit) ;; Cacelar minibuffer con escape (más rápido que C-g)
("C-<return>" . newline) ;; Insertar nueva línea estando en el minibufer (Mas rápido que C-q C-j)
("C-s" . (lambda ()
"Insert the current symbol."
(interactive)
(insert (save-excursion
(set-buffer (window-buffer (minibuffer-selected-window)))
(or (thing-at-point 'symbol t) ""))))) ;; Al presionar por segunda ves C-s busca el símbolo actual.
("M-s" . consult-history) ;; orig. historial de búsqueda
("M-r" . consult-history)) ;; orig. historual de búsqueda
;; Enable automatic preview at point in the *Completions* buffer. This is
;; relevant when you use the default completion UI.
:hook (completion-list-mode . consult-preview-at-point-mode)
;; The :init configuration is always executed (Not lazy)
:init
;; Optionally configure the register formatting. This improves the register
;; preview for `consult-register', `consult-register-load',
;; `consult-register-store' and the Emacs built-ins.
(setq register-preview-delay 0.5
register-preview-function #'consult-register-format)
;; Optionally tweak the register preview window.
;; This adds thin lines, sorting and hides the mode line of the window.
(advice-add #'register-preview :override #'consult-register-window)
;; Use Consult to select xref locations with preview
(with-eval-after-load 'xref
(setq xref-show-xrefs-function #'consult-xref
xref-show-definitions-function #'consult-xref))
:config
;; Optionally configure preview. The default value
;; is 'any, such that any key triggers the preview.
;; (setq consult-preview-key 'any)
(setq consult-preview-key "M-.")
;; (setq consult-preview-key '("S-<down>" "S-<up>"))
;; For some commands and buffer sources it is useful to configure the
;; :preview-key on a per-command basis using the `consult-customize' macro.
(consult-customize
consult-goto-line
consult-theme :preview-key '(:debounce 0.4 any))
;; Optionally configure the narrowing key.
;; Both < and C-+ work reasonably well.
(setq consult-narrow-key "<") ;; "C-+"
;; Optionally make narrowing help available in the minibuffer.
;; You may want to use `embark-prefix-help-command' or which-key instead.
(define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help))
;; nerd-icons en ibuffer
(use-package nerd-icons-ibuffer
:defer t
:hook (ibuffer-mode . nerd-icons-ibuffer-mode))
;; Integración entre consult y project
(use-package consult-project-extra
:defer t
:ensure t
:bind
(("C-x p" . consult-project-extra-find)
("C-c p o" . consult-project-extra-find-other-window)))
;; Descripciones en el minibufer
(use-package marginalia
:defer t
:hook (elpaca-after-init . marginalia-mode))
;; Nerd icons para vertico
(use-package nerd-icons-completion
:after nerd-icons
:config (nerd-icons-completion-mode))
;; Todolist de todo el projecto desde consult.
(use-package consult-todo
:demand t
:bind ("C-c t" . consult-todo)
:defer t)
(provide 'init-minibuffer)
;;; init-minibuffer.el ends here

333
configs/init-org.el Normal file
View File

@ -0,0 +1,333 @@
;;; init-config.el --- Configuración de org-mode -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Aquí se encuentran todas las configuraciones relacionadas a org-mode.
;;
;; org-mode es un de los reclamos más potentes de Emacs. Aunque solo es
;; un formato de texto enrriquecido, básicamente algo similar a
;; markdown, Emacs es el que lo ha llevado muy bien y probalemente el que
;; mejor lo soporta.
;;
;; Cabe mencionar que este modo es también el predefinido para todo un
;; ecosistema dentro de Emacs, como es el caso de la agenda o la base de
;; conocimientos org-roam.
;;; Code:
(defun kj/org-hook ()
"Configuración para el hook de 'org-mode'."
(display-line-numbers-mode 0)
;; (variable-pitch-mode 1)
(visual-line-mode 1)
(visual-fill-column-mode 1)
;; Configuración de fonts
;; (set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face))
;; Ensure that anything that should be fixed-pitch in Org files appears that way
;; (set-face-attribute 'org-hide nil :inherit 'fixed-pitch)
;; (set-face-attribute 'org-block nil :foreground 'unspecified :inherit 'fixed-pitch)
;; (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(setq org-fontify-quote-and-verse-blocks t) ;; Permitir configuración de bloques quote y verse.
;; (set-face-attribute 'org-block nil :underline nil :foreground nil :background "#282a36")
;; (set-face-attribute 'org-block-begin-line nil :underline nil :foreground nil :background "#1e1f28")
;; (set-face-attribute 'org-block-end-line nil :underline nil :foreground nil :background nil)
;; (set-face-attribute 'org-block-end-line nil :background 'unspecified)
(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
;; (set-face-attribute 'org-block nil :background
;; (color-darken-name
;; (face-attribute 'default :background) 3))
;; (setq org-src-block-faces '(("emacs-lisp" (:background "#EEE2FF"))
;; ("python" (:background "#E5FFB8"))))
;; Tachar los elementos "DONE"
(set-face-attribute 'org-done nil :strike-through t)
(set-face-attribute 'org-headline-done nil
:strike-through t
:foreground "light gray")
;; Embellecer las prioridades
(setq org-highest-priority ?A
org-default-priority ?B
org-lowest-priority ?D) ;; Cambiar prioridades de A,B,C a A,B,C,D
(push '("[#A]" . "" ) prettify-symbols-alist)
(push '("[#B]" . "🔥" ) prettify-symbols-alist)
(push '("[#C]" . "🐢" ) prettify-symbols-alist)
(push '("[#D]" . "" ) prettify-symbols-alist)
;; (push '("#+begin_quote" . "❝" ) prettify-symbols-alist)
;; (push '("#+end_quote" . "❞" ) prettify-symbols-alist)
;; (push '("#+begin_export" . "📤" ) prettify-symbols-alist)
;; (push '("#+end_export" . "⎯" ) prettify-symbols-alist)
;; (push '("#+begin_comment" . "📝" ) prettify-symbols-alist)
;; (push '("#+end_comment" . "⎯" ) prettify-symbols-alist)
;; (push '("#+begin_src" . "" ) prettify-symbols-alist)
;; (push '("#+end_src" . "⎯" ) prettify-symbols-alist)
;; (push '("#+begin_example" . "🦉" ) prettify-symbols-alist)
;; (push '("#+end_example" . "⎯" ) prettify-symbols-alist)
(prettify-symbols-mode)
;; Habilitar evaluación de lenguajes en org-mode (babel)
(org-babel-do-load-languages 'org-babel-load-languages
(append org-babel-load-languages
'(
(C . t)
(R . t)
(awk . t)
(calc . t)
(clojure . t)
(go . t)
(haskell . t)
(java . t)
(js . t)
(php . t)
(python . t)
(rust . t)
(translate . t)
(shell . t)
)))
;; No solicitar confirmación para evaluar
(setq org-confirm-babel-evaluate nil)
)
;; org-mode
(use-package org
:defer t
:ensure nil
:bind (("C-c a" . org-agenda)
("C-c c" . org-capture))
:hook
(org-mode . kj/org-hook)
:config
(setq org-ellipsis "")
(setq org-hide-emphasis-markers t)
;;(setq org-startup-folded 'content)
(setq org-agenda-start-with-log-mode t)
(setq org-log-done 'time)
(setq org-log-into-drawer t)
(setq org-cycle-separator-lines -1)
;; Identación
(setq org-startup-indented t)
(setq org-src-preserve-indentation nil)
(setq org-edit-src-content-indentation 0)
(setq org-src-tab-acts-natively t)
;; Palabras claves del To Do de org-mode
(setq org-todo-keywords
;;'((sequence "☐" "✔" "⌛" "❌")))
'((sequence "TODO(t)" "DOING(n)" "WAITING(w)" "|" "DONE(d!)" "CANCELED(c!)")))
(setq org-todo-keyword-faces
'(("TODO" . "#ff6464")
("DOING" . "yellow")
("DONE" . "green")
("HOLD" . "orange")
("CANCELED" . "#aaa"))
)
;; Tachar los checkbox marcados como terminados
(defface org-checkbox-done-text
'((t (:foreground "#71696A" :strike-through t)))
"Face for the text part of a checked org-mode checkbox.")
(font-lock-add-keywords
'org-mode
`(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)"
1 'org-checkbox-done-text prepend))
'append)
;; Archivos a usarse en org-agenda
(setq org-agenda-files
'("~/Documentos/ORG/Agenda/Tareas.org")
)
;; Archivos entre los que se moverán las tareas
(setq org-refile-targets
'(("Archivo.org" :maxlevel . 1)
("Tareas.org" :maxlevel . 1)))
;; Guardar los archivos cuando se muevan tareas entre ellos
(advice-add 'org-refile :after 'org-save-all-org-buffers)
(setq org-capture-templates
`(("t" "Tareas")
("tt" "Tareas" entry (file+olp "~/Documentos/ORG/Agenda/Tareas.org")
"* TODO %? \n %a\n %i" :empty-lines 1)
)
)
;; Configuración de imágenes
(setq org-startup-with-inline-images t) ;; Mostrar por defecto las imágenes
(setq org-display-remote-inline-images 'cache) ;; Mostrar imágenes remotas
(setq org-image-actual-width 512)
)
;; Org-yt para soportar embebidos.
(use-package org-yt
:after org
:ensure (:host github :repo "TobiasZawada/org-yt")
:config
(defun org-http-image-data-fn (protocol link _description)
"Interpret LINK as an URL to an image file."
(when (and (image-type-from-file-name link)
(not (eq org-display-remote-inline-images 'skip)))
(if-let (buf (url-retrieve-synchronously (concat protocol ":" link)))
(with-current-buffer buf
(goto-char (point-min))
(re-search-forward "\r?\n\r?\n" nil t)
(buffer-substring-no-properties (point) (point-max)))
(message "Download of image \"%s\" failed" link)
nil)))
(org-link-set-parameters "http" :image-data-fun #'org-http-image-data-fn)
(org-link-set-parameters "https" :image-data-fun #'org-http-image-data-fn)
)
;; Los head "*" se ven como puntos
(use-package org-bullets
:defer t
:hook
(org-mode . org-bullets-mode)
:config
(setq org-bullets-bullet-list '(""
""
""
""
""
""
""
""))
)
;; Mejora visualmente varias cosas de org
(use-package org-modern
:defer t
:ensure t
:hook ((org-mode . org-modern-mode)
(org-agenda . org-modern-mode))
:config
;; Me gustan varias cosas por defecto, así que desactivo aquí varias de las "mejoras"
(setq org-modern-table nil ;; Mejora visual de las tablas
org-modern-table-vertical 1 ;; Grosor de las líneas verticales de las tablas
org-modern-table-horizontal 0.2 ;; Grosor de las líneas horizontales de las tablas
org-modern-priority nil ;; Mejora de las prioridades (Arriba ya las puse bonitas con prettyfy-symbols, así que mejor está desactivado)
org-modern-todo nil ;; Mejora visual a las lista de tareas
org-modern-statistics nil ;; Mejora visual a las estadísticas de completado de uan tarea (ej: [50%] o [5/9])
org-modern-checkbox nil ;; Mejora de los checkboxes (a mi parecer se ven más feos, los por defecto ya están bonitos).
org-modern-keyword nil ;; Oculta el "#+" en los keywords de org
org-modern-block-name nil ;; Mejora visual para los org blocks (bloques de código, ejemplo, citas, etc.)
org-modern-star nil ;; Lista de bullets a usar en los headers (falla si se activa junto a org-bullets).
org-modern-list nil)
)
(use-package visual-fill-column
:defer t
:after (org)
:config
;; Tamaño de la columna
(setq-default visual-fill-column-width 150)
;; Centrar el texto
(setq-default visual-fill-column-center-text t
visual-fill-column-adjust-for-text-scale nil
visual-fill-column-enable-sensible-window-split t)
)
;; Segundo cerebro: Base de conocimientos en formato Zettelkasten
(use-package org-roam
:defer t
:ensure t
:bind (("<f4>" . org-roam-node-insert)
("<f3>" . org-roam-node-find))
:init
(setq org-roam-v2-ack t)
(setq org-roam-completion-system 'ivy)
:custom
(org-roam-directory "~/Documentos/ORG/Notas")
(org-roam-completion-everywhere t)
:config
(org-roam-setup))
;; Interface web para navegar en mi base de conocimientos.
(use-package org-roam-ui
:defer t
:ensure t
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
;; Continúa el formato de la lista cuando presionas enter.
(use-package org-autolist
:defer t
:ensure t
:hook (org-mode . org-autolist-mode))
;; Org babel para PHP
(use-package ob-php
:defer t
:ensure t)
;; Org babel para GO
(use-package ob-go
:defer t
:ensure t)
;; Org babel para Rust
(use-package ob-rust
:defer t
:ensure t)
;; Org babel para traducciones (mediante google translate)
(use-package ob-translate
:defer t
:ensure t)
;; Org mode en modo presentación
(use-package org-present
:defer t
:after (org)
:config
(add-hook 'org-present-mode-hook
(lambda ()
(org-display-inline-images)
(org-present-hide-cursor)
(org-present-read-only)
))
(add-hook 'org-present-mode-quit-hook
(lambda ()
;; (org-remove-inline-images)
(org-present-show-cursor)
(org-present-read-write)))
(add-hook 'org-present-after-navigate-functions
(lambda ()
;; Show only top-level headlines
(org-overview)
;; Unfold the current entry
(org-show-entry)
;; Show only direct subheadings of the slide but don't expand them
(org-show-children)
))
)
;; Mostrar los caracteres ocultos de org mode al pasar con el cursor.
(use-package org-appear
:defer t
;; :hook (org-mode . org-appear-mode)
)
;; Polymode para org-mode
;; (use-package poly-org)
(provide 'init-org)
;;; init-org.el ends here

488
configs/init-packages.el Normal file
View File

@ -0,0 +1,488 @@
;;; init-packages.el --- Extensiones/paquetes instalados y su configuración -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Aquí se encuentran los paquetes de uso general.
;;
;; Aquellos de uso más específico, por ejemplo, los que
;; pertenecen a un lenguaje de programación en específico
;; estarán en el respectivo archivo de configuración
;; para dicho uso específico.
;;; Code:
;; Mejora del reemplazo
(use-package anzu
:defer t
:bind (([remap query-replace] . anzu-query-replace)
([remap query-replace-regexp] . anzu-query-replace-regexp)))
;; Intercamiar buffers de lugar
(use-package buffer-move
:defer t
:bind (("M-S-<up>" . buf-move-up)
("M-S-<down>" . buf-move-down)
("M-S-<left>" . buf-move-left)
("M-S-<right>" . buf-move-right))
)
;; Mostrar la ayuda de eldoc/documentación en un childframe
(use-package eldoc-box
:defer t
:bind ("<f1>" . eldoc-box-help-at-point))
;; Seleccionar por regiones (similar a mark-sexp, pero toma en cuenta hacia atrás del cursor también)
(use-package expand-region
:defer t
:bind ("C-+" . er/expand-region))
;; Major mode para archivos CSV
(use-package csv-mode
:defer t
:hook ((csv-mode . csv-align-mode)
(csv-mode . csv-header-line))
)
;; Visor de documentos de emacs (soporta de todo: epub, pdf, odt, docx, cbz, etc.)
(use-package doc-view
:defer t
:hook
(doc-view-mode . (lambda ()
(display-line-numbers-mode 0)))
:ensure nil)
;; Un bonito y sencillo panel de inicio
(use-package dashboard
:defer t
:init
(dashboard-setup-startup-hook)
:hook
(dashboard-after-initialize . (lambda ()
"Refrescamos el dashboard con la agenda luego de cargar todo"
(setq dashboard-items '(
;; (recents . 10)
(agenda . 10)
))
(dashboard-refresh-buffer)
))
:config
(setq dashboard-set-file-icons t
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-week-agenda nil
dashboard-agenda-time-string-format "%Y-%m-%d %H:%M")
(setq dashboard-startup-banner
(expand-file-name "duck.svg" user-emacs-directory))
(setq dashboard-items '())
)
;; Coloca en emacs la documentacón distribuída por devdocs.io
(use-package devdocs
:defer t)
;; Sidebar a la derecha con los archivos
(use-package dired-sidebar
:defer t
:hook (dired-mode . hl-line-mode)
:ensure t
:bind ([f9] . dired-sidebar-toggle-sidebar)
:commands (dired-sidebar-toggle-sidebar)
:config
(setq dired-sidebar-theme 'nerd
;; dired-sidebar-should-follow-file t
;; dired-sidebar-follow-file-idle-delay 0.5
))
;; Mover líneas o regiones
(use-package drag-stuff
:defer t
:hook
(elpaca-after-init . drag-stuff-global-mode)
:config
(drag-stuff-define-keys))
;; La línea bonita esa de abajo
(use-package doom-modeline
:defer t
:ensure t
:hook (elpaca-after-init . doom-modeline-mode)
:config
(setq doom-modeline-project-detection 'auto
doom-modeline-buffer-file-name-style 'relative-from-project
doom-modeline-major-mode-color-icon t
doom-modeline-buffer-modification-icon t
doom-modeline-indent-info nil
doom-modeline-persp-name t))
;; Resolver diferencias entre 2 archivos o versiones del mismo.
(use-package ediff
:defer t
:ensure nil
:config
(setq ediff-diff-options "")
(setq ediff-custom-diff-options "-u")
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-split-window-function 'split-window-vertically))
;; Emparejamiento automático de comillas, paréntesis, corchetes y llaves
(use-package electric-pair
:defer t
:ensure nil
:hook (elpaca-after-init . electric-pair-mode)
:config
(setq electric-pair-delete-adjacent-pairs nil))
;; Git Gutter - Marca a la izq. si una linea ha sido agregada, editada o eliminada desde el último commit.
(use-package git-gutter
:defer t
:hook
(elpaca-after-init . global-git-gutter-mode)
:config
(defhydra hydra-git-gutter (:hint nil)
"
^Navigation^ | ^Actions^ | ^Others^
-^-----------^-+-^----^--------+-^-------^----------
_p_: previous | _s_: stage | _m_: mark
_n_: next | _r_: revert | _SPC_: toggle info
-^-----------^-+-^----^--------+-^-------^----------
"
("p" git-gutter:previous-hunk)
("n" git-gutter:next-hunk)
("s" git-gutter:stage-hunk)
("r" git-gutter:revert-hunk)
("m" git-gutter:mark-hunkmark)
("SPC" git-gutter:toggle-popup-hunk))
)
;; Visitar rápidamente viejas versiones de un archivo rápidamente
(use-package git-timemachine
:ensure t
:defer t)
;; Cliente LLM (ollama, chatgpt, gemini, etc.)
(use-package gptel
:defer t
:config
(setq gptel-model "dolphin-llama3:latest"
gptel-backend (gptel-make-ollama "Ollama"
:host "localhost:11434"
:stream t
:models '("mistral:latest" "dolphin-llama3:latest" "llama3:latest" "llava:latest"))
gptel-default-mode 'org-mode
gptel-prompt-prefix-alist
'((markdown-mode . "# ")
(org-mode . "* ")
(text-mode . "# "))
gptel-directives
'((default . "Eres un LLM que vive dentro de Emacs. Responde de manera concisa.")
(programming . "Eres un LLM y un programador profesional cuidadoso. Provee el código y solo el código como output sin ningún texto adicional, prompt o nota.")
(programming_tutor . "Eres un LLM y un programador profesional cuidadoso. Revisa el siguiente código y realiza sugerencias concisas en español para mejorarlo.")
(programming_explainer . "Eres un LLM y un programador profesional cuidadoso. Revisa el siguiente código y explica en español de manera concisa, su funcionamiento.")
(programming_describer . "Eres un LLM y un programador profesional cuidadoso. Revisa el siguiente código y explica en español su funcionamiento línea a línea.")
(writing . "Eres un LLM y un asistente de escritura. Responde de manera concisa.")
(grammarly . "You are a large language model and professional philologist. Improve grammar and spelling.")
(chat . "Eres un LLM y un compañero de conversación. Responde de manera concisa.")
(traductor . "Eres un traductor de libros de informática profesional. Traduce a español tomando en cuenta los posibles tecnicismos que no deberían traducirse.")
)
)
)
;; Resalta los escapes de secuencia
(use-package highlight-escape-sequences
:defer t
:hook (prog-mode . hes-mode)
:config
(setq hes-mode-alist
`((c-mode . ,hes-c/c++/objc-escape-sequence-re)
(c++-mode . ,hes-c/c++/objc-escape-sequence-re)
(objc-mode . ,hes-c/c++/objc-escape-sequence-re)
(go-mode . ,hes-c/c++/objc-escape-sequence-re)
(php-mode . ,hes-c/c++/objc-escape-sequence-re)
(java-mode . ,hes-java-escape-sequence-re)
(clojure-mode . ,hes-java-escape-sequence-re)
(js-mode . ,hes-js-escape-sequence-re)
(js2-mode . ,hes-js-escape-sequence-re)
(ruby-mode . ,hes-ruby-escape-sequence-keywords)
(lisp-mode . ,hes-elisp-escape-sequence-re)
(lisp-interaction-mode . ,hes-elisp-escape-sequence-re)
(emacs-lisp-mode . ,hes-elisp-escape-sequence-re))
)
)
;; Resaltar palabras clave como TODO, FIXME, etc. en comentarios del código.
(use-package hl-todo
:ensure (hl-todo :version (lambda (_) "3.6.0"))
:defer t
:hook (prog-mode . hl-todo-mode)
:config
(add-to-list 'hl-todo-keyword-faces '("BUG" . "#d99600")))
;; Paquete para exportar buffers de emacs a HTML
(use-package htmlize
:defer t
:ensure t)
;; Permite crear conjuntos de atajos.
(use-package hydra
:defer t)
;; Mostrar lo que se está presionando en pantalla
(use-package keypression
:defer t
:config
(setq keypression-use-child-frame t
keypression-fade-out-delay 1.0
keypression-frame-justify 'keypression-left-justified
keypression-cast-command-name t
keypression-cast-command-name-format "%s %s"
keypression-combine-same-keystrokes t
keypression-x-offset 50
keypression-y-offset 100
keypression-font-face-attribute '(:width normal :height 180 :weight bold))
)
;; Generador automatizado de archivos de licencia
(use-package license-templates
:defer t)
;; Magia para git
(use-package magit
:defer t)
;; Todolist en magit de todos los archivos del projecto.
(use-package magit-todos
:defer t
:after magit
:config (magit-todos-mode 1))
;; Modo markdown
(use-package markdown-mode
:defer t)
;; Multiple vterm
(use-package multi-vterm
:defer t
:bind* (("<f5>" . multi-vterm-dedicated-toggle)
("C-x tt" . multi-vterm-dedicated-toggle)
("C-x tf" . multi-vterm)
("C-x tp" . multi-vterm-project)
;;("<tab>" . vterm-send-tab)
)
:ensure t)
;; Iconos bonitos para varias cosas
(use-package nerd-icons
:defer t)
;; Usar nerd-icons en dired
(use-package nerd-icons-dired
:defer t
:hook (dired-mode . nerd-icons-dired-mode))
;; Modo para leer archivos de configuración de nginx
(use-package nginx-mode
:defer t)
;; Lector EPUB
;; (use-package nov
;; :defer t)
;; Múltiples modos en un mismo buffer
;; (use-package polymode
;; :defer t)
;; Des-minifica / ordena el código
(use-package prettier
:defer t)
(use-package project
:defer t
:ensure nil
:config
;; Colocamos un título del frame más bonito y útil que el por defecto
(setq frame-title-format
'(
(:eval
(let ((project-name (kj/project-name)))
(unless (null project-name)
(format "[%s] " project-name))))
"%b"
" - Emacs")
)
)
;; Correr el código desde el buffer de emacs
(use-package quickrun
:defer t
:ensure t
:bind (:map prog-mode-map
("C-c C-r" . quickrun)
("C-c r f" . quickrun)
("C-c r r" . quickrun-region)
("C-c r R" . quickrun-replace-region)
)
)
;; Recentf - Guarda registro de los archivos abiertos recientemente
(use-package recentf
:defer t
:ensure nil
:bind ("C-x C-r" . recentf-open-files)
:hook (after-load-theme . recentf-mode)
:config
(setq recentf-save-file
(recentf-expand-file-name (concat temp-dir "/recentf"))
recentf-auto-cleanup 'never
recentf-keep '(file-remote-p file-readable-p)
recentf-max-saved-items 1000
recentf-max-menu-items 500))
;; Busqueda rápida con ripgrep
(use-package rg
:defer t
;; :hook (elpaca-after-init . rg-enable-default-bindings)
:bind (:map rg-global-map
("c" . rg-dwim-current-dir)
("f" . rg-dwim-current-file)
("m" . rg-menu))
:config
(setq rg-group-result t
rg-show-columns t)
(cl-pushnew '("tmpl" . "*.tmpl") rg-custom-type-aliases))
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
(use-package saveplace
:ensure nil
:defer t
:hook
(elpaca-after-init . (lambda()
(setq save-place-file (locate-user-emacs-file (concat temp-dir "/places")))
(save-place-mode 1)
))
)
;; Mejorando el scroll
(use-package smooth-scrolling
:defer t
:hook (elpaca-after-init . smooth-scrolling-mode)
:config
(setq mouse-wheel-scroll-amount
'(8 ((shift) . 1) ((control) . nil))) ; Cambia el scroll a 8 líneas a la vez, 1 cuando se preciona SHIFT y saltos de página cuando presionas CTRL
(setq mouse-wheel-progressive-speed nil) ; Deshabilita la velocidad progresiva del scroll (mientras más scroll haces, mas rápido va)
)
;; Ayuda a manipular los archivos con líneas demasiado largas
(use-package so-long
:defer t
:ensure nil
:bind (:map so-long-mode-map
("C-s" . isearch-forward)
("C-r" . isearch-backward))
:config
(setq so-long-variable-overrides
'((bidi-inhibit-bpa . t)
(bidi-paragraph-direction . left-to-right)
(buffer-read-only . nil)
(global-hl-line-mode . nil)
(line-move-visual . t)
(show-paren-mode . nil)
(truncate-lines . nil)
(which-func-mode . nil)))
)
;; Mecanografía
(use-package speed-type
:defer t
:hook
(speed-type-mode . (lambda ()
(display-line-numbers-mode 0)
(visual-line-mode 1)
(visual-fill-column-mode 1)))
:diminish
:config
(setq speed-type-gb-book-list '(66867 66866 66591 57303)
speed-type-min-chars 500
speed-type-max-chars 600))
;; Tree-sitter :)
(use-package treesit
:defer t
:ensure nil
:commands (treesit-install-language-grammar nf/treesit-install-all-languages)
:config
(setq treesit-language-source-alist
'((bash . ("https://github.com/tree-sitter/tree-sitter-bash"))
(c . ("https://github.com/tree-sitter/tree-sitter-c"))
(cpp . ("https://github.com/tree-sitter/tree-sitter-cpp"))
(css . ("https://github.com/tree-sitter/tree-sitter-css"))
(go . ("https://github.com/tree-sitter/tree-sitter-go"))
(haskell . ("https://github.com/tree-sitter/tree-sitter-haskell"))
(html . ("https://github.com/tree-sitter/tree-sitter-html"))
(java . ("https://github.com/tree-sitter/tree-sitter-java"))
(javascript . ("https://github.com/tree-sitter/tree-sitter-javascript"))
(json . ("https://github.com/tree-sitter/tree-sitter-json"))
(julia . ("https://github.com/tree-sitter/tree-sitter-julia"))
(lua . ("https://github.com/Azganoth/tree-sitter-lua"))
(make . ("https://github.com/alemuller/tree-sitter-make"))
(python . ("https://github.com/tree-sitter/tree-sitter-python"))
(php . ("https://github.com/tree-sitter/tree-sitter-php" "master" "php/src"))
(ruby . ("https://github.com/tree-sitter/tree-sitter-ruby"))
(rust . ("https://github.com/tree-sitter/tree-sitter-rust"))
(sql . ("https://github.com/m-novikov/tree-sitter-sql"))
(toml . ("https://github.com/tree-sitter/tree-sitter-toml"))
(zig . ("https://github.com/GrayJack/tree-sitter-zig"))))
(defun nf/treesit-install-all-languages ()
"Install all languages specified by `treesit-language-source-alist'."
(interactive)
(let ((languages (mapcar 'car treesit-language-source-alist)))
(dolist (lang languages)
(treesit-install-language-grammar lang)
(message "`%s' parser was installed." lang)
(sit-for 0.75)))))
;; Cuando presionas enter en un bloque de comentario sigue el estilo del bloque.
;; (use-package vs-comment-return
;; :ensure (:host github :repo "emacs-vs/vs-comment-return")
;; :defer t
;; :hook (prog-mode . vs-comment-return-mode)
;; )
;; Mostrar el último commit que modificó la linea actual
(use-package vc-msg
:defer t
:bind (("C-c v" . vc-msg-show)
("C-c C-v" . vc-msg-show))
)
;; Terminal
(use-package vterm
:ensure t
:defer t
:config
(setq tramp-histfile-override nil) ;; Dejamos que se use el history por defecto del servidor remoto
(setq vterm-tramp-shells '(("ssh" "/bin/bash")
("sshx" "/bin/bash")
("docker" "/bin/bash")
("podman" "/bin/bash"))) ;; Tanto docker como podman usarán bash cuado se contecte mediante tramp
)
;; Cuando iniicias un atajo de teclas te muestra las posibilidades
(use-package which-key
:defer t
:hook (elpaca-after-init . which-key-mode))
;; Restaurar el estado de los frames
(use-package winner
:ensure nil
:defer t
:hook (elpaca-after-init . winner-mode))
;; Emacs Start Up Profiler
(use-package esup
:defer t)
(provide 'init-packages)
;;; init-packages.el ends here

42
configs/init-theme.el Normal file
View File

@ -0,0 +1,42 @@
;;; init-theme.el --- Carga del theme -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Desde aquí se puede cambiar la configuración de themes es posible
;; activar o desactivar los themes comentando o descomentando las
;; líneas que lo configuran.
;;; Code:
;; Theme dracula (https://draculatheme.com/) // aún lo tengo en l config porque a Ney le gusta
(use-package dracula-theme
:ensure t
:defer t)
;; El theme más cercano a adwaita dark que he encontrado
(use-package adwaita-dark-theme
:ensure t
:defer t)
;; Themes modus, vienen integrado en emacs en master (~v30)
(use-package modus-themes
:ensure t
:defer t)
;; Themes ef
(use-package ef-themes
:defer t
:ensure t)
;; Prendemos el theme que elijamos
(add-hook 'elpaca-after-init-hook #'(lambda() (load-theme 'adwaita-dark t)))
;; Los themes que recomiendo:
;; Oscuros: adwaita-dark y ef-dream
;; Claros: modus-operandi-tinted y ef-day
(provide 'init-theme)
;;; init-theme.el ends here

View File

@ -1,10 +1,12 @@
;;; lang-go.el --- Configuración para el lenguaje go
;;; lang-go.el --- Configuración para el lenguaje go -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Archivo de configuración para el lenguaje GO
;;; Code:
(use-package go-mode

35
configs/lang-html.el Normal file
View File

@ -0,0 +1,35 @@
;;; lang-html.el --- Configuración para el lenguaje HTML -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Archivo de configuración para el lenguaje HTML
;;; Code:
(use-package web-mode
:defer t
:config
(setq web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2
web-mode-enable-current-element-highlight t
web-mode-enable-current-column-highlight t)
)
(use-package css-mode
:defer t
:ensure nil
:config
(setq css-indent-offset 2))
(use-package auto-rename-tag
:ensure (:host github :repo "jcs-elpa/auto-rename-tag")
:defer t
)
(provide 'lang-html)
;;; lang-html.el ends here

View File

@ -1,16 +1,21 @@
;;; lang-js.el --- Configuración para el lenguaje Javascript
;;; lang-js.el --- Configuración para el lenguaje Javascript -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Archivo de configuración para el lenguaje Javascript
;;; Code:
(use-package js
:defer t
:ensure nil
:mode
("\\.js$" . js-mode)
:hook
(js-mode . eglot-ensure)
:config
(setq js-indent-level 2))

View File

@ -1,29 +1,34 @@
;;; lang-php.el --- Configuración para el lenguaje PHP
;;; lang-php.el --- Configuración para el lenguaje PHP -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;;; Code:
;; Archivo de configuración para el lenguaje PHP
(use-package company-php :defer t)
(use-package ac-php :defer t)
;;; Code:
(use-package php-mode
:defer t
:bind ("<C-tab>" . php-doc-block)
:bind ("C-c d b" . kj/php-doc-block)
:config
(add-hook 'php-mode-hook #'(lambda()
(php-enable-default-coding-style)
(company-mode t) ; habilita company mode
(ac-php-core-eldoc-setup) ; habilita soporte para ELDoc
(add-to-list 'company-backends 'company-ac-php-backend) ; Agregar ac-php para a company
))
(defun kj/php-doc-block ()
"Llama a \"php-dock-block\", sin conflicto con \"vs-comment-return-mode\"."
(interactive)
(if (bound-and-true-p vs-comment-return-mode)
(funcall (lambda()
(vs-comment-return-mode -1)
(php-doc-block)
(vs-comment-return-mode 1)))
(php-doc-block)
)
)
)
(use-package php-doc-block
:load-path (lambda() (concat private-dir "/packages/php-doc-block"))
:after php-mode
:ensure (:host github :repo "moskalyovd/emacs-php-doc-block")
)
(provide 'lang-php)

19
configs/lang-rust.el Normal file
View File

@ -0,0 +1,19 @@
;;; lang-rust.el --- Configuración para el lenguaje Rust -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Archivo de configuración para el lenguaje Rust
;;; Code:
(use-package rust-mode
:defer t
:ensure t
:config
(setq rust-format-on-save t))
(provide 'lang-rust)
;;; lang-rust.el ends here

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

25833
duck.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 826 KiB

61
early-init.el Normal file
View File

@ -0,0 +1,61 @@
;;; early-init.el --- Early startup code -*- lexical-binding: t -*-
;; Copyright (C) 2021 Ryan C. Thompson
;; Filename: early-init.el
;; Author: Ryan C. Thompson
;; Created: Sat Nov 27 13:40:59 2021 (-0500)
;; This file is NOT part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;; This file contains code that must be executed early during Emacs'
;; startup for proper initialization, as described here:
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Early-Init-File.html
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; Disable GC during init
(put 'gc-cons-percentage 'original-value-before-init gc-cons-percentage)
(put 'gc-cons-percentage 'value-during-init 0.6)
(defun restore-gc-cons-percentage-after-init ()
"Restaura el garbaje collection luego de iniciar."
(let ((expected-value (get 'gc-cons-percentage 'value-during-init))
(value-to-restore (get 'gc-cons-percentage 'original-value-before-init)))
(when (and value-to-restore (equal gc-cons-percentage expected-value))
(message "Setting `gc-cons-percentage' back to starting value %s" value-to-restore)
(setq gc-cons-percentage value-to-restore))))
(add-hook 'after-init-hook #'restore-gc-cons-percentage-after-init)
(setq gc-cons-percentage (get 'gc-cons-percentage 'value-during-init))
;; Color de fondo similar al theme para evitar que se vea blanco al iniciar
;; (add-to-list 'default-frame-alist '(background-color . "#282a36"))
;; Permitir solo la búsqueda de archivos a cargar en la config en case sensitive.
(setq auto-mode-case-fold nil)
;; Personalizaciones (Tedrían que ir en init-base, pero por optimización, las pongo acá)
(push '(menu-bar-lines . 0) default-frame-alist) ; Quitar menús.
(push '(tool-bar-lines . 0) default-frame-alist) ; Quitar toolbar.
;; Iniciar emacs maximizado
;; (add-hook 'window-setup-hook 'toggle-frame-maximized t) ; Hacerlo mediante window-setup-hook (se maximiza al terminar de cargar la ventana)
;; (push '(ns-transparent-titlebar . t) default-frame-alist)
;; Resizing the Emacs frame can be a terribly expensive part of changing the
;; font. By inhibiting this, we easily halve startup times with fonts that are
;; larger than the system default.
(setq frame-inhibit-implied-resize t
frame-resize-pixelwise t)
;; Recommended by
;; https://github.com/raxod502/straight.el#getting-started to prevent
;; pacakge.el stepping on elpaca toes.
(setq package-enable-at-startup nil)
;;; early-init.el ends here

View File

@ -1,21 +0,0 @@
#!/bin/bash
# start emacs server if not is running
systemctl --user status emacs > /dev/null 2>&1 || systemctl --user start emacs > /dev/null 2>&1
# if args is -nw or -t run on terminal
if [ "$1" == "-t" ] || [ "$1" == "-nw" ]; then
emacsclient -t
exit
fi
# if no args open new frame
if [ $# -eq 0 ]; then
emacsclient -c -n
emacsclient --eval "(progn (select-frame-set-input-focus (selected-frame)))"
exit
fi
emacsclient -e "(frames-on-display-list \"$DISPLAY\")" &>/dev/null
emacsclient -c -n "$*"

23
init.el
View File

@ -1,4 +1,4 @@
;;; init.el --- Init de emacs ordenado
;;; init.el --- Init de emacs ordenado -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
@ -9,16 +9,29 @@
;;; Code:
;; Cargar configuraciones
(add-to-list 'load-path (concat user-emacs-directory "configs"))
(require 'base)
(require 'base-extensions)
(require 'base-functions)
(require 'base-keys)
;; Paquetes base
(require 'init-base)
(require 'init-theme)
(require 'init-packages)
(require 'init-functions)
(require 'init-org)
(require 'init-eglot)
(require 'init-corfu)
;; (require 'init-ctags)
(require 'init-minibuffer)
;; (require 'init-evil)
(require 'init-keys)
;; Lenguajes
(require 'lang-php)
(require 'lang-js)
(require 'lang-go)
(require 'lang-rust)
(require 'lang-html)
(provide 'init)
;;; init.el ends here

0
private/.custom.el Normal file
View File

View File

@ -1,120 +0,0 @@
;;; php-doc-block.el --- Php DocBlock generator
;; Copyright (C) 2016 Dmitriy Moskalyov
;; Author: Dmitriy Moskalyov <moskalyovd@gmail.com>
;; Keywords: php docblock
;; Version: 0.0.1
;; URL: https://github.com/moskalyovd/emacs-php-doc-block
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This package provides php DocBlock generator.
;; How to use:
;; Clone repository from https://github.com/moskalyovd/emacs-php-doc-block
;; and add to your .emacs(or init.el) file:
;; (add-to-list 'load-path "~/.emacs.d/emacs-php-doc-block")
;; (require 'php-doc-block)
;; Then bind command 'php-doc-block to any key you like:
;; (add-hook 'php-mode-hook
;; (lambda ()
;; (local-set-key (kbd "<C-tab>") 'php-doc-block)))
;;; Code:
(defun insert-to-prev-line-and-indent (text)
"Insert TEXT to the previous line with indentation."
(beginning-of-line)
(open-line 1)
(insert text)
(indent-according-to-mode))
(defun insert-to-next-line-and-indent (text)
"Insert TEXT to the next line with indentation."
(end-of-line)
(newline-and-indent)
(insert text)
(indent-according-to-mode))
(defun php-doc-block-var-or-attr (tag-type type name value is-nullable)
"Insert doc block for a property or an attribute"
(cond
((and value (= (string-width type) 0))
(cond
((string-match "^=\s*\\(array(.*)\\|\\[\.*\]\\)" value) (setq type "array"))
((string-match "^=\s*\[0-9\]*\\.\[0-9\]+$" value) (setq type "float"))
((string-match "^=\s*\[0-9\]+$" value) (setq type "int"))
((string-match "^=\s*\['\"]" value) (setq type "string"))
((string-match "^=\s*\\(true\\|false\\)" value) (setq type "bool"))))
((and (= (string-width type) 0) (not value))
(setq type "mixed")))
(when (equal is-nullable "?")
(setq type (concat type "|null")))
(insert-to-next-line-and-indent (concat "* @" tag-type " " type " " name)))
(defun php-doc-block-function (name arguments return-type is-return-nullable)
"Insert php docblock for function"
(insert-to-next-line-and-indent (concat "* " name))
(when (> (string-width arguments) 0)
(insert-to-next-line-and-indent "*")
(dolist (arg (split-string arguments "\s*,\s*"))
(string-match "\s*\\(\[\?\]?\\)\s*\\(\[\\\]?\[a-zA-Z0-9_\]*\\)?\s*\\($\[a-zA-Z0-9_\]+\\)\s*\\(=.*\\)?" arg)
(php-doc-block-var-or-attr "param" (match-string 2 arg) (match-string 3 arg) (match-string 4 arg) (match-string 1 arg))))
(when (> (string-width return-type) 0)
(insert-to-next-line-and-indent "*")
(when (equal is-return-nullable "?")
(setq return-type (concat return-type "|null")))
(insert-to-next-line-and-indent (concat "* @return " return-type))))
(defun php-doc-block-class (type name)
"Insert php doc block for class, interface etc."
(insert-to-next-line-and-indent (concat "* " name " " type)))
(defun php-doc-block ()
"Insert php docblock."
(interactive)
(let ((line (thing-at-point 'line)))
(insert-to-prev-line-and-indent "/**")
(cond
((string-match "function\s*" line)
(beginning-of-line)
(let ((line (thing-at-point 'line)) (func-defun "") (s-point (point)) (e-point (re-search-forward ";\\|{" nil '(nil))))
(goto-char s-point)
(if e-point
(setq func-defun (replace-regexp-in-string "{\\|\n" "" (buffer-substring s-point e-point)))
(progn
(end-of-line)
(setq func-defun (buffer-substring s-point (point))))
)
(when (string-match "function\s+\\([A-Za-z0-9_]+\\)\s*(\\(.*\\))\s*:*\s*\\(\[\?\]?\\)\s*\\(\[A-Za-z0-9_\\\]*\\)" func-defun)
(php-doc-block-function (match-string 1 func-defun) (match-string 2 func-defun) (match-string 4 func-defun) (match-string 3 func-defun)))))
((string-match "\s*\\([a-zA-Z0-9_]+\\)?\s*\\($\[a-zA-Z0-9_\]+\\)\s*\\(=\[^;\]*\\)?" line)
(php-doc-block-var-or-attr "var" "" (match-string 2 line) (match-string 3 line) ""))
((string-match "\\(class\\|interface\\|trait\\|abstract class\\)\s+\\(\[a-zA-Z0-9_\]+\\)" line)
(php-doc-block-class (match-string 1 line) (match-string 2 line))))
(insert-to-next-line-and-indent "*/")))
(provide 'php-doc-block)
;;; php-doc-block.el ends here

View File

@ -1,61 +0,0 @@
# Configuración de Emacs actual
Esta configuración para emacs se podría decir que es la heredera de mi [configuración de emacs inicial](https://git.kj2.me/kj/confi-emacs-inicial), la cual ya llevaba tiempo necesitando una manita de gato para arreglar y mejorar algunas cosas que me resultan cómodas para el uso, ademas de comenzar a utilizar `evil-mode`. Esta configuración bien podría haber sido una rama de la inicial, pero he decidido hacer uno nuevo y si es neceario hacer aquí las ramas.
## Instalación
Si deseas clonar mi configuración, puedes clonar este repositorio:
`git clone --depth 1 https://git.kj2.me/kj/confi-emacs-actual.git ~/.emacs.d`
Instalación de fonts y libvterm:
`sudo apt install fonts-firacode fonts-cantarell libvterm cmake`
Al igual que la versión anterior, puede ser necesario ejecutar el siguiente comando en el minibuffer para tener bien los íconos de neotree:
`all-the-icons-install-fonts`
Y eso sería todo.
## Usar el modo daemon
El modo daemon permite a emacs cargar mucho más rápido, puesto que con ello evitas volver a cargar la configuración cada vez que abres un nuevo archivo. Si quieres aprender mas sobre esto, puedes revisarlo en la [dococumentación de emacs](https://www.emacswiki.org/emacs/EmacsAsDaemon).
Para iniciar el daemon, puedes hacerlo desde la terminal ejecutando:
`sudo systemctl --user start emacs`
Del mismo modo, igual es recomendable habilitar el autoinicio de este servicio junto con el sistema:
`sudo systemctl --user enable emacs`
Finalmente, para abrirlo, es necesaria la usar `emacsclient` en lugar de `emacs`, para hacer que eso suceda en todo el sistema se puede realizar el siguiente hack copiando el archivo `emacs-client-runner.sh` a `/usr/local/bin/` con el nombre `emacs` de la siguiente manera:
`sudo cp ~/.emacs.d/emacs-client-runner.sh /usr/local/bin/emacs`
**🔴 Advertencia:** Esto reemplazará emacs por emacsclient, si deseas usar emacs podrás hacerlo mediante: `/bin/emacs`
**Extra:** Con este hack, para abrir emacs en modo terminal puedes ejecutar: `emacsclient -t`, `emacs -t` o `emacs -nw`.
## Consideraciones
- Toda la configuración la he realizado en los archivos que están en los archivos de la carpeta config, el archivo `init.el` solo los llama y no guarda nada más aparte de eso.
- Puede tener activado `evil-mode` (A veces lo activo, pues quiero terminar usándolo siempre), por lo que si no lo quieres tener, recomiendo comentar la línea que lo activa (`(evil-mode 1)`) o directamente toda la sección en `base-extensions.el` que cofigura evil.
- Se puede activar/desactivar `cua-mode` (`configs/base.el`, línea 49) activado para poder copiar, cortar, pegar y deshacer cambios con las combinaciones típicas en lugar de las de emacs.
- Con F9 puedes abrir y cerrar neotree.
- Con C-F11 puedes maximizar/restaurar.
- Con C-F6 se generan/regenera el archivo TAGs.
- Con C-F5 se abre una terminal en la carpeta del archivo actual.
- Con M-c se puede comentar / descomentar un región.
- Por defecto he configurado que al presionar TAB se usen 2 espacios en su lugar.
- Cuando usas `C-s` (buscar), busca el texto actualmente seleccionado.
Recuerda que si alguna cosa no te gusta, puedes cambiarla a gusto. Esta configuración fue hecha para mi uso personal y puede que tenga cosas que solo a mi me parecen cómodas/útiles.
## Contacto
Si se tiene alguna pregunta o quieres comentarme alguna corrección, puesto que este git no está abierto a registro, puedes contactarme mediante:
E-mail: webmaster@outcontol.net
Telegram: [https://t.me/keyjay](https://t.me/keyjay)

63
readme.org Normal file
View File

@ -0,0 +1,63 @@
#+TITLE: Configuración Emacs
#+AUTHOR: KJ
#+OPTIONS: toc:nil
Esta es mi configuración de Emacs personal y está hecha principalmente para funcionar con *Emacs compilado desde el código*, ya que es así como yo lo uso.
* Instalación
Si deseas clonar mi configuración, puedes clonar este repositorio:
#+begin_src bash
git clone --depth 1 https://git.kj2.me/kj/confi-emacs-actual.git ~/.emacs.d
#+end_src
Si no ves los íconos bien dentro de Emacs, puedes ejecutar el comando dentro de Emacs (M-x)
#+begin_src elisp
nerd-icons-install-fonts
#+end_src
* Compilación de Emacs
Si quieres instalar Emacs tal cual lo tengo yo, esta es la configuración de compilación que actualmente uso:
#+begin_src bash
git clone https://git.savannah.gnu.org/git/emacs.git
cd emacs
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-modules --without-libotf --without-m17n-flt --without-gconf --with-native-compilation=yes --with-native-compilation=aot --with-xinput2 --with-pgtk --with-tree-sitter --without-compress-install --with-mailutils
make -j16
make check
sudo make install
#+end_src
Las dependencias para compilar pueden cambiar según tu distribución, por lo que queda en tus manos el ajustar lo que sea necesario.
Como ayuda lo más que puedo dar es que en las distros basadas en Debian puedes usar =apt build-dep emacs= mientras que en las basadas en RHEL (solo lo he probado en Fedora) puedes usar =dnf builddep emacs=. En el caso de las basadas Arch puedes usar AUR.
* Dependencias
Normalmente no es usual el tener dependencias reales para que emacs funcione, pero para el funcionamiendo adecuado y sin errores, lo mejor es tener instalado:
- El font de firacode
- cmake
- libvterm
** Languaje Server Protocol (LSP)
Esta configuración por defecto utiliza [[https://github.com/joaotavora/eglot][eglot]] para LSP con los servidores por defecto. Puedes revisar su documentación para ver lo que necesitas instalar para usar el LSP del lenguaje que necesites.
Finalmente, recomiendo instalar [[https://github.com/blahgeek/emacs-lsp-booster][emacs-lsp-booster]], la mejora es nimia en general, pero en proyectos grandes esa pequeña mejora es bastante notoria.
* Atajos de teclas personalizados
Tengo varios atajos reconfigurados, por lo que recomiento revisar primero que nada el archivo [[./configs/init-keys.el][init-keys.el]] el resto de configuraciones está principalmente en los archivos [[./configs/init-minibuffer.el][init-minibuffer.el]] e [[./configs/init-packages.el][init-packages.el]], dudo que las uses todas y yo mismo no las uso, por lo que con el tiempo las voy eliminando y a veces agrego alguna extra. Con que revises el primer archivo y sepas que =consult-project= está en =C-x p= ya estás servido.
* Contacto
Si se tiene alguna pregunta o quieres comentarme alguna corrección, puesto que este git no está abierto a registro, puedes contactarme mediante:
*Correo*: webmaster@outcontrol.net
*Telegram*: [[https://t.me/keyjay][@keyjay]]

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: @import
# key: imp
# uuid: imp
# --
@import "`(doom-snippets-text nil t)`$0";

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: @import url("//fonts.googleapis...")
# key: impfont
# uuid: impfont
# --
@import url("http://fonts.googleapis.com/css?family=${1:Open+Sans}");

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: @import url(...)
# key: impurl
# uuid: impurl
# --
@import url("`(doom-snippets-text nil t)`$0");

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: margin: ...;
# key: mar
# uuid: mar
# --
margin: ${1:0 auto};

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: @media
# key: med
# uuid: med
# --
@media ${1:screen} {
`%`$0
}

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: @media (orientation: ?)
# condition: (looking-back "@media " (line-beginning-position))
# --
(orientation: ${1:landscape})

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: @media print { ... }
# --
@media print {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: padding: ...;
# key: pad
# uuid: pad
# --
padding: ${1:10px};

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: ...: ...;
# key: :
# uuid: :
# --
${1:prop}: ${2:`%`};

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: append
# --
${1:type} = append($1, ${2:elems})

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: ... := ...
# key: :=
# uuid: :=
# --
${1:x} := ${2:`%`}

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# contributor: Seong Yong-ju
# name: const ... = ...
# --
const ${1:name}${2: type} = ${3:value}$0

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: ctx context.Context
# --
ctx context.Context

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: func ...(...) ... { ... }
# --
func ${1:name}(${2:args})${3: return type} {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: func (target) name(args) (results) { ... }
# --
func (${1:target}) ${2:name}(${3:args})${4: return type} {
$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: for ... { ... }
# --
for $1 {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: for key, value := range ... { ... }
# --
for ${1:key}, ${2:value} := range ${3:target} {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: for key, value := range ... { ... }
# --
for ${1:key}, ${2:value} := range ${3:target} {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: for i := 0; i < n; i++ { ... }
# --
for ${1:i} := ${2:0}; $1 < ${3:10}; $1++ {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: for ... { ... }
# --
for $1 {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: func ...(...) ... { ... }
# --
func ${1:name}(${2:args})${3: return type} {
`%`$0
}

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: go
# --
go ${1:func}(${2:args})$0

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: go func
# --
go func (${1:args}) {
$0
}(${2:values})

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: go func (short)
# --
go func (${1:args}) {
$0
}(${2:values})

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# contributor: Seong Yong-ju
# name: if ... { ... }
# --
if ${1:condition} {
`%`$0
}

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# contributor: Seong Yong-ju
# name: if ... { ... } else { ... }
# --
if ${1:condition} {
`%`$2
} else {
$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: if err != nil { ... }
# --
if err != nil {
`%`$0
}

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: import
# --
import ${1:package}$0

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: import
# --
import ${1:package}$0

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: type ... interface { ... }
# --
type $1 interface {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: func main() { ... }
# --
func main() {
$0
}

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: map
# --
map[${1:KeyType}]${2:ValueType}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: func (target) name(args) (results) { ... }
# --
func (${1:target}) ${2:name}(${3:args})${4: return type} {
$0
}

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: package
# --
package ${1:`(car (last (split-string (file-name-directory buffer-file-name) "/") 2))`}

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: package (short)
# --
package ${1:`(car (last (split-string (file-name-directory buffer-file-name) "/") 2))`}

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: printf
# --
fmt.Printf("$1\n"${2:, ${3:str}})

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: printf
# --
fmt.Printf("$1\n"${2:, ${3:str}})

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: println
# --
fmt.Println("${1:msg}")$0

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: println (short)
# --
fmt.Println("${1:msg}")$0

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# name: select
# --
select {
case ${1:cond}:
$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: type ... struct { ... }
# --
type $1 struct {
`%`$0
}

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: switch
# key: switch
# uuid: switch
# --
switch {
case ${1:cond}:
$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: func Test...() { ... }
# --
func Test${1:Name}(${2:t *testing.T}) {
`%`$0
}

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: var
# --
var ${1:name} ${2:type} = ${3:value}$0

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name : for ... { ... }
# --
for $1 {
`%`$0
}

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: http request writer
# --
w http.ResponseWriter, r *http.Request

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# contributor: Rodrigo Setti <rodrigosetti@gmail.com>
# name: <dd> ... </dd>
# group: list
# --
<dd>$1</dd>

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# contributor: Rodrigo Setti <rodrigosetti@gmail.com>
# name: <dl> ... </dl>
# group: list
# --
<dl>
$0
</dl>

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: Doctype HTML 5
# group: meta
# --
<!DOCTYPE html>

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: DocType XHTML 1.0 frameset
# group: meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: DocType XHTML 1.1
# group: meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: DocType XHTML 1.0 Strict
# group: meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: DocType XHTML 1.0 Transitional
# group: meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# contributor: Rodrigo Setti <rodrigosetti@gmail.com>
# name: <dt> ... </dt>
# group: list
# --
<dt>$1</dt>

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# contributor: Jimmy Wu <frozenthrone88@gmail.com>
# name: <form method="..." id="..." action="..."></form>
# --
<form method="$1" id="$2" action="$3">
$0
</form>

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# contributor: Jimmy Wu <frozenthrone88@gmail.com>
# name: <html>...</html>
# --
<html>
$0
</html>

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# contributor: Jimmy Wu <frozenthrone88@gmail.com>
# name: <html xmlns="...">...</html>
# --
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}" lang="${2:en}">
$0
</html>

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: <link rel="stylesheet" ... />
# key: link
# uuid: link
# --
<link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" />

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: <!--[if IE]><link stylesheet="..." /><![endif]-->
# --
<!--[if IE${1: version}]>
<link rel="${2:stylesheet}" href="${3:url}" type="${4:text/css}" media="${5:screen}" />
<![endif]-->

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: <a href="mailto:...@...">...</a>
# --
<a href="mailto:${1:john@doe.com}">`(doom-snippets-format "%n%s%n")`$0</a>

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# contributor : Jimmy Wu <frozenthrone88@gmail.com>
# group: meta
# name: <meta name="..." content="..." />
# --
<meta name="${1:generator}" content="${2:content}" />

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# contributor: Jimmy Wu <frozenthrone88@gmail.com>
# name: <meta http-equiv="..." content="..." />
# group: meta
# --
<meta name="${1:Content-Type}" content="${2:text/html; charset=UTF-8}" />

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: <script type="text/javascript">...</script>
# --
<script type="text/javascript">
$0
</script>

View File

@ -1,4 +0,0 @@
# -*- mode: snippet -*-
# name: <script type="text/javascript" src="..."></script>
# --
<script type="text/javascript" src="$1"></script>

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# contributor: Jimmy Wu <frozenthrone88@gmail.com>
# name: <textarea ...></textarea>
# --
<textarea name="$1" id="$2" rows="$3" cols="$4" tabindex="$5"></textarea>

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# contributor: Jimmy Wu <frozenthrone88@gmail.com>
# name: <th>...</th>
# group: table
# --
<th$1>$2</th>

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# name: param
# key: @param
# uuid: @param
# condition: (sp-point-in-comment)
# --
@param ${1:paramater} $0

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# name: return
# key: @return
# uuid: @return
# condition: (sp-point-in-comment)
# --
@return ${1:description}

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: apr_assert
# key: apr_assert
# uuid: apr_assert
# --
if (Globals.useAssertions) {
${1:assert ..};
}

Some files were not shown because too many files have changed in this diff Show More