Compare commits
547 Commits
evil
...
0543f7b231
| Author | SHA1 | Date | |
|---|---|---|---|
| 0543f7b231 | |||
| b5f7c3bd53 | |||
| 14e2fe7715 | |||
| 7afa60ae9f | |||
| 431bc81440 | |||
| 638c29b1be | |||
| de086b0efc | |||
| 30404b24f3 | |||
| 0c15317603 | |||
| 0e5f78ef0f | |||
| c4a2dff9df | |||
| 1e43561320 | |||
| 4101ae7fa2 | |||
| 66ef378009 | |||
| 9a64a40a3b | |||
| b5b4fb34af | |||
| 927f0db2a7 | |||
| ac4ef40e9a | |||
| 6338c94415 | |||
| 5991826f44 | |||
| 90dc7b6a77 | |||
| e017cd5ebf | |||
| f8f76d2bde | |||
| e011cae8ba | |||
| 05af3d2604 | |||
| 27f237397a | |||
| ec509018cc | |||
| 929df1655f | |||
| de9b8c9b84 | |||
| b89a71abad | |||
| 6effba1c1f | |||
| ffe05448de | |||
| 1e75763616 | |||
| 6458dad64e | |||
| 65cec403a0 | |||
| 421216ffea | |||
| a094c797e8 | |||
| b5d2f0b0a0 | |||
| 0344b791ba | |||
| 715fcdad4e | |||
| 8d7d814576 | |||
| 579adf0a05 | |||
| 9bec2fedcf | |||
| 5667bfd7e8 | |||
| 72a0c488f1 | |||
| 2d061947a6 | |||
| c5712fb8d0 | |||
| 5df4169bfd | |||
| 2dc93765b4 | |||
| f087c04e4f | |||
| 129a404153 | |||
| a102e7922f | |||
| 872e67328e | |||
| 6ed438fd74 | |||
| 11de2d41ae | |||
| 0f16547bcb | |||
| 608eee5167 | |||
| 0a752577fc | |||
| 3f6e673a6b | |||
| a285f0b68e | |||
| 217ad59844 | |||
| fc35b7b0eb | |||
| ddad78fea1 | |||
| 2ca9c993fd | |||
| 5a2483cdfa | |||
| fc51e197ea | |||
| 89b7ffbbba | |||
| ff1afcf073 | |||
| 9350f41fe2 | |||
| d8157061f1 | |||
| be2259df8d | |||
| c514f1187e | |||
| 66ae98628f | |||
| 65f1c6026c | |||
| d1aae27ca8 | |||
| 98f041de25 | |||
| 63ef4a4b23 | |||
| 44aee3d771 | |||
| 2d1ab3973b | |||
| 1cbf1dae99 | |||
| 059ee9bda3 | |||
| 22f907f27b | |||
| e428dab648 | |||
| abf412b2a2 | |||
| e2943af548 | |||
| cb8b34bae7 | |||
| 9a5f61bbdd | |||
| c7c54fdeab | |||
| 844e2965db | |||
| 9cce858cd5 | |||
| 7967a5f0f9 | |||
| 970699f934 | |||
| 256353e949 | |||
| 72d6412a8f | |||
| 8d7252eabf | |||
| eb14dff0cd | |||
| 58bb81edeb | |||
| f689d2afe1 | |||
| ed547bce34 | |||
| bf2bf01252 | |||
| 6c39aee1d0 | |||
| d1ddd81282 | |||
| 96b0ccf056 | |||
| 7289832288 | |||
| 03ee657182 | |||
| 0b6c2058ed | |||
| d50d5228cf | |||
| b0ebfce668 | |||
| 99c6b012e5 | |||
| 5ee6db55e0 | |||
| 709ca7fe27 | |||
| a6b197b6a4 | |||
| 021e19fb3c | |||
| 56141976e9 | |||
| 7c4fea3b60 | |||
| b7168fd349 | |||
| 87dc0ab99a | |||
| 9b7635e69e | |||
| cadc7a3a7c | |||
| 80e693caba | |||
| 1f31bf736b | |||
| 5b6f53fe4f | |||
| 04f64eda5e | |||
| 8f4e9f9fb8 | |||
| 5ffc4df914 | |||
| 9727ed4949 | |||
| fac74ab714 | |||
| ecbb0e7fe9 | |||
| fb3747f81d | |||
| c11add9cab | |||
| aa024c234c | |||
| 236311a98d | |||
| cb6ac8aa7c | |||
| 7fc4f9ec7d | |||
| 45d9a4927a | |||
| d2496a736a | |||
| 9b62080f21 | |||
| 1b046e5240 | |||
| 3f54a40282 | |||
| 4821233f90 | |||
| 3f294373f0 | |||
| 74f017e7b2 | |||
| dabaf86f28 | |||
| 6ca3a756ad | |||
| 1daab2d95f | |||
| 6388d5c0bb | |||
| cc1fb2a0c9 | |||
| 4fc380750e | |||
| 564e6dbac5 | |||
| 2a1309ecaa | |||
| d12c13c027 | |||
| 3c7ac83e3f | |||
| 089b056916 | |||
| c0a0bc347c | |||
| f2faff5f3f | |||
| d497b12805 | |||
| ed5f25fb4d | |||
| f48e200fe7 | |||
| 668a2c3c91 | |||
| cb8a4dcd75 | |||
| 4749773a51 | |||
| d41a4ce7ee | |||
| 5185766542 | |||
| cf7b239bcb | |||
| ad54b6e3c9 | |||
| cab913064f | |||
| c3aabfff88 | |||
| a0a1282aa2 | |||
| 8e6fb27ec8 | |||
| 32078154c9 | |||
| eac4af5029 | |||
| f199adb367 | |||
| 4051c11dad | |||
| 6be143756c | |||
| cfef8c9a4a | |||
| fb5e2c8455 | |||
| 5ebecc1d4b | |||
| 64d60088cb | |||
| dce274d8ff | |||
| 8133266734 | |||
| 147949285e | |||
| 9417dcf830 | |||
| 447b80428b | |||
| 95d9746fbf | |||
| 135671b5b9 | |||
| 45029768b9 | |||
| 9876be8389 | |||
| 9553b240d8 | |||
| 297416d1ce | |||
| 4148fff8a1 | |||
| 39862a753d | |||
| 85ad5c15b3 | |||
| c3a2df6bef | |||
| 4ceabc679a | |||
| 4733bb46ac | |||
| c97b3a974e | |||
| 9b1bd93ceb | |||
| 21185e0438 | |||
| 3f618a44e7 | |||
| e99e71a6a5 | |||
| adc3d07d35 | |||
| 2178a2e7cb | |||
| c39574582f | |||
| 6972b11f0a | |||
| 8e8544960e | |||
| 1752b38dc1 | |||
| b6dc907ad8 | |||
| 7d145f6200 | |||
| 8f0334c51b | |||
| da816f098a | |||
| 4752f03dfc | |||
| 7134c41dfc | |||
| ff22f194d4 | |||
| f9329c4a32 | |||
| 30c890a155 | |||
| 4407141739 | |||
| 734d3cf08c | |||
| c2792c0415 | |||
| f64a8add03 | |||
| 092b1fb02c | |||
| b3bc4df0c9 | |||
| 8d8a60878f | |||
| 5c45a7890a | |||
| 536c9d30e3 | |||
| e54a28bb9d | |||
| e663c02d97 | |||
| 4a1d3afb85 | |||
| 38254302e4 | |||
| 47554e0bca | |||
| e7f8104cb6 | |||
| 4569080000 | |||
| fc802c0db0 | |||
| 63f76373a5 | |||
| 5144fd405e | |||
| e45141b894 | |||
| b8cb8e3ad6 | |||
| 2fd710ea54 | |||
| c292ca77d0 | |||
| 02577be8c7 | |||
| a3ea9985e0 | |||
| f5c35fd03c | |||
| 2e210421e3 | |||
| b5a30921a7 | |||
| a980735bd8 | |||
| b95c3258ab | |||
| e276cc0eec | |||
| 7eaa783f2e | |||
| 48afb56d36 | |||
| 3c6a7b371a | |||
| baeb0a640b | |||
| 3660933143 | |||
| d196afbe89 | |||
| f6d5e2f925 | |||
| f5a28724b0 | |||
| 30fbba45db | |||
| dd1398415d | |||
| 07b4050a0d | |||
| 5ecf229620 | |||
| 4274a147f4 | |||
| 5d728d3a2f | |||
| 438baf6022 | |||
| 96ad111227 | |||
| 806c4c035f | |||
| 65e3ae4bd9 | |||
| e9bc16a1a4 | |||
| c90c19323b | |||
| 2c63d19cf4 | |||
| 1a4795f6e9 | |||
| d588a9ed2e | |||
| d22f24ad4b | |||
| d3c68d1ac6 | |||
| 04a3c86321 | |||
| 6e7836ffb7 | |||
| 05249c8a2e | |||
| 7a38ae22bc | |||
| 870e9a44ac | |||
| 71367398d6 | |||
| 055b5151df | |||
| f48e747299 | |||
| 887255253d | |||
| 0b3138b6c7 | |||
| bdaef62ba5 | |||
| ff85e08450 | |||
| 0c636e3ce3 | |||
| a1aab4a3fc | |||
| cb1b5058fd | |||
| 954cfe64c7 | |||
| 370651ebec | |||
| d96a05fb7e | |||
| 2da8c0346b | |||
| f6633ee2ed | |||
| 8ec7f0b425 | |||
| d753809a27 | |||
| 24abfebfe7 | |||
| 8a31842c17 | |||
| 886284c70d | |||
| c72edac318 | |||
| 669ca64f6c | |||
| a18650a700 | |||
| aba4022837 | |||
| 80664b0033 | |||
| db73de0718 | |||
| c6c18aab3c | |||
| 8c5f9ecd14 | |||
| 81626c4584 | |||
| 05aabebf6f | |||
| 25c794daf2 | |||
| 34029f173e | |||
| 264a4d61fa | |||
| 821494dd22 | |||
| 1768ee428f | |||
| cbaed77f63 | |||
| 32f53f09a4 | |||
| 05da03b836 | |||
| 1b7d286415 | |||
| 70bc86518d | |||
| d04c3baf44 | |||
| e40aa8d194 | |||
| be51f082f7 | |||
| f29a3bb673 | |||
| eba6324658 | |||
| 970e63b565 | |||
| 0f29b5e516 | |||
| 887b7f068a | |||
| 21a052895c | |||
| 412ae58717 | |||
| c2f8cc244d | |||
| a6cd373b2b | |||
| 78c20da3b1 | |||
| 730d3bd0fd | |||
| 1ad7877974 | |||
| 9399a3e372 | |||
| 5aedee6f8e | |||
| 7658e199fc | |||
| fc5afd432d | |||
| f41cde5c3c | |||
| 5738e49658 | |||
| 695a669b60 | |||
| 138aa48811 | |||
| 29328974c2 | |||
| e9eb786eaf | |||
| d2772d6a6e | |||
| 8ab0564ad8 | |||
| c60c4b8a11 | |||
| 53f615cabd | |||
| cef7d4e78a | |||
| 1ae42b518e | |||
| 637f04ae26 | |||
| 503bf53890 | |||
| 04e3e2ec29 | |||
| e6456414d7 | |||
| 0179d8ab20 | |||
| beaca9c60d | |||
| 0a89a44121 | |||
| 0be516d313 | |||
| 4b43539553 | |||
| ff9435b717 | |||
| 329b6ba040 | |||
| 61f849a922 | |||
| 45a2cde1e5 | |||
| e63e2b0e21 | |||
| b9afc66ee2 | |||
| 0288bf609f | |||
| 06cdcfbab7 | |||
| c9c268d824 | |||
| 1e5e583b40 | |||
| 6e1b1b74f5 | |||
| 5342a6b4f1 | |||
| 0a291773fa | |||
| 01737264b9 | |||
| 956ed75ed9 | |||
| 73935d3bc4 | |||
| e1c915d261 | |||
| ff3cb53fb6 | |||
| fb69ae0828 | |||
| 9b0bb0ea95 | |||
| ffd2fba015 | |||
| 4384c37823 | |||
| a673f8c939 | |||
| 1318e21c21 | |||
| 0643d7a3cc | |||
| 8ee98d7966 | |||
| 79b1cab10e | |||
| 3bfb4508df | |||
| c1b7a9b120 | |||
| 023f11c25e | |||
| 6cda0d1d5e | |||
| 6364157efd | |||
| 50568de7eb | |||
| cdf1478322 | |||
| fc9e1bf17e | |||
| 8e9a3fc301 | |||
| 765680a051 | |||
| fa9c5e7cf5 | |||
| 0b14aeba36 | |||
| 811ff581cf | |||
| 026549eff7 | |||
| f929aad937 | |||
| 36885ac135 | |||
| 2cd55bc3a7 | |||
| 7603b69925 | |||
| 2d91024820 | |||
| e8be9f4264 | |||
| c05eee7657 | |||
| 6c3949e3aa | |||
| 599fe4bb8e | |||
| 3b73728c41 | |||
| 5ad90cc437 | |||
| 61e9b7d89d | |||
| b0abc9d6cf | |||
| 0d84b2d066 | |||
| 6ba69a8dcc | |||
| e747f0d61e | |||
| 6d0b0a6abc | |||
| 4f90e837eb | |||
| 16aab9416c | |||
| 5526684a4b | |||
| 97519e6920 | |||
| 1475a86c75 | |||
| 75cf33384c | |||
| 575db84bb4 | |||
| 07097201dd | |||
| 5c4fe71b09 | |||
| 8743e40381 | |||
| 92e3f98271 | |||
| c01fb4f69c | |||
| 0a23b5b19d | |||
| bd450ea034 | |||
| e1775bda51 | |||
| 69c904cffa | |||
| a6848f631f | |||
| 92ac29ee5d | |||
| 76e9e4062c | |||
| 003dd5db24 | |||
| 156c544f73 | |||
| 900e6d181b | |||
| 38d53dc5c1 | |||
| 816a2188af | |||
| 4d0fe6e385 | |||
| 1ec4cd79eb | |||
| 14ecdc2269 | |||
| 099ddda6db | |||
| f0ba1006e5 | |||
| 330063d212 | |||
| d683d3cbf7 | |||
| 017566a9dd | |||
| a7c0b5de66 | |||
| 42e325db91 | |||
| f696234932 | |||
| c81fc52b8c | |||
| c4c8b98c93 | |||
| d74f9db1fe | |||
| db3aeec98e | |||
| 918396efc6 | |||
| dc74b4bde0 | |||
| 52db45d968 | |||
| 8f90cfcf1b | |||
| a86d9e4eb7 | |||
| 5cf22a5451 | |||
| 2d02d9e5bc | |||
| 051e902d64 | |||
| c6d8b14feb | |||
| 42d34290e2 | |||
| f19c62f75a | |||
| 33fa8c56d8 | |||
| 4d47c23808 | |||
| 284a01cabc | |||
| 83f311024a | |||
| cddf20683e | |||
| 8d430b9d3c | |||
| 3f7fc4ec29 | |||
| 5a2f94bc32 | |||
| ef6bbf94f7 | |||
| b5de8f34b3 | |||
| adb2034d24 | |||
| 492571645b | |||
| be00c17615 | |||
| a6c1c113df | |||
| 23b14da665 | |||
| fb41d46922 | |||
| 9ee088a832 | |||
| a27d677716 | |||
| cf059895f9 | |||
| 5fa858af78 | |||
| ee4c9c351f | |||
| d8f91e3dac | |||
| 88c8049a6f | |||
| cf49ec2618 | |||
| 4aa5217915 | |||
| eea36dbe80 | |||
| fe46f716eb | |||
| cea7e3ace6 | |||
| e6e6c20c9c | |||
| 787e23525c | |||
| 5a889964e7 | |||
| b7873f48de | |||
| 93bee419e8 | |||
| b59e654bbd | |||
| d50f434788 | |||
| ac79a60aee | |||
| cb445f95c0 | |||
| 6dbf0e9746 | |||
| f8b5174274 | |||
| 553694530e | |||
| 42ff8f3cbd | |||
| 8fa7bc9ed7 | |||
| f38ca8a4c9 | |||
| a7045d3b30 | |||
| 7ee9bd4492 | |||
| fb890c4ceb | |||
| 98174ef392 | |||
| 2baff92bf0 | |||
| 52a7058da6 | |||
| 290243835f | |||
| f75b9eda35 | |||
| e98d12e7e8 | |||
| 0411b624da | |||
| 97ec0558dd | |||
| cfb3279f52 | |||
| 1ade083d25 | |||
| 18a43a404c | |||
| f654c2889b | |||
| 28e1e3d4b1 | |||
| 935cb9e70b | |||
| 97c7ea774b | |||
| 87c61ac6e9 | |||
| e7750197c9 | |||
| 19750d202d | |||
| 9166630294 | |||
| d1c00e505c | |||
| 9cddf59c1d | |||
| 0aed1d01a2 | |||
| d39a050a04 | |||
| 38b36468f8 | |||
| aced36ad35 | |||
| 7b0757f128 | |||
| 0522d5085f | |||
| 0e48c679ef | |||
| fe386ce0d8 | |||
| 25e4d3ec05 | |||
| 52f8c664e6 | |||
| b4e1c001ab | |||
| 1678f7b283 | |||
| 5536818ec3 | |||
| 9125667700 | |||
| 6598b63079 | |||
| b7bd232410 |
44
.gitignore
vendored
44
.gitignore
vendored
@@ -1,8 +1,44 @@
|
||||
elpa
|
||||
transient
|
||||
eln-cache
|
||||
private/.*
|
||||
private/cache
|
||||
private/
|
||||
bookmarks
|
||||
.lsp-session-v1
|
||||
projectile-bookmarks.eld
|
||||
.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/
|
||||
/.emacs.desktop
|
||||
/.tutor/
|
||||
/intelephense/
|
||||
/auto-save-list/
|
||||
/*.eld
|
||||
/.custom.el
|
||||
/eca/
|
||||
/codeium/
|
||||
/places
|
||||
/recentf
|
||||
/agent/
|
||||
|
||||
46
abbrev_defs
Normal file
46
abbrev_defs
Normal file
@@ -0,0 +1,46 @@
|
||||
;; -*- coding: utf-8; lexical-binding: t -*-
|
||||
(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 'php-mode-abbrev-table
|
||||
'(
|
||||
("actions" "/**
|
||||
* Actions
|
||||
*/" nil :count 6)
|
||||
("asserts" "/**
|
||||
* Asserts
|
||||
*/" nil :count 6)
|
||||
("phpcsdisablelinelenght" "// phpcs:disable Generic.Files.LineLength.TooLong" nil :count 3)
|
||||
("phpcsenablelinelenght" "// phpcs:disable Generic.Files.LineLength.TooLong" nil :count 2)
|
||||
("preparing" "/**
|
||||
* Preparing
|
||||
*/" nil :count 8)
|
||||
))
|
||||
|
||||
(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 10)
|
||||
("doctype" "<!DOCTYPE html>" nil :count 2)
|
||||
))
|
||||
|
||||
@@ -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
|
||||
@@ -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))
|
||||
@@ -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
|
||||
135
configs/base.el
135
configs/base.el
@@ -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
|
||||
30
configs/gptel-agents/README.md
Normal file
30
configs/gptel-agents/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# gptel-agents
|
||||
|
||||
Agentes y prompts internos para `gptel-agent`, portados de [opencode](https://opencode.ai) (MIT).
|
||||
|
||||
## Estructura
|
||||
|
||||
- `gptel-agent.md` — port del agente **build** de opencode (agente por defecto; sobreescribe el preset `gptel-agent` del paquete).
|
||||
- `gptel-plan.md` — port del agente **plan** de opencode (solo lectura; sobreescribe el preset `gptel-plan`).
|
||||
- `explore.md` — subagente explorador de codebases (port de opencode `explore`).
|
||||
- `general.md` — subagente de propósito general para tareas paralelas.
|
||||
- `prompts/` — prompts internos copiados de `packages/opencode/src/agent/prompt/`:
|
||||
- `compaction.txt` — usado como `gptel-agent-compact-prompt`.
|
||||
- `title.txt`, `summary.txt`, `explore.txt` — copiados para referencia (opencode es MIT).
|
||||
|
||||
## Notas
|
||||
|
||||
- Estos archivos se añaden al **final** de `gptel-agent-dirs` para que la precedencia
|
||||
(el último dir gana) sobreescriba los agentes por defecto del paquete `gptel-agent`.
|
||||
- Los `{{AGENTS}}`/`{{SKILLS}}` del cuerpo se expanden automáticamente por `gptel-agent`.
|
||||
- Las tools LSP (`lsp_diagnostics` y `lsp_symbols`, basadas en eglot/flymake),
|
||||
`apply_patch` (diff unificado vía `patch`) y `plan_write` (guarda planes
|
||||
fuera del proyecto, en `kj-gptel-plans-dir` con nombre `<hash>--<proyecto>--<plan>.md`)
|
||||
se definen en `configs/init-ai.el` y se referencian desde los
|
||||
agentes correspondientes.
|
||||
- `confirm-tool-calls`: build y general usan `auto` (confirmación por tool);
|
||||
plan y explore usan `false` (solo lectura, sin confirmar cada lectura).
|
||||
- Comandos (en `configs/init-ai.el`): `M-x kj-gptel-opencode-summary`
|
||||
(resumen tipo PR con `prompts/summary.txt`) y `M-x kj-gptel-opencode-title`
|
||||
(título con `prompts/title.txt`). `kj-gptel-opencode-small-model` permite
|
||||
usar un modelo pequeño si existe en el backend activo.
|
||||
34
configs/gptel-agents/explore.md
Normal file
34
configs/gptel-agents/explore.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: explore
|
||||
description: >
|
||||
Fast agent specialized for exploring codebases. Use this when you need to
|
||||
quickly find files by patterns (eg. "src/components/**/*.tsx"), search code
|
||||
for keywords (eg. "API endpoints"), or answer questions about the codebase.
|
||||
Specify the desired thoroughness level: "quick", "medium" or "very thorough".
|
||||
tools:
|
||||
- Glob
|
||||
- Grep
|
||||
- Read
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
confirm-tool-calls: false
|
||||
---
|
||||
You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
|
||||
|
||||
Your strengths:
|
||||
- Rapidly finding files using glob patterns
|
||||
- Searching code and text with powerful regex patterns
|
||||
- Reading and analyzing file contents
|
||||
|
||||
Guidelines:
|
||||
- Use Glob for broad file pattern matching
|
||||
- Use Grep for searching file contents with regex
|
||||
- Use Read when you know the specific file path you need to read
|
||||
- Use Bash for file operations like copying, moving, or listing directory contents
|
||||
- Adapt your search approach based on the thoroughness level specified by the caller
|
||||
- Return file paths as absolute paths in your final response
|
||||
- For clear communication, avoid using emojis
|
||||
- Do not create any files, or run bash commands that modify the user's system state in any way
|
||||
|
||||
Complete the user's search request efficiently and report your findings clearly.
|
||||
35
configs/gptel-agents/general.md
Normal file
35
configs/gptel-agents/general.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: general
|
||||
description: >
|
||||
General-purpose agent for researching complex questions and executing
|
||||
multi-step tasks. Use this agent to execute multiple units of work in parallel.
|
||||
tools:
|
||||
- Agent
|
||||
- TodoWrite
|
||||
- Glob
|
||||
- Grep
|
||||
- Read
|
||||
- Insert
|
||||
- Edit
|
||||
- Write
|
||||
- Mkdir
|
||||
- Eval
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
- YouTube
|
||||
- Skill
|
||||
- lsp_diagnostics
|
||||
- lsp_symbols
|
||||
confirm-tool-calls: auto
|
||||
---
|
||||
<role_and_behavior>
|
||||
You are a general-purpose agent. Your task is to complete concrete units of work autonomously and reliably, returning clear results.
|
||||
|
||||
- Execute the tasks you are given with the resources available: read/edit files, run commands and search for information.
|
||||
- Use `TodoWrite` for multi-step tasks and keep it updated.
|
||||
- Use the relevant skills when they apply.
|
||||
- Return a concise summary of what was done, in the user's language.
|
||||
|
||||
{{SKILLS}}
|
||||
</role_and_behavior>
|
||||
62
configs/gptel-agents/gptel-agent.md
Normal file
62
configs/gptel-agents/gptel-agent.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
name: gptel-agent
|
||||
description: The default agent. Executes tools based on configured permissions.
|
||||
tools:
|
||||
- Agent
|
||||
- TodoWrite
|
||||
- Glob
|
||||
- Grep
|
||||
- Read
|
||||
- Insert
|
||||
- Edit
|
||||
- Write
|
||||
- Mkdir
|
||||
- Eval
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
- YouTube
|
||||
- Skill
|
||||
- lsp_diagnostics
|
||||
- lsp_symbols
|
||||
confirm-tool-calls: auto
|
||||
---
|
||||
<role_and_behavior>
|
||||
You are a coding agent that works directly on the filesystem at the project root. You can read, edit and create files, run shell commands, search the code and delegate to subagents.
|
||||
|
||||
- Keep responses concise and in the user's language.
|
||||
- Prioritize accuracy over being agreeable; challenge the user constructively when you know a better approach.
|
||||
- Never use shell tools to communicate: return text directly to the user.
|
||||
- Do not write documentation files unless asked to.
|
||||
|
||||
<critical_thinking>
|
||||
- Before executing, consider if there's a better way to accomplish the task.
|
||||
- Think about the larger problem - does the task need to be done this way at all?
|
||||
- Investigate to find truth before confirming beliefs.
|
||||
</critical_thinking>
|
||||
|
||||
<tool_usage_policy>
|
||||
When working on tasks, follow these guidelines:
|
||||
|
||||
- Use `TodoWrite` for any multi-step work (3+ steps) and keep it updated.
|
||||
- Use `Glob` to search files by pattern, `Grep` to search contents, `Read` to read, and `Edit`/`Insert`/`Write` to modify. Reserve `Bash` for git, builds, tests, package managers and system operations; do not use `Bash` for file operations that have their own tool.
|
||||
- Run multiple tools in parallel when they are independent.
|
||||
- After making changes, verify your work: run the tests or close the loop as appropriate.
|
||||
- Use the available skills when relevant to the task.
|
||||
|
||||
{{SKILLS}}
|
||||
|
||||
<tool name="Agent">
|
||||
**When to delegate with `Agent` (subagents with separate context):**
|
||||
- Open-ended code or web research → delegate to the exploration/research agent.
|
||||
- Well-defined multi-step tasks that would bloat your context → delegate to the executor agent.
|
||||
- Understanding Emacs/elisp APIs or state → delegate to the introspection agent.
|
||||
- Explore first; if the search work is extensive (3+ files or several rounds), delegate instead of filling your context.
|
||||
|
||||
Delegate early and trust subagent results, integrating them into your response.
|
||||
|
||||
**Available agents:**
|
||||
{{AGENTS}}
|
||||
</tool>
|
||||
</tool_usage_policy>
|
||||
</role_and_behavior>
|
||||
49
configs/gptel-agents/gptel-plan.md
Normal file
49
configs/gptel-agents/gptel-plan.md
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
name: gptel-plan
|
||||
description: >
|
||||
Plan mode (ported from opencode's "plan" agent). Read-only: analyzes the
|
||||
context and proposes a detailed implementation plan without editing files.
|
||||
tools:
|
||||
- Agent
|
||||
- Glob
|
||||
- Grep
|
||||
- Read
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
- YouTube
|
||||
- Skill
|
||||
- lsp_diagnostics
|
||||
- lsp_symbols
|
||||
- plan_write
|
||||
confirm-tool-calls: false
|
||||
---
|
||||
<role_and_behavior>
|
||||
You are a planning agent. Your job is to produce clear, actionable implementation plans. You have read-only tools: you cannot modify files or run code, only explore and analyze.
|
||||
|
||||
- Keep responses concise and in the user's language.
|
||||
- Before planning, understand the problem deeply and explore the actual code.
|
||||
- Consider multiple approaches and their trade-offs; recommend one with justification.
|
||||
|
||||
<planning_methodology>
|
||||
1. **Understand the request**: main goal, constraints and ambiguities.
|
||||
2. **Gather context**: explore relevant files with your read-only tools; delegate extensive exploration to a research subagent when the context is large.
|
||||
3. **Analyze approaches**: options, trade-offs (complexity, maintainability, risk), and the most suitable one.
|
||||
4. **Create the plan**: logical, concrete steps, affected files, dependencies, testing requirements and open decisions.
|
||||
5. **Present the plan**: recommended approach, clear steps, considerations and risks.
|
||||
</planning_methodology>
|
||||
|
||||
<tool_usage_policy>
|
||||
- Use `Glob`, `Grep`, `Read`, `WebSearch` and `WebFetch` to explore.
|
||||
- For extensive exploration, delegate to the research/introspection agent; not to executor agents.
|
||||
- Do NOT edit, write or execute: your output is a plan for someone else to execute.
|
||||
|
||||
<tool name="Agent">
|
||||
**When to delegate:** extensive code research, "how does X work", or exploration that would bloat your context.
|
||||
**Do not delegate to executor agents**: you are planning, not executing.
|
||||
|
||||
**Available agents:**
|
||||
{{AGENTS}}
|
||||
</tool>
|
||||
|
||||
{{SKILLS}}
|
||||
</tool_usage_policy>
|
||||
9
configs/gptel-agents/prompts/compaction.txt
Normal file
9
configs/gptel-agents/prompts/compaction.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
You are an anchored context summarization assistant for coding sessions.
|
||||
|
||||
Summarize only the conversation history you are given. The newest turns may be kept verbatim outside your summary, so focus on the older context that still matters for continuing the work.
|
||||
|
||||
If the prompt includes a <previous-summary> block, treat it as the current anchored summary. Update it with the new history by preserving still-true details, removing stale details, and merging in new facts.
|
||||
|
||||
Always follow the exact output structure requested by the user prompt. Keep every section, preserve exact file paths and identifiers when known, and prefer terse bullets over paragraphs.
|
||||
|
||||
Do not answer the conversation itself. Do not mention that you are summarizing, compacting, or merging context. Respond in the same language as the conversation.
|
||||
18
configs/gptel-agents/prompts/explore.txt
Normal file
18
configs/gptel-agents/prompts/explore.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
|
||||
|
||||
Your strengths:
|
||||
- Rapidly finding files using glob patterns
|
||||
- Searching code and text with powerful regex patterns
|
||||
- Reading and analyzing file contents
|
||||
|
||||
Guidelines:
|
||||
- Use Glob for broad file pattern matching
|
||||
- Use Grep for searching file contents with regex
|
||||
- Use Read when you know the specific file path you need to read
|
||||
- Use Bash for file operations like copying, moving, or listing directory contents
|
||||
- Adapt your search approach based on the thoroughness level specified by the caller
|
||||
- Return file paths as absolute paths in your final response
|
||||
- For clear communication, avoid using emojis
|
||||
- Do not create any files, or run bash commands that modify the user's system state in any way
|
||||
|
||||
Complete the user's search request efficiently and report your findings clearly.
|
||||
11
configs/gptel-agents/prompts/summary.txt
Normal file
11
configs/gptel-agents/prompts/summary.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Summarize what was done in this conversation. Write like a pull request description.
|
||||
|
||||
Rules:
|
||||
- 2-3 sentences max
|
||||
- Describe the changes made, not the process
|
||||
- Do not mention running tests, builds, or other validation steps
|
||||
- Do not explain what the user asked for
|
||||
- Write in first person (I added..., I fixed...)
|
||||
- Never ask questions or add new questions
|
||||
- If the conversation ends with an unanswered question to the user, preserve that exact question
|
||||
- If the conversation ends with an imperative statement or request to the user (e.g. "Now please run the command and paste the console output"), always include that exact request in the summary
|
||||
44
configs/gptel-agents/prompts/title.txt
Normal file
44
configs/gptel-agents/prompts/title.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
You are a title generator. You output ONLY a thread title. Nothing else.
|
||||
|
||||
<task>
|
||||
Generate a brief title that would help the user find this conversation later.
|
||||
|
||||
Follow all rules in <rules>
|
||||
Use the <examples> so you know what a good title looks like.
|
||||
Your output must be:
|
||||
- A single line
|
||||
- ≤50 characters
|
||||
- No explanations
|
||||
</task>
|
||||
|
||||
<rules>
|
||||
- you MUST use the same language as the user message you are summarizing
|
||||
- Title must be grammatically correct and read naturally - no word salad
|
||||
- Never include tool names in the title (e.g. "read tool", "bash tool", "edit tool")
|
||||
- Focus on the main topic or question the user needs to retrieve
|
||||
- Vary your phrasing - avoid repetitive patterns like always starting with "Analyzing"
|
||||
- When a file is mentioned, focus on WHAT the user wants to do WITH the file, not just that they shared it
|
||||
- Keep exact: technical terms, numbers, filenames, HTTP codes
|
||||
- Remove: the, this, my, a, an
|
||||
- Never assume tech stack
|
||||
- Never use tools
|
||||
- NEVER respond to questions, just generate a title for the conversation
|
||||
- The title should NEVER include "summarizing" or "generating" when generating a title
|
||||
- DO NOT SAY YOU CANNOT GENERATE A TITLE OR COMPLAIN ABOUT THE INPUT
|
||||
- Always output something meaningful, even if the input is minimal.
|
||||
- If the user message is short or conversational (e.g. "hello", "lol", "what's up", "hey"):
|
||||
→ create a title that reflects the user's tone or intent (such as Greeting, Quick check-in, Light chat, Intro message, etc.)
|
||||
</rules>
|
||||
|
||||
<examples>
|
||||
"debug 500 errors in production" → Debugging production 500 errors
|
||||
"refactor user service" → Refactoring user service
|
||||
"why is app.js failing" → app.js failure investigation
|
||||
"implement rate limiting" → Rate limiting implementation
|
||||
"how do I connect postgres to my API" → Postgres API connection
|
||||
"best practices for React hooks" → React hooks best practices
|
||||
"@src/auth.ts can you add refresh token support" → Auth refresh token support
|
||||
"@utils/parser.ts this is broken" → Parser bug fix
|
||||
"look at @config.json" → Config review
|
||||
"@App.tsx add dark mode toggle" → Dark mode toggle in App
|
||||
</examples>
|
||||
233
configs/init-ai.el
Normal file
233
configs/init-ai.el
Normal file
@@ -0,0 +1,233 @@
|
||||
;;; init-ai.el --- Configuración de inteligencias artificales -*- lexical-binding: t -*-
|
||||
|
||||
;; Author: kj <webmaster@outcontrol.net>
|
||||
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Configuración para Inteligencia artifical en Emacs.
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Cliente LLM (ollama, chatgpt, gemini, etc.)
|
||||
(use-package gptel
|
||||
:defer nil
|
||||
:config
|
||||
(when (getenv "GEMINI_KEY")
|
||||
(gptel-make-gemini "Gemini"
|
||||
:key (getenv "GEMINI_KEY")
|
||||
:stream t))
|
||||
|
||||
(gptel-make-openai "llama.cpp"
|
||||
:stream t
|
||||
:protocol "http"
|
||||
:host "127.0.0.1:1945"
|
||||
:models '("Qwen3.8-27B"
|
||||
"gemma-4-12B"
|
||||
"gemma-4-E2B"
|
||||
"gemma-4-E4B"
|
||||
"gptoss-20b"))
|
||||
|
||||
(gptel-make-ollama "Ollama"
|
||||
:host "localhost:11434"
|
||||
:stream t
|
||||
:request-params '(:think :json-false)
|
||||
:models '("gemma4:31b-cloud"
|
||||
"glm-5.1:cloud"
|
||||
"kimi-k2.6:cloud"
|
||||
"gpt-oss:20b-cloud"
|
||||
"minimax-m2.5:cloud"
|
||||
"qwen3-coder-next:cloud"))
|
||||
|
||||
;; Backend opencode-go: suscripción OpenCode Go vía endpoint OpenAI-compatible
|
||||
(defun kj-opencode-go-key ()
|
||||
"Return the OpenCode Go API key from opencode's auth file."
|
||||
(let ((auth (with-temp-buffer
|
||||
(insert-file-contents "~/.local/share/opencode/auth.json")
|
||||
(json-parse-buffer :object-type 'alist))))
|
||||
(alist-get 'key (alist-get 'opencode-go auth))))
|
||||
|
||||
(defvar-local kj-opencode-session-id nil
|
||||
"Stable OpenCode session id for this conversation buffer.")
|
||||
|
||||
(defun kj-opencode-go-new-session-id ()
|
||||
"Generate a new stable-enough random id for x-opencode-session."
|
||||
(md5 (format "opencode-go-%s-%s" (random) (float-time))))
|
||||
|
||||
(defun kj-opencode-go-session-id (info)
|
||||
"Return a stable x-opencode-session id for the buffer in INFO."
|
||||
(let ((buf (or (plist-get info :buffer) (current-buffer))))
|
||||
(if (buffer-live-p buf)
|
||||
(with-current-buffer buf
|
||||
(or kj-opencode-session-id
|
||||
(setq-local kj-opencode-session-id
|
||||
(kj-opencode-go-new-session-id))))
|
||||
(kj-opencode-go-new-session-id))))
|
||||
|
||||
(defun kj-opencode-go-header (info)
|
||||
"Auth plus per-conversation session header for the OpenCode Go backends."
|
||||
(append
|
||||
(when-let* ((key (gptel--get-api-key)))
|
||||
`(("Authorization" . ,(concat "Bearer " key))))
|
||||
`(("x-opencode-session" . ,(kj-opencode-go-session-id info)))))
|
||||
|
||||
(gptel-make-openai "OpenCode Go"
|
||||
:host "opencode.ai"
|
||||
:endpoint "/zen/go/v1/chat/completions"
|
||||
:key #'kj-opencode-go-key
|
||||
:header #'kj-opencode-go-header
|
||||
:stream t
|
||||
:models '(minimax-m3 minimax-m2.7 minimax-m2.5
|
||||
kimi-k3 kimi-k2.7-code kimi-k2.6 longcat-2.0 kimi-k2.5
|
||||
glm-5.3-flash glm-5.3 glm-5.2 glm-5.1 glm-5
|
||||
deepseek-v4-pro deepseek-v4-flash deepseek-v4-flash-vision-exp
|
||||
qwen3.8-max qwen3.7-max qwen3.7-plus qwen3.6-plus qwen3.5-plus
|
||||
mimo-v2-pro mimo-v2-omni mimo-v2.5-pro mimo-v2.5
|
||||
hy3 hy3-preview
|
||||
gpt-5.6-luna grok-4.5 grok-4.6
|
||||
muse-spark-1.2-contributor))
|
||||
|
||||
;; Modelos gratuitos de OpenCode Go, servidos vía el endpoint /zen/v1
|
||||
(gptel-make-openai "OpenCode Free"
|
||||
:host "opencode.ai"
|
||||
:endpoint "/zen/v1/chat/completions"
|
||||
:key #'kj-opencode-go-key
|
||||
:header #'kj-opencode-go-header
|
||||
:stream t
|
||||
:models '(big-pickle deepseek-v4-flash-free muse-spark-1.2-contributor-free
|
||||
mimo-v2.5-free hy3-free nemotron-3-ultra-free
|
||||
nemotron-3.5-lightning-free laguna-s-2.1-free))
|
||||
|
||||
;; Backend y modelo por defecto
|
||||
(setq gptel-backend (gptel-get-backend "OpenCode Go")
|
||||
gptel-model 'mimo-v2.5)
|
||||
|
||||
(setq gptel-default-mode 'markdown-mode
|
||||
gptel-prompt-prefix-alist
|
||||
'((markdown-mode . "# User\n\n")
|
||||
(org-mode . "* User\n\n")
|
||||
(text-mode . "# User\n\n"))
|
||||
gptel-response-prefix-alist
|
||||
'((markdown-mode . "# AI\n\n")
|
||||
(org-mode . "* AI\n\n")
|
||||
(text-mode . "# AI\n\n"))
|
||||
gptel-directives
|
||||
'((default . "You are a large language model living in Emacs and a helpful assistant. Respond concisely in Spanish."))
|
||||
)
|
||||
|
||||
(add-hook 'gptel-post-response-functions 'gptel-end-of-response)
|
||||
;; El "thinking" de los modelos se muestra en los buffers gptel.
|
||||
;; `ignore' (valor por defecto de gptel) lo muestra pero NO lo reenvía
|
||||
;; al modelo en turnos posteriores (recomendado: evita llenar el
|
||||
;; contexto, ver NEWS de gptel). Usar `t' si además se quiere
|
||||
;; reenviarlo y `nil' para deshabilitarlo (útil para respuestas mas rápidas).
|
||||
(setopt gptel-include-reasoning 'ignore)
|
||||
|
||||
(defun gptel-switch+model ()
|
||||
"Switch to gptel backend and model in a single completion prompt."
|
||||
(interactive)
|
||||
(let (choices)
|
||||
(dolist (pair gptel--known-backends)
|
||||
(let* ((backend-name (car pair))
|
||||
(backend (cdr pair))
|
||||
(models
|
||||
(and (fboundp 'gptel-backend-models)
|
||||
(gptel-backend-models backend))))
|
||||
(when models
|
||||
(dolist (model models)
|
||||
(push (cons ; (format "%s:%s" backend-name model)
|
||||
(format "%s → %s"
|
||||
(propertize backend-name 'face 'font-lock-keyword-face)
|
||||
(propertize (symbol-name model) 'face 'font-lock-function-name-face))
|
||||
(cons backend-name model))
|
||||
choices)))))
|
||||
(let* ((choice
|
||||
(completing-read "Model: " (mapcar #'car choices) nil t))
|
||||
(sel (cdr (assoc choice choices))))
|
||||
(setq gptel-backend (cdr (assoc (car sel) gptel--known-backends))
|
||||
gptel-model (cdr sel))
|
||||
(message "gptel set to %s:%s" (car sel) (cdr sel)))))
|
||||
)
|
||||
|
||||
;; (use-package copilot
|
||||
;; :hook (prog-mode . copilot-mode)
|
||||
;; :bind (:map copilot-completion-map
|
||||
;; ("C-g" . 'copilot-clear-overlay)
|
||||
;; ("C-<return>" . 'copilot-accept-completion)
|
||||
;; ("S-<return>" . 'copilot-accept-completion-by-word)))
|
||||
|
||||
(use-package gptel-magit
|
||||
:ensure t
|
||||
:hook (magit-mode . gptel-magit-install)
|
||||
:config
|
||||
;; gptel-magit no sabe manejar el contenido de "reasoning": gptel entrega
|
||||
;; el thinking al callback como (reasoning . TEXTO) y gptel-magit lo
|
||||
;; inserta como si fuera la respuesta final, fallando con
|
||||
;; Wrong type argument: char-or-string-p, (reasoning . "...")
|
||||
;; (https://github.com/ragnard/gptel-magit/issues/8). Esto ocurre
|
||||
;; aunque `gptel-include-reasoning' sea nil, porque gptel entrega las
|
||||
;; celdas (reasoning . ...) al callback de forma incondicional (solo
|
||||
;; controla si se insertan en el buffer gptel y si se reenvían).
|
||||
;; En vez de deshabilitar el thinking globalmente, sanitizamos la
|
||||
;; respuesta en el callback: se descartan las celdas de reasoning y solo
|
||||
;; se deja pasar la respuesta final (string). Así el thinking sigue
|
||||
;; activo en las sesiones gptel normales.
|
||||
(defun kj-gptel-magit--string-response-callback (callback)
|
||||
"Return a callback that forwards only string responses to CALLBACK.
|
||||
Discards the (reasoning . TEXT) cells through which gptel delivers the
|
||||
thinking content to the callback (see `gptel-request')."
|
||||
(lambda (response &rest args)
|
||||
(when (stringp response)
|
||||
(apply callback response args))))
|
||||
|
||||
(defun kj-gptel-magit--sanitize-callback (orig-fn &rest args)
|
||||
"Around advice for `gptel-magit--request'.
|
||||
Wraps the :callback argument of ARGS so that responses with reasoning
|
||||
content do not break gptel-magit."
|
||||
(let ((pos (cl-position :callback args)))
|
||||
(when (and pos (functionp (nth (1+ pos) args)))
|
||||
(setf (nth (1+ pos) args)
|
||||
(kj-gptel-magit--string-response-callback
|
||||
(nth (1+ pos) args)))))
|
||||
(apply orig-fn args))
|
||||
|
||||
(advice-add 'gptel-magit--request :around
|
||||
#'kj-gptel-magit--sanitize-callback))
|
||||
|
||||
(use-package gptel-autocomplete
|
||||
:defer nil
|
||||
:ensure (:host github :repo "JDNdeveloper/gptel-autocomplete")
|
||||
:bind (("M-<return>" . gptel-complete)
|
||||
:map gptel-autocomplete-completion-map
|
||||
("C-<return>" . gptel-accept-completion)))
|
||||
|
||||
(use-package macher
|
||||
:ensure (:host github :repo "kmontag/macher")
|
||||
:custom
|
||||
(macher-action-buffer-ui 'org))
|
||||
|
||||
;; agent-shell: interfaz nativa de Emacs para interactuar con agentes ACP
|
||||
(use-package shell-maker)
|
||||
|
||||
(use-package acp)
|
||||
|
||||
(use-package agent-shell
|
||||
:after (shell-maker acp)
|
||||
:hook (elpaca-after-init . (lambda () (defalias 'opencode #'agent-shell-opencode-start-agent)))
|
||||
:config
|
||||
(setq agent-shell-opencode-authentication
|
||||
(agent-shell-opencode-make-authentication :none t))
|
||||
(setq agent-shell-opencode-default-model-id "opencode-go/qwen3.8-flash")
|
||||
|
||||
;; Header compacto
|
||||
(setq agent-shell-header-style 'text)
|
||||
|
||||
;; Restaurar sesiones con texto completo
|
||||
(setq agent-shell-session-restore-verbosity 'full)
|
||||
|
||||
;; Desactivar guardado de transcripciones y prompt al cerrar
|
||||
(setq agent-shell-transcript-file-path-function nil)
|
||||
(setq shell-maker-prompt-before-killing-buffer nil))
|
||||
|
||||
(provide 'init-ai)
|
||||
;;; init-ai.el ends here
|
||||
138
configs/init-base.el
Normal file
138
configs/init-base.el
Normal file
@@ -0,0 +1,138 @@
|
||||
;;; 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.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'init-functions)
|
||||
|
||||
;; 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)
|
||||
))
|
||||
|
||||
;; Custom configs file
|
||||
(setq custom-file (concat user-emacs-directory ".custom.el"))
|
||||
(add-hook 'elpaca-after-init-hook (lambda () (load custom-file 'noerror)))
|
||||
|
||||
;; Garbage Collector Magic Hack
|
||||
(use-package gcmh
|
||||
:diminish
|
||||
:hook (emacs-startup . gcmh-mode)
|
||||
:init
|
||||
(setq gcmh-idle-delay 'auto
|
||||
gcmh-auto-idle-delay-factor 10
|
||||
gcmh-high-cons-threshold #x1000000)) ; 16MB
|
||||
|
||||
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
|
||||
(use-package saveplace
|
||||
:ensure nil
|
||||
:hook (after-init . save-place-mode))
|
||||
|
||||
;; Recentf - Guarda registro de los archivos abiertos recientemente
|
||||
(use-package recentf
|
||||
:ensure nil
|
||||
:bind (("C-x C-r" . recentf-open-files))
|
||||
:hook (after-init . recentf-mode)
|
||||
:init (setq recentf-max-saved-items 300
|
||||
recentf-exclude
|
||||
'("\\.?cache" ".cask" "url" "COMMIT_EDITMSG\\'" "bookmarks"
|
||||
"\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$"
|
||||
"\\.?ido\\.last$" "\\.revive$" "/G?TAGS$" "/.elfeed/"
|
||||
"^/tmp/" "^/var/folders/.+$" "^/ssh:" "/persp-confs/"
|
||||
(lambda (file) (file-in-directory-p file package-user-dir))))
|
||||
:config
|
||||
(push (expand-file-name recentf-save-file) recentf-exclude)
|
||||
(add-to-list 'recentf-filename-handlers #'abbreviate-file-name))
|
||||
|
||||
;; Guarda el historial del minibuffer
|
||||
(use-package savehist
|
||||
:ensure nil
|
||||
:hook (after-init . savehist-mode)
|
||||
:init (setq enable-recursive-minibuffers t ; Allow commands in minibuffers
|
||||
history-length 1000
|
||||
savehist-additional-variables '(mark-ring
|
||||
global-mark-ring
|
||||
search-ring
|
||||
regexp-search-ring
|
||||
extended-command-history)
|
||||
savehist-autosave-interval 300))
|
||||
|
||||
;; Misc.
|
||||
(use-package simple
|
||||
:ensure nil
|
||||
:hook ((after-init . size-indication-mode)
|
||||
(before-save . delete-trailing-whitespace)
|
||||
(text-mode . visual-line-mode))
|
||||
:init
|
||||
(setq column-number-mode t
|
||||
line-number-mode t
|
||||
kill-whole-line t ; Kill line including '\n' (C-k)
|
||||
line-move-visual nil
|
||||
track-eol t ; Keep cursor at end of lines. Require line-move-visual is nil.
|
||||
set-mark-command-repeat-pop t) ; Repeating C-SPC after popping mark pops it again
|
||||
;; Automatically reload files changed on disk
|
||||
(global-auto-revert-mode 1) ;; buffers
|
||||
(setq global-auto-revert-non-file-buffers t) ;; dired
|
||||
;; auto-revert-verbose nil) ;; disable notifications
|
||||
;; Visualize TAB, (HARD) SPACE, NEWLINE
|
||||
(setq-default show-trailing-whitespace nil ; Don't show trailing whitespace by default
|
||||
cursor-type 'bar) ; Usar la barrita como cursor
|
||||
(setq show-trailing-whitespace t))
|
||||
|
||||
|
||||
;; UTF-8 please
|
||||
(when (fboundp 'set-charset-priority)
|
||||
(set-charset-priority 'unicode))
|
||||
(set-language-environment "UTF-8")
|
||||
(set-default-coding-systems 'utf-8)
|
||||
(set-buffer-file-coding-system 'utf-8)
|
||||
(set-clipboard-coding-system 'utf-8)
|
||||
(set-file-name-coding-system 'utf-8)
|
||||
(set-keyboard-coding-system 'utf-8)
|
||||
(set-next-selection-coding-system 'utf-8)
|
||||
(set-selection-coding-system 'utf-8)
|
||||
(set-terminal-coding-system 'utf-8)
|
||||
(setq locale-coding-system 'utf-8)
|
||||
(setq system-time-locale "C")
|
||||
|
||||
;; Misc
|
||||
(if (boundp 'use-short-answers)
|
||||
(setq use-short-answers t)
|
||||
(fset 'yes-or-no-p 'y-or-n-p))
|
||||
(setq-default major-mode 'text-mode
|
||||
fill-column 80
|
||||
tab-width 4
|
||||
indent-tabs-mode nil) ; Permanently indent with spaces, never with TABs
|
||||
|
||||
(setq visible-bell t
|
||||
inhibit-compacting-font-caches t ; Don’t compact font caches during GC
|
||||
delete-by-moving-to-trash t ; Deleting files go to OS's trash folder
|
||||
make-backup-files nil ; Forbide to make backup files
|
||||
auto-save-default nil ; Disable auto sav
|
||||
inhibit-splash-screen t
|
||||
uniquify-buffer-name-style 'post-forward-angle-brackets ; Show path if names are same
|
||||
adaptive-fill-regexp "[ t]+|[ t]*([0-9]+.|*+)[ t]*"
|
||||
adaptive-fill-first-line-regexp "^* *$"
|
||||
sentence-end "\\([。!?]\\|……\\|[.?!][]\"')}]*\\($\\|[ \t]\\)\\)[ \t\n]*"
|
||||
sentence-end-double-space nil
|
||||
word-wrap-by-category t)
|
||||
|
||||
;; Async
|
||||
(use-package async
|
||||
:functions (async-bytecomp-package-mode dired-async-mode)
|
||||
:init
|
||||
(async-bytecomp-package-mode 1)
|
||||
(dired-async-mode 1))
|
||||
|
||||
(provide 'init-base)
|
||||
;;; init-base.el ends here
|
||||
127
configs/init-completion.el
Normal file
127
configs/init-completion.el
Normal file
@@ -0,0 +1,127 @@
|
||||
;;; init-completion.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:
|
||||
|
||||
;; childframe con los cantidatos de autocompletado
|
||||
(use-package corfu
|
||||
:ensure (:files (:defaults "extensions/*")
|
||||
:includes (corfu-info corfu-history))
|
||||
:hook ((elpaca-after-init . global-corfu-mode)
|
||||
(global-corfu-mode . corfu-popupinfo-mode))
|
||||
:bind (:map corfu-map
|
||||
("<escape>" . corfu-quit)
|
||||
("<SPC>" . corfu-insert-separator))
|
||||
:custom-face
|
||||
(corfu-border ((t (:inherit region :background unspecified))))
|
||||
:custom
|
||||
(corfu-auto t)
|
||||
:config
|
||||
(global-corfu-mode)
|
||||
(setq corfu-popupinfo-delay 0
|
||||
corfu-auto-delay 0
|
||||
corfu-auto-prefix 2
|
||||
corfu-cycle t
|
||||
corfu-quit-at-boundary t
|
||||
corfu-preview-current nil
|
||||
corfu-quit-no-match t)
|
||||
(when (< emacs-major-version 29)
|
||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent)
|
||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify))
|
||||
(corfu-history-mode 1)
|
||||
(savehist-mode 1)
|
||||
(add-to-list 'savehist-additional-variables 'corfu-history)
|
||||
)
|
||||
|
||||
;; Cambia la forma de mostrar y buscar sugerencias (afecta a corfu, pero también a otros como vertico).
|
||||
(use-package orderless
|
||||
:after corfu
|
||||
:custom
|
||||
(completion-styles '(orderless)) ; Use orderless
|
||||
(completion-category-defaults nil) ; I want to be in control!
|
||||
(setq completion-ignore-case t)
|
||||
(completion-category-overrides '((file (styles basic partial-completion orderless))))
|
||||
(orderless-matching-styles
|
||||
'(orderless-literal
|
||||
orderless-prefixes
|
||||
orderless-initialism
|
||||
orderless-regexp
|
||||
orderless-flex ; Basically fuzzy finding
|
||||
;; orderless-strict-leading-initialism
|
||||
;; orderless-strict-initialism
|
||||
;; orderless-strict-full-initialism
|
||||
;; orderless-without-literal ; Recommended for dispatches instead
|
||||
))
|
||||
)
|
||||
|
||||
;; Set de funciones de para las sugerencias de corfu.
|
||||
(use-package cape
|
||||
:ensure (:host github :repo "minad/cape")
|
||||
:after corfu
|
||||
:hook (eglot-managed-mode . (lambda()
|
||||
(setq completion-at-point-functions
|
||||
(list (cape-capf-super
|
||||
#'eglot-completion-at-point
|
||||
#'cape-abbrev
|
||||
#'cape-dabbrev
|
||||
#'cape-history
|
||||
#'cape-dict
|
||||
#'cape-file
|
||||
#'cape-keyword)))))
|
||||
:bind (("C-c c f" . cape-file)
|
||||
("C-c c l" . cape-line))
|
||||
:init
|
||||
(setq text-mode-ispell-word-completion nil)
|
||||
;; (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-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-history) ;; Completar desde el historial de altocompletado
|
||||
(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-file) ;; Completar rutas de archivos.
|
||||
(add-to-list 'completion-at-point-functions #'cape-keyword) ;; Completar desde keyword del lenguaje.
|
||||
|
||||
:config
|
||||
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
|
||||
)
|
||||
|
||||
;; A few more useful configurations...
|
||||
(use-package emacs
|
||||
:ensure nil
|
||||
:custom
|
||||
;; TAB cycle if there are only few candidates
|
||||
;; (completion-cycle-threshold 3)
|
||||
|
||||
;; Enable indentation+completion using the TAB key.
|
||||
;; `completion-at-point' is often bound to M-TAB.
|
||||
(tab-always-indent 'complete)
|
||||
|
||||
;; Emacs 30 and newer: Disable Ispell completion function. As an alternative,
|
||||
;; try `cape-dict'.
|
||||
(text-mode-ispell-word-completion nil)
|
||||
|
||||
;; Emacs 28 and newer: Hide commands in M-x which do not apply to the current
|
||||
;; mode. Corfu commands are hidden, since they are not used via M-x. This
|
||||
;; setting is useful beyond Corfu.
|
||||
(read-extended-command-predicate #'command-completion-default-include-p))
|
||||
|
||||
;; Iconos en corfu
|
||||
(use-package nerd-icons-corfu
|
||||
:after corfu
|
||||
:init (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
|
||||
|
||||
|
||||
(provide 'init-completion)
|
||||
;;; init-completion.el ends here
|
||||
177
configs/init-editor.el
Normal file
177
configs/init-editor.el
Normal file
@@ -0,0 +1,177 @@
|
||||
;; init-editor.el --- Initialize editing configurations. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2006-2025 Vincent Zhang
|
||||
|
||||
;; Author: kj <webmaster@outcontrol.net>
|
||||
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Configuración en la edición de texto en general
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Visor de documentos de emacs (soporta de todo: epub, pdf, odt, docx, cbz, etc.)
|
||||
(use-package doc-view
|
||||
:hook
|
||||
(doc-view-mode . (lambda ()
|
||||
(display-line-numbers-mode 0)))
|
||||
:ensure nil)
|
||||
|
||||
;; Eliminar cuando está
|
||||
(use-package delsel
|
||||
:ensure nil
|
||||
:hook (elpaca-after-init . delete-selection-mode))
|
||||
|
||||
;; Minor mode to aggressively keep your code always indented
|
||||
(use-package aggressive-indent
|
||||
:diminish
|
||||
:autoload aggressive-indent-mode
|
||||
:functions too-long-file-p
|
||||
;; :hook ((elpaca-after-init . global-aggressive-indent-mode)
|
||||
;; ;; NOTE: Disable in large files due to the performance issues
|
||||
;; ;; https://github.com/Malabarba/aggressive-indent-mode/issues/73
|
||||
;; (find-file . (lambda ()
|
||||
;; (when (too-long-file-p)
|
||||
;; (aggressive-indent-mode -1)))))
|
||||
:config
|
||||
;; Disable in some modes
|
||||
(dolist (mode '(gitconfig-mode
|
||||
asm-mode web-mode html-mode
|
||||
css-mode css-ts-mode
|
||||
go-mode go-ts-mode
|
||||
python-ts-mode yaml-ts-mode
|
||||
scala-mode
|
||||
shell-mode term-mode vterm-mode
|
||||
prolog-inferior-mode))
|
||||
(add-to-list 'aggressive-indent-excluded-modes mode))
|
||||
|
||||
;; Disable in some commands
|
||||
(add-to-list 'aggressive-indent-protected-commands #'delete-trailing-whitespace t)
|
||||
|
||||
;; Be slightly less aggressive in C/C++/C#/Java/Go/Swift
|
||||
(add-to-list 'aggressive-indent-dont-indent-if
|
||||
'(and (derived-mode-p 'c-mode 'c++-mode 'csharp-mode
|
||||
'java-mode 'go-mode 'swift-mode)
|
||||
(null (string-match "\\([;{}]\\|\\b\\(if\\|for\\|while\\)\\b\\)"
|
||||
(thing-at-point 'line))))))
|
||||
|
||||
;; Mover líneas o regiones con M-<teclas de dirección>
|
||||
(use-package drag-stuff
|
||||
:diminish
|
||||
;; :autoload drag-stuff-define-keys
|
||||
:hook (elpaca-after-init . drag-stuff-global-mode)
|
||||
:bind (:map drag-stuff-mode-map
|
||||
("M-p" . drag-stuff-up)
|
||||
("M-n" . drag-stuff-down))
|
||||
;; :config
|
||||
;; (add-to-list 'drag-stuff-except-modes 'org-mode)
|
||||
;; (drag-stuff-define-keys)
|
||||
)
|
||||
|
||||
;; A comprehensive visual interface to diff & patch
|
||||
(use-package ediff
|
||||
:ensure nil
|
||||
:hook(;; show org ediffs unfolded
|
||||
(ediff-prepare-buffer . outline-show-all)
|
||||
)
|
||||
:config
|
||||
(setq ediff-window-setup-function 'ediff-setup-windows-plain
|
||||
ediff-split-window-function 'split-window-horizontally
|
||||
ediff-merge-split-window-function 'split-window-horizontally))
|
||||
|
||||
;; Automatic parenthesis pairing
|
||||
(use-package elec-pair
|
||||
:ensure nil
|
||||
;; :hook (elpaca-after-init . electric-pair-mode)
|
||||
:init (setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit))
|
||||
|
||||
;; Edit multiple regions in the same way simultaneously
|
||||
(use-package iedit
|
||||
:defines desktop-minor-mode-table
|
||||
:bind (("C-;" . iedit-mode)
|
||||
("C-x r RET" . iedit-rectangle-mode)
|
||||
:map isearch-mode-map ("C-;" . iedit-mode-from-isearch)
|
||||
:map esc-map ("C-;" . iedit-execute-last-modification)
|
||||
:map help-map ("C-;" . iedit-mode-toggle-on-function))
|
||||
:config
|
||||
;; Avoid restoring `iedit-mode'
|
||||
(with-eval-after-load 'desktop
|
||||
(add-to-list 'desktop-minor-mode-table
|
||||
'(iedit-mode nil))))
|
||||
|
||||
;; Seleccionar por regiones (similar a mark-sexp, pero toma en cuenta hacia atrás del cursor también)
|
||||
(use-package expand-region
|
||||
:functions treesit-buffer-root-node
|
||||
:bind ("C-," . er/expand-region)
|
||||
:config
|
||||
(defun treesit-mark-bigger-node ()
|
||||
"Use tree-sitter to mark regions."
|
||||
(let* ((root (treesit-buffer-root-node))
|
||||
(node (treesit-node-descendant-for-range root (region-beginning) (region-end)))
|
||||
(node-start (treesit-node-start node))
|
||||
(node-end (treesit-node-end node)))
|
||||
;; Node fits the region exactly. Try its parent node instead.
|
||||
(when (and (= (region-beginning) node-start) (= (region-end) node-end))
|
||||
(when-let* ((node (treesit-node-parent node)))
|
||||
(setq node-start (treesit-node-start node)
|
||||
node-end (treesit-node-end node))))
|
||||
(set-mark node-end)
|
||||
(goto-char node-start)))
|
||||
(add-to-list 'er/try-expand-list 'treesit-mark-bigger-node))
|
||||
|
||||
;; Hungry deletion (Elimina los espacios en blancos consecutivos)
|
||||
(use-package hungry-delete
|
||||
:diminish
|
||||
;; :hook (elpaca-after-init . global-hungry-delete-mode)
|
||||
:init (setq hungry-delete-chars-to-skip " \t\f\v"
|
||||
hungry-delete-except-modes
|
||||
'(help-mode minibuffer-mode minibuffer-inactive-mode calc-mode)))
|
||||
|
||||
;; Mejora C-a y C-e para ir a lo que contextualmente sería el fin de la línea
|
||||
(use-package mwim
|
||||
:bind (([remap move-beginning-of-line] . mwim-beginning)
|
||||
([remap move-end-of-line] . mwim-end)))
|
||||
|
||||
;; Ayuda a manipular los archivos con líneas demasiado largas
|
||||
(use-package so-long
|
||||
:ensure nil
|
||||
:hook (after-init . global-so-long-mode)
|
||||
: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))))
|
||||
|
||||
;; Generador de texto aleatorio para placeholding
|
||||
(use-package lorem-ipsum)
|
||||
|
||||
;; Corrector ortográfico y de sintaxis avanzado
|
||||
(use-package languagetool
|
||||
:ensure t
|
||||
:defer t
|
||||
:commands (languagetool-check
|
||||
languagetool-clear-suggestions
|
||||
languagetool-correct-at-point
|
||||
languagetool-correct-buffer
|
||||
languagetool-set-language
|
||||
languagetool-server-mode))
|
||||
|
||||
(use-package perspective
|
||||
:custom
|
||||
(persp-mode-prefix-key (kbd "C-c w"))
|
||||
(persp-initial-frame-name "0")
|
||||
:init
|
||||
(persp-mode))
|
||||
|
||||
(provide 'init-editor)
|
||||
;;; init-editor.el ends here
|
||||
134
configs/init-evil.el
Normal file
134
configs/init-evil.el
Normal file
@@ -0,0 +1,134 @@
|
||||
;;; 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
|
||||
:hook ((elpaca-after-init . evil-mode)
|
||||
(git-timemachine-mode . evil-emacs-state))
|
||||
:init
|
||||
(setq evil-want-keybinding nil)
|
||||
;; Habilitar atajos de de tecla de emacs en insert state
|
||||
(setq evil-disable-insert-state-bindings t)
|
||||
: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)
|
||||
|
||||
;; Arreglar el problemita con corfu-quit y el cambio de modos
|
||||
(evil-define-key 'emacs 'global (kbd "<escape>") '(lambda ()
|
||||
"Call `corfu-quit' and then return to Normal State."
|
||||
(interactive)
|
||||
(call-interactively 'corfu-quit)
|
||||
(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)
|
||||
(evil-define-key all-states 'global (kbd "C-S-z") 'undo-redo)
|
||||
|
||||
;; Cambiar U para hacer redo
|
||||
(evil-define-key 'normal 'global (kbd "U") '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)
|
||||
|
||||
;; Indentado 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-ts-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>b") 'switch-to-buffer) ;; Cambiar de buffer
|
||||
(evil-define-key 'motion 'global (kbd "<leader>p") 'project-find-file) ;; 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>f") '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
|
||||
(evil-define-key 'motion 'global (kbd "<leader>gg") 'goto-line) ;; Ir a la línea.
|
||||
|
||||
;; Iniciar en normal state solo en modos específicos
|
||||
(setq evil-default-state 'emacs) ;; Modo por defecto en emacs
|
||||
(evil-set-initial-state 'prog-mode 'normal)
|
||||
(evil-set-initial-state 'org-mode 'normal)
|
||||
(evil-set-initial-state 'text-mode 'normal)
|
||||
(evil-set-initial-state 'csv-mode 'normal)
|
||||
(evil-set-initial-state 'fundamental-mode 'normal)
|
||||
(evil-set-initial-state 'dashboard-mode 'normal)
|
||||
(evil-set-initial-state 'dired 'normal)
|
||||
(evil-set-initial-state 'vterm-mode 'emacs)
|
||||
(evil-set-initial-state 'magit-mode 'emacs)
|
||||
(evil-set-initial-state 'git-commit-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
|
||||
:after org
|
||||
:hook (org-mode . evil-org-mode))
|
||||
|
||||
;; Similar a Vimtutor, pero para evil.
|
||||
(use-package evil-tutor)
|
||||
|
||||
(provide 'init-evil)
|
||||
;;; init-evil.el ends here
|
||||
173
configs/init-functions.el
Normal file
173
configs/init-functions.el
Normal file
@@ -0,0 +1,173 @@
|
||||
;;; 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))
|
||||
|
||||
;; 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)))))
|
||||
|
||||
;; 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)))) ;; <-- ¡Aquí está el cambio!
|
||||
(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))
|
||||
|
||||
;; Devuelve si el archivo es muy grande o no\
|
||||
(defun too-long-file-p ()
|
||||
"Check whether the file is too long."
|
||||
(or (> (buffer-size) 500000)
|
||||
(and (fboundp 'buffer-line-statistics)
|
||||
(> (car (buffer-line-statistics)) 10000))))
|
||||
|
||||
;; Renombrar el archivo actual
|
||||
(defun rename-this-file (new-name)
|
||||
"Renames both current buffer and file it's visiting to NEW-NAME."
|
||||
(interactive (list (read-string "New name: "
|
||||
(file-name-nondirectory
|
||||
(buffer-file-name)))))
|
||||
(let ((name (buffer-name))
|
||||
(filename (buffer-file-name)))
|
||||
(unless filename
|
||||
(error "Buffer '%s' is not visiting a file!" name))
|
||||
(progn
|
||||
(when (file-exists-p filename)
|
||||
(rename-file filename new-name 1))
|
||||
(set-visited-file-name new-name)
|
||||
(rename-buffer new-name))))
|
||||
|
||||
;; Copiar el nombre del archivo actual
|
||||
(defun copy-filename ()
|
||||
"Copy the current buffer file name to the clipboard."
|
||||
(interactive)
|
||||
(let ((filename (if (equal major-mode 'dired-mode)
|
||||
default-directory
|
||||
(buffer-file-name))))
|
||||
(if filename
|
||||
(progn
|
||||
(kill-new filename)
|
||||
(message "Copied '%s'" filename))
|
||||
(warn "Current buffer is not attached to a file!"))))
|
||||
|
||||
(defun copy-basename ()
|
||||
"Copy the current buffer basename to the clipboard."
|
||||
(interactive)
|
||||
(let ((filename (if (equal major-mode 'dired-mode)
|
||||
default-directory
|
||||
(file-name-nondirectory (buffer-file-name)))))
|
||||
(if filename
|
||||
(progn
|
||||
(kill-new filename)
|
||||
(message "Copied '%s'" filename))
|
||||
(warn "Current buffer is not attached to a file!"))))
|
||||
|
||||
;; Verifica si se puede levantar un childframe
|
||||
(defun childframe-workable-p ()
|
||||
"Whether childframe is workable."
|
||||
(and (not noninteractive)
|
||||
(not emacs-basic-display)
|
||||
(or (display-graphic-p)
|
||||
(featurep 'tty-child-frames))
|
||||
(eq (frame-parameter (selected-frame) 'minibuffer) 't)))
|
||||
|
||||
(defun font-installed-p (font-name)
|
||||
"Check if font with FONT-NAME is available."
|
||||
(find-font (font-spec :name font-name)))
|
||||
|
||||
(defun insert-filename ()
|
||||
"Insert the full path file name into the current buffer."
|
||||
(interactive)
|
||||
(insert (buffer-file-name)))
|
||||
|
||||
(defun insert-basename ()
|
||||
"Insert the filename (without path) into the current buffer."
|
||||
(interactive)
|
||||
(insert (file-name-nondirectory (buffer-file-name))))
|
||||
|
||||
(defun sort-lines-by-length (reverse beg end)
|
||||
"Sort lines by length."
|
||||
(interactive "P\nr")
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(narrow-to-region beg end)
|
||||
(goto-char (point-min))
|
||||
(let ;; To make `end-of-line' and etc. to ignore fields.
|
||||
((inhibit-field-text-motion t))
|
||||
(sort-subr reverse 'forward-line 'end-of-line nil nil
|
||||
(lambda (l1 l2)
|
||||
(apply #'< (mapcar (lambda (range) (- (cdr range) (car range)))
|
||||
(list l1 l2)))))))))
|
||||
|
||||
(defun corfu-auto-toggle()
|
||||
"Toggle corfu autocomplete."
|
||||
(interactive)
|
||||
(global-corfu-mode 0)
|
||||
(setq corfu-auto (not corfu-auto))
|
||||
(global-corfu-mode 1)
|
||||
)
|
||||
|
||||
(defun force-fundamental-for-large-files ()
|
||||
"If a file is over 5MB, open it in fundamental-mode and disable undo."
|
||||
(when (> (buffer-size) (* 5 1024 1024))
|
||||
(setq buffer-read-only t)
|
||||
(buffer-disable-undo)
|
||||
(fundamental-mode)
|
||||
(message "Buffer set to fundamental-mode and read-only due to size.")))
|
||||
|
||||
(add-hook 'find-file-hook #'force-fundamental-for-large-files)
|
||||
|
||||
(provide 'init-functions)
|
||||
;;; init-functions.el ends here.
|
||||
164
configs/init-highlight.el
Normal file
164
configs/init-highlight.el
Normal file
@@ -0,0 +1,164 @@
|
||||
;; init-highlight.el --- Initialize highlighting configurations. -*- lexical-binding: t -*-
|
||||
|
||||
;; Author: kj <webmaster@outcontrol.net>
|
||||
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Highlighting configurations.
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Highlight the current line
|
||||
(use-package hl-line
|
||||
:ensure nil
|
||||
:hook (((dashboard-mode eshell-mode shell-mode term-mode vterm-mode) .
|
||||
(lambda () (setq-local global-hl-line-mode nil)))
|
||||
;; (after-init . global-hl-line-mode)
|
||||
))
|
||||
|
||||
;; Highlight matching parens
|
||||
(use-package paren
|
||||
:ensure nil
|
||||
:functions childframe-workable-p
|
||||
:custom-face
|
||||
(show-paren-match ((((class color) (background light))
|
||||
(:box (:line-width (-1 . -1) :color "gray73")))
|
||||
(((class color) (background dark))
|
||||
(:box (:line-width (-1 . -1) :color "gray56")))))
|
||||
:hook (after-init . show-paren-mode)
|
||||
:init (setq show-paren-when-point-inside-paren t
|
||||
show-paren-when-point-in-periphery t)
|
||||
:config
|
||||
(setq blink-matching-paren-highlight-offscreen t
|
||||
show-paren-context-when-offscreen
|
||||
(if (childframe-workable-p) 'child-frame 'overlay))
|
||||
(with-no-warnings
|
||||
;; Display matching line for off-screen paren.
|
||||
(defun display-line-overlay (pos str &optional face)
|
||||
"Display line at POS as STR with FACE.
|
||||
|
||||
FACE defaults to inheriting from default and highlight."
|
||||
(let ((ol (save-excursion
|
||||
(goto-char pos)
|
||||
(make-overlay (line-beginning-position)
|
||||
(line-end-position)))))
|
||||
(overlay-put ol 'display str)
|
||||
(overlay-put ol 'face
|
||||
(or face '(:inherit highlight)))
|
||||
ol))
|
||||
|
||||
(defvar-local show-paren--off-screen-overlay nil)
|
||||
(defun show-paren-off-screen (&rest _args)
|
||||
"Display matching line for off-screen paren."
|
||||
(when (overlayp show-paren--off-screen-overlay)
|
||||
(delete-overlay show-paren--off-screen-overlay))
|
||||
;; Check if it's appropriate to show match info,
|
||||
(when (and (overlay-buffer show-paren--overlay)
|
||||
(not (or cursor-in-echo-area
|
||||
executing-kbd-macro
|
||||
noninteractive
|
||||
(minibufferp)
|
||||
this-command))
|
||||
(and (not (bobp))
|
||||
(memq (char-syntax (char-before)) '(?\) ?\$)))
|
||||
(= 1 (logand 1 (- (point)
|
||||
(save-excursion
|
||||
(forward-char -1)
|
||||
(skip-syntax-backward "/\\")
|
||||
(point))))))
|
||||
;; Rebind `minibuffer-message' called by `blink-matching-open'
|
||||
;; to handle the overlay display.
|
||||
(cl-letf (((symbol-function #'minibuffer-message)
|
||||
(lambda (msg &rest args)
|
||||
(let ((msg (apply #'format-message msg args)))
|
||||
(setq show-paren--off-screen-overlay
|
||||
(display-line-overlay
|
||||
(window-start) msg ))))))
|
||||
(blink-matching-open))))
|
||||
(advice-add #'show-paren-function :after #'show-paren-off-screen)))
|
||||
|
||||
;; Resalta los escapes de secuencia
|
||||
(use-package highlight-escape-sequences
|
||||
: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)
|
||||
(php-ts-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))
|
||||
)
|
||||
)
|
||||
|
||||
;; Resalta todas las ocurrencias del contenido seleccionado
|
||||
(use-package region-occurrences-highlighter
|
||||
:diminish
|
||||
:bind (:map region-occurrences-highlighter-nav-mode-map
|
||||
("M-n" . region-occurrences-highlighter-next)
|
||||
("M-p" . region-occurrences-highlighter-prev))
|
||||
:hook (elpaca-after-init . global-region-occurrences-highlighter-mode))
|
||||
|
||||
;; Highlight indentions
|
||||
(use-package indent-bars
|
||||
:custom
|
||||
(indent-bars-color '(highlight :face-bg t :blend 0.225))
|
||||
(indent-bars-highlight-current-depth '(:face default :blend 0.225))
|
||||
(indent-bars-color-by-depth nil)
|
||||
(indent-bars-pattern ".")
|
||||
(indent-bars-treesit-support t)
|
||||
(indent-bars-no-descend-string t)
|
||||
(indent-bars-treesit-ignore-blank-lines-types '("module"))
|
||||
(indent-bars-prefer-character t)
|
||||
(indent-bars-treesit-scope '((python function_definition class_definition for_statement
|
||||
if_statement with_statement while_statement)))
|
||||
;; :hook ((prog-mode yaml-mode) . indent-bars-mode)
|
||||
:config (require 'indent-bars-ts))
|
||||
|
||||
;; Colorize color names in buffers
|
||||
(use-package colorful-mode
|
||||
:diminish
|
||||
:hook (after-init . global-colorful-mode)
|
||||
:init (setq colorful-use-prefix t)
|
||||
:config (dolist (mode '(html-mode php-mode help-mode helpful-mode))
|
||||
(add-to-list 'global-colorful-modes mode)))
|
||||
|
||||
;; Highlight brackets according to their depth
|
||||
(use-package rainbow-delimiters)
|
||||
|
||||
;; Resaltar palabras clave como TODO, FIXME, etc. en comentarios del código.
|
||||
(use-package hl-todo
|
||||
:autoload hl-todo-flymake hl-todo-search-and-highlight
|
||||
:functions rg rg-read-files rg-project
|
||||
:bind (:map hl-todo-mode-map
|
||||
([C-f3] . hl-todo-occur))
|
||||
:hook (elpaca-after-init . global-hl-todo-mode)
|
||||
:init (setq hl-todo-require-punctuation t
|
||||
hl-todo-highlight-punctuation ":")
|
||||
:config
|
||||
(add-to-list 'hl-todo-keyword-faces '("BUG" . "#d99600"))
|
||||
|
||||
;; Integrate into flymake
|
||||
(with-eval-after-load 'flymake
|
||||
(add-hook 'flymake-diagnostic-functions #'hl-todo-flymake))
|
||||
|
||||
;; Integrate into magit
|
||||
(with-eval-after-load 'magit
|
||||
(add-hook 'magit-log-wash-summary-hook
|
||||
#'hl-todo-search-and-highlight t)
|
||||
(add-hook 'magit-revision-wash-message-hook
|
||||
#'hl-todo-search-and-highlight t))
|
||||
)
|
||||
|
||||
(provide 'init-highlight)
|
||||
;;; init-highlight.el ends here
|
||||
45
configs/init-keys.el
Normal file
45
configs/init-keys.el
Normal file
@@ -0,0 +1,45 @@
|
||||
;;; 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-<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-ts-mode)
|
||||
(global-set-key (kbd "C-x mw") 'web-mode)
|
||||
|
||||
;; Saltar entre párrafos
|
||||
(define-key global-map "\M-[" 'backward-paragraph)
|
||||
(define-key global-map "\M-]" 'forward-paragraph)
|
||||
|
||||
;; Insertar nombre del archivo
|
||||
(global-set-key (kbd "C-c ff") 'insert-filename)
|
||||
(global-set-key (kbd "C-c fb") 'insert-basename)
|
||||
(global-set-key (kbd "C-c fcf") 'copy-filename)
|
||||
(global-set-key (kbd "C-c fcb") 'copy-basename)
|
||||
|
||||
;; 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
|
||||
106
configs/init-lsp.el
Normal file
106
configs/init-lsp.el
Normal file
@@ -0,0 +1,106 @@
|
||||
;;; init-lsp.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
|
||||
:ensure nil
|
||||
:hook ((prog-mode . (lambda ()
|
||||
(unless (derived-mode-p
|
||||
'emacs-lisp-mode 'lisp-mode
|
||||
'makefile-mode 'snippet-mode
|
||||
'ron-mode)
|
||||
(eglot-ensure))))
|
||||
((markdown-mode yaml-mode yaml-ts-mode) . eglot-ensure))
|
||||
:init
|
||||
(setq read-process-output-max (* 4 1024 1024)) ; 4MB
|
||||
(setq eglot-autoshutdown t
|
||||
eglot-send-changes-idle-time 0.5)
|
||||
:config
|
||||
(setq eglot-sync-connect 0)
|
||||
(add-to-list 'eglot-server-programs '(php-mode . ("rass" "--" "intelephense" "--stdio")))
|
||||
(add-to-list 'eglot-server-programs '(web-mode . ("rass" "--" "htmx-lsp" "--" "intelephense" "--stdio")))
|
||||
(add-to-list 'eglot-server-programs '(html-mode . ("rass" "--" "htmx-lsp" "--" "intelephense" "--stdio")))
|
||||
(add-to-list 'eglot-server-programs '(nhtml-mode . ("rass" "--" "htmx-lsp" "--" "intelephense" "--stdio")))
|
||||
;;(add-to-list 'eglot-server-programs '(markdown-mode . ("marksman")))
|
||||
(add-to-list 'eglot-ignored-server-capabilities :inlayHintProvider)
|
||||
)
|
||||
|
||||
;; Mejorar la velocidad de eglot (un binario en rust )
|
||||
(use-package eglot-booster
|
||||
: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
|
||||
:hook
|
||||
((html-mode . emmet-mode)
|
||||
(web-mode . emmet-mode))
|
||||
)
|
||||
|
||||
;; Revisar por errores en el código
|
||||
(use-package flymake
|
||||
:ensure nil
|
||||
;; :hook (prog-mode . (lambda ()
|
||||
;; (unless (derived-mode-p 'makefile-mode)
|
||||
;; (flymake-mode))))
|
||||
:init
|
||||
(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)
|
||||
)
|
||||
|
||||
(use-package flycheck
|
||||
:init (global-flycheck-mode)
|
||||
:config
|
||||
(setq-default flycheck-global-modes '(not org-mode))
|
||||
(setq flycheck-indication-mode nil
|
||||
flycheck-phpcs-standard "PSR12"))
|
||||
|
||||
(use-package flycheck-eglot
|
||||
:after flycheck
|
||||
:custom
|
||||
(flycheck-eglot-exclusive nil)
|
||||
:config
|
||||
;; Activar solo en buffers PHP gestionados por eglot: en el resto (p.ej. Go)
|
||||
;; dejar que Eglot use flymake nativo y evitar la recursión de flycheck-eglot.
|
||||
(add-hook 'eglot-managed-mode-hook
|
||||
(lambda ()
|
||||
(when (derived-mode-p 'php-mode 'php-ts-mode)
|
||||
(flycheck-eglot-mode 1)))))
|
||||
|
||||
(use-package flycheck-popup-tip
|
||||
:hook (flycheck-mode . flycheck-popup-tip-mode))
|
||||
|
||||
(provide 'init-lsp)
|
||||
;;; init-lsp.el ends here
|
||||
121
configs/init-minibuffer.el
Normal file
121
configs/init-minibuffer.el
Normal file
@@ -0,0 +1,121 @@
|
||||
;;; 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:
|
||||
|
||||
;; Reemplazo para counsel
|
||||
(use-package consult
|
||||
:bind (("C-x p" . project-find-file)
|
||||
("C-x C-p" . project-find-file)
|
||||
("C-S-s" . consult-line)
|
||||
("C-c r g" . consult-ripgrep)
|
||||
("C-S-r" . consult-ripgrep)
|
||||
;; ("C-S-s" . isearch-forward)
|
||||
("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 M-." . consult-complex-command) ;; orig. repeat-complex-command
|
||||
("C-c p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
|
||||
("C-c p p" . project-switch-project)
|
||||
;; 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)
|
||||
("C-'" . consult-register)
|
||||
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
|
||||
;; 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 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)
|
||||
)
|
||||
|
||||
;; 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))
|
||||
|
||||
;; Descripciones en el minibufer
|
||||
(use-package marginalia
|
||||
:hook (vertico-mode . marginalia-mode))
|
||||
|
||||
;; Todolist de todo el projecto desde consult.
|
||||
(use-package consult-todo
|
||||
:demand t
|
||||
:bind ("C-c t" . consult-todo))
|
||||
|
||||
;; UI para completado del minibuffer
|
||||
(use-package vertico
|
||||
: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)
|
||||
(rfn-eshadow-update-overlay . vertico-directory-tidy))
|
||||
:init
|
||||
(setq read-file-name-completion-ignore-case t
|
||||
read-buffer-completion-ignore-case t
|
||||
completion-ignore-case t)
|
||||
)
|
||||
|
||||
(provide 'init-minibuffer)
|
||||
;;; init-minibuffer.el ends here
|
||||
294
configs/init-org.el
Normal file
294
configs/init-org.el
Normal file
@@ -0,0 +1,294 @@
|
||||
;;; 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)
|
||||
|
||||
;; Configuracin para Systanx Highlight en porg-blocks
|
||||
(add-to-list 'org-src-lang-modes (cons "html" 'mhtml))
|
||||
|
||||
(setq org-fontify-quote-and-verse-blocks t) ;; Permitir configuración de bloques quote y verse.
|
||||
(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)
|
||||
|
||||
;; 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)
|
||||
(sql . t)
|
||||
)))
|
||||
;; No solicitar confirmación para evaluar
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
(add-to-list 'org-src-lang-modes '("go" . go-ts))
|
||||
)
|
||||
|
||||
;; org-mode
|
||||
(use-package org
|
||||
:ensure nil
|
||||
:bind (:map org-mode-map
|
||||
("C-'" . nil)
|
||||
("C-," . nil))
|
||||
:hook
|
||||
((org-mode . kj/org-hook)
|
||||
(org-mode . visual-line-fill-column-mode))
|
||||
: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)
|
||||
|
||||
;; Indentació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)
|
||||
|
||||
;; 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)
|
||||
)
|
||||
|
||||
;; Ajusta el tamaño horizontal de las tablas a lo configurado en fill-colum o ftable-fill-column
|
||||
(use-package ftable)
|
||||
|
||||
;; 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
|
||||
:hook
|
||||
(org-mode . org-bullets-mode)
|
||||
:config
|
||||
(setq org-bullets-bullet-list '("◉"
|
||||
"○"
|
||||
"●"
|
||||
"◈"
|
||||
"◇"
|
||||
"◆"
|
||||
"✸"
|
||||
"✳"))
|
||||
)
|
||||
|
||||
;; Mejora visualmente varias cosas de org
|
||||
(use-package org-modern
|
||||
: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-progress 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
|
||||
: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
|
||||
:bind ("<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
|
||||
: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
|
||||
:hook (org-mode . org-autolist-mode))
|
||||
|
||||
;; Org babel para PHP
|
||||
(use-package ob-php)
|
||||
|
||||
;; Org babel para GO
|
||||
(use-package ob-go)
|
||||
|
||||
;; Org babel para Rust
|
||||
(use-package ob-rust)
|
||||
|
||||
;; Org babel para traducciones (mediante google translate)
|
||||
(use-package ob-translate)
|
||||
|
||||
;; Autocompletado para los headers de los bloques
|
||||
(use-package corg
|
||||
:ensure (:host github :repo "isamert/corg.el"))
|
||||
|
||||
;; Org mode en modo presentación
|
||||
(use-package org-present
|
||||
: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
|
||||
;; :hook (org-mode . org-appear-mode)
|
||||
)
|
||||
|
||||
(provide 'init-org)
|
||||
;;; init-org.el ends here
|
||||
78
configs/init-package.el
Normal file
78
configs/init-package.el
Normal file
@@ -0,0 +1,78 @@
|
||||
;;; init-package.el --- Initialize package configurations. -*- lexical-binding: t -*-
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Emacs Package management configurations.
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Configuración de repositorios de paquetes
|
||||
|
||||
(defvar elpaca-installer-version 0.12)
|
||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||
(defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory))
|
||||
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
||||
:ref nil :depth 1 :inherit ignore
|
||||
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
|
||||
:build (:not elpaca-activate)))
|
||||
(let* ((repo (expand-file-name "elpaca/" elpaca-sources-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 (apply #'call-process `("git" nil ,buffer t "clone"
|
||||
,@(when-let* ((depth (plist-get order :depth)))
|
||||
(list (format "--depth=%d" depth) "--no-single-branch"))
|
||||
,(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)
|
||||
(let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
|
||||
(add-hook 'after-init-hook #'elpaca-process-queues)
|
||||
(elpaca `(,@elpaca-order))
|
||||
|
||||
;; Install use-package support
|
||||
(elpaca elpaca-use-package
|
||||
;; Enable use-package :ensure support for Elpaca.
|
||||
(elpaca-use-package-mode))
|
||||
|
||||
;; Should set before loading `use-package'
|
||||
(setq use-package-always-ensure t
|
||||
use-package-always-defer t
|
||||
use-package-expand-minimally t
|
||||
use-package-enable-imenu-support t)
|
||||
|
||||
;; Required by `use-package'
|
||||
(use-package diminish :ensure t)
|
||||
|
||||
;; Update GPG keyring for GNU ELPA
|
||||
(use-package gnu-elpa-keyring-update)
|
||||
|
||||
;; Update packages
|
||||
(unless (fboundp 'package-upgrade-all)
|
||||
(use-package auto-package-update
|
||||
:init
|
||||
(setq auto-package-update-delete-old-versions t
|
||||
auto-package-update-hide-results t)
|
||||
(defalias 'package-upgrade-all #'auto-package-update-now)))
|
||||
|
||||
|
||||
(provide 'init-package)
|
||||
;;; init-package.el ends here
|
||||
195
configs/init-prog.el
Normal file
195
configs/init-prog.el
Normal file
@@ -0,0 +1,195 @@
|
||||
;; init-prog.el --- Initialize programming configurations. -*- lexical-binding: t -*-
|
||||
|
||||
;; Author: kj <webmaster@outcontrol.net>
|
||||
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; General programming configurations.
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Mostrar la ayuda de eldoc/documentación en un childframe
|
||||
(use-package eldoc-box
|
||||
:defer t
|
||||
:bind ("<f1>" . eldoc-box-help-at-point))
|
||||
|
||||
;; Cambiar fácilmente entre naming conventions (camel, pascal, kebab, snake, etc.)
|
||||
(use-package string-inflection)
|
||||
|
||||
;; Code folding indicators using Tree-sitter
|
||||
(use-package treesit-fold-indicators
|
||||
:ensure treesit-fold
|
||||
:hook (after-init . global-treesit-fold-indicators-mode)
|
||||
:init (setq treesit-fold-indicators-priority -1))
|
||||
|
||||
;; Cross-referencing commands
|
||||
(use-package xref
|
||||
:autoload xref-show-definitions-completing-read
|
||||
:bind (("M-." . xref-find-definitions)
|
||||
("M-," . xref-go-back)
|
||||
("C-." . xref-find-references))
|
||||
:init
|
||||
;; Use faster search tool
|
||||
(when (executable-find "rg")
|
||||
(setq xref-search-program 'ripgrep))
|
||||
|
||||
;; Select from xref candidates in minibuffer
|
||||
(setq xref-show-definitions-function #'xref-show-definitions-completing-read
|
||||
xref-show-xrefs-function #'xref-show-definitions-completing-read))
|
||||
|
||||
;; Code styles
|
||||
;; (use-package editorconfig
|
||||
;; :diminish
|
||||
;; :hook (elpaca-after-init . editorconfig-mode))
|
||||
|
||||
;; Correr el código desde el buffer de emacs
|
||||
(use-package quickrun
|
||||
:bind (("C-<f5>" . quickrun)
|
||||
("C-S-<f5>" . quickrun-region)))
|
||||
|
||||
;; Busqueda rápida con ripgrep
|
||||
(use-package rg
|
||||
: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))
|
||||
|
||||
;; Tree-sitter :)
|
||||
(use-package treesit
|
||||
: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"))
|
||||
(jsdoc . ("https://github.com/tree-sitter/tree-sitter-jsdoc"))
|
||||
(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"))
|
||||
(phpdoc . ("https://github.com/claytonrcarter/tree-sitter-phpdoc"))
|
||||
(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"))
|
||||
(tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src"))
|
||||
(typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))
|
||||
(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)))))
|
||||
|
||||
;; Browse devdocs.io documents using EWW
|
||||
(use-package devdocs
|
||||
:autoload (devdocs--installed-docs devdocs--available-docs)
|
||||
:commands (devdocs-install devdocs-lookup)
|
||||
:bind (:map prog-mode-map
|
||||
("M-<f1>" . devdocs-dwim))
|
||||
:init
|
||||
(setq devdocs-data-dir (expand-file-name "devdocs" user-emacs-directory))
|
||||
(defun devdocs-dwim()
|
||||
"Look up a DevDocs documentation entry.
|
||||
Install the doc if it's not installed."
|
||||
(interactive)
|
||||
;; Install the doc if it's not installed
|
||||
(lambda (slug)
|
||||
(unless (member slug (let ((default-directory devdocs-data-dir))
|
||||
(seq-filter #'file-directory-p
|
||||
(when (file-directory-p devdocs-data-dir)
|
||||
(directory-files "." nil "^[^.]")))))
|
||||
(mapc
|
||||
(lambda (doc)
|
||||
(when (string= (alist-get 'slug doc) slug)
|
||||
(devdocs-install doc)))
|
||||
(devdocs--available-docs))))
|
||||
|
||||
;; Lookup the symbol at point
|
||||
(devdocs-lookup nil (thing-at-point 'symbol t))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Miscellaneous Programming Modes
|
||||
;; ---------------------------------------------------------------------------
|
||||
(use-package cmake-mode)
|
||||
(use-package nginx-mode) ; Modo para leer archivos de configuración de nginx
|
||||
|
||||
(use-package sql
|
||||
:ensure nil
|
||||
:hook (sql-interactive-mode . toggle-truncate-lines)
|
||||
:config
|
||||
(setq sql-mysql-login-params (append sql-mysql-login-params '(port))) ;; request port also
|
||||
(setq sql-user "root") ;; user por defecto
|
||||
(setq sql-server "127.0.0.1") ;; host por defecto
|
||||
(setq sql-port 3306) ;; puerto por defecto para mysql
|
||||
)
|
||||
|
||||
;; Major mode para editar configuraciones de systemd
|
||||
(use-package systemd
|
||||
:mode ("\\.container\\'" . systemd-mode))
|
||||
|
||||
;; Major mode para archivos CSV
|
||||
(use-package csv-mode
|
||||
;; :hook ((csv-mode . csv-align-mode)
|
||||
;; (csv-mode . csv-header-line))
|
||||
)
|
||||
|
||||
;; Modo markdown
|
||||
(use-package markdown-mode)
|
||||
|
||||
;; Modo para edición de arc docker compose
|
||||
(use-package docker-compose-mode)
|
||||
|
||||
;; Modo para la edición de archivos Dockerfile (y building desde emacs)
|
||||
(use-package dockerfile-mode
|
||||
:config
|
||||
;; Suelo tener podman siempre en lugar de docker, así que lo definimos como el comando a usar
|
||||
(setq dockerfile-mode-command "podman"))
|
||||
|
||||
;; Configuración para project.el
|
||||
(use-package project
|
||||
: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")
|
||||
)
|
||||
)
|
||||
|
||||
(use-package prettier
|
||||
:diminish
|
||||
:defines prettier-pre-warm
|
||||
;; :hook ((js-base-mode css-mode sgml-mode web-mode) . prettier-mode)
|
||||
:init (setq prettier-pre-warm 'none))
|
||||
|
||||
(use-package subword
|
||||
:ensure nil
|
||||
:init
|
||||
(global-subword-mode 1))
|
||||
|
||||
(provide 'init-prog)
|
||||
;;; init-prog.el ends here
|
||||
33
configs/init-theme.el
Normal file
33
configs/init-theme.el
Normal file
@@ -0,0 +1,33 @@
|
||||
;;; 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)
|
||||
|
||||
;; El theme más cercano a adwaita dark que he encontrado
|
||||
(use-package adwaita-dark-theme)
|
||||
|
||||
;; Themes modus, vienen integrado en emacs en master (~v30)
|
||||
(use-package modus-themes)
|
||||
|
||||
;; Themes ef
|
||||
(use-package ef-themes
|
||||
:init
|
||||
(load-theme 'ef-dream 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
|
||||
155
configs/init-ui.el
Normal file
155
configs/init-ui.el
Normal file
@@ -0,0 +1,155 @@
|
||||
;; init-ui.el --- Better lookings and appearances. -*- lexical-binding: t -*-
|
||||
|
||||
;; Author: kj <webmaster@outcontrol.net>
|
||||
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Visual (UI) configurations for better lookings and appearances.
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Optimization
|
||||
(setq idle-update-delay 1.0)
|
||||
|
||||
(setq-default cursor-in-non-selected-windows nil)
|
||||
(setq highlight-nonselected-windows nil)
|
||||
|
||||
(setq fast-but-imprecise-scrolling t)
|
||||
(setq redisplay-skip-fontification-on-input t)
|
||||
|
||||
;; Sidebar a la derecha con los archivos
|
||||
(use-package dired-sidebar
|
||||
:hook (dired-mode . hl-line-mode)
|
||||
:bind ([f9] . dired-sidebar-toggle-sidebar)
|
||||
:commands (dired-sidebar-toggle-sidebar)
|
||||
:config
|
||||
;; Show directories first
|
||||
(setq dired-listing-switches "-la --group-directories-first")
|
||||
(setq dired-sidebar-theme 'nerd
|
||||
dired-sidebar-window-fixed nil
|
||||
;; dired-sidebar-should-follow-file t
|
||||
;; dired-sidebar-follow-file-idle-delay 0.5
|
||||
))
|
||||
|
||||
;; Añadir vista de árbol a dired
|
||||
(use-package dired-subtree
|
||||
:demand t
|
||||
:hook (dired-mode . dired-hide-details-mode)
|
||||
:bind (:map dired-mode-map
|
||||
("<tab>" . dired-subtree-toggle) ; Toggle subtree view inline
|
||||
("S-<tab>" . dired-subtree-toggle-all) ; Toggle all subtrees
|
||||
("<backspace>" . dired-up-directory) ; Go up one level
|
||||
)
|
||||
:init
|
||||
(setq dired-kill-when-opening-new-dired-buffer t)
|
||||
(advice-add 'dired-subtree-toggle :after
|
||||
(lambda (&rest _)
|
||||
(when (bound-and-true-p nerd-icons-dired-mode)
|
||||
(nerd-icons-dired--refresh)))))
|
||||
|
||||
;; Show line numbers
|
||||
(use-package display-line-numbers
|
||||
:ensure nil
|
||||
:hook ((prog-mode
|
||||
conf-mode toml-ts-mode
|
||||
yaml-mode yaml-ts-mode)
|
||||
. display-line-numbers-mode)
|
||||
:init (setq display-line-numbers-width-start t))
|
||||
|
||||
;; Suppress GUI features
|
||||
(setq use-file-dialog nil
|
||||
use-dialog-box nil
|
||||
inhibit-startup-screen t
|
||||
inhibit-startup-echo-area-message user-login-name
|
||||
inhibit-default-init t
|
||||
initial-scratch-message nil)
|
||||
(unless (daemonp)
|
||||
(advice-add #'display-startup-echo-area-message :override #'ignore))
|
||||
|
||||
;; Display dividers between windows
|
||||
(setq window-divider-default-places t
|
||||
window-divider-default-bottom-width 1
|
||||
window-divider-default-right-width 1)
|
||||
(add-hook 'window-setup-hook #'window-divider-mode)
|
||||
|
||||
|
||||
;; Mouse & Smooth Scroll
|
||||
;; Scroll one line at a time (less "jumpy" than defaults)
|
||||
(when (display-graphic-p)
|
||||
(setq mouse-wheel-scroll-amount '(1 ((shift) . hscroll))
|
||||
mouse-wheel-scroll-amount-horizontal 1
|
||||
mouse-wheel-progressive-speed nil))
|
||||
(setq scroll-step 1
|
||||
scroll-margin 0
|
||||
scroll-conservatively 100000
|
||||
auto-window-vscroll nil
|
||||
scroll-preserve-screen-position t)
|
||||
|
||||
;; Smooth scrolling
|
||||
(use-package ultra-scroll
|
||||
:hook (elpaca-after-init . ultra-scroll-mode))
|
||||
|
||||
;; Use fixed pitch where it's sensible
|
||||
(use-package mixed-pitch
|
||||
:diminish)
|
||||
|
||||
;; Display ugly ^L page breaks as tidy horizontal lines
|
||||
(use-package page-break-lines
|
||||
:diminish
|
||||
:hook (elpaca-after-init . global-page-break-lines-mode)
|
||||
:config (dolist (mode '(dashboard-mode emacs-news-mode))
|
||||
(add-to-list 'page-break-lines-modes mode)))
|
||||
|
||||
;; La línea bonita esa de abajo
|
||||
(use-package doom-modeline
|
||||
:init
|
||||
(doom-modeline-mode)
|
||||
(setq doom-modeline-project-detection 'auto
|
||||
doom-modeline-buffer-file-name-style 'relative-to-project
|
||||
doom-modeline-icon t
|
||||
doom-modeline-major-mode-color-icon t
|
||||
doom-modeline-major-mode-color-icon t
|
||||
doom-modeline-buffer-modification-icon t
|
||||
doom-modeline-indent-info nil
|
||||
doom-modeline-minor-modes nil
|
||||
doom-modeline-buffer-encoding nil
|
||||
doom-modeline-persp-name t))
|
||||
|
||||
;; Quitar el modeline, en este caso para ciertos modos solamente
|
||||
;; (use-package hide-mode-line
|
||||
;; :autoload turn-off-hide-mode-line-mode
|
||||
;; :hook (((eat-mode
|
||||
;; eshell-mode shell-mode
|
||||
;; term-mode vterm-mode
|
||||
;; embark-collect-mode lsp-ui-imenu-mode
|
||||
;; pdf-annot-list-mode) . turn-on-hide-mode-line-mode)))
|
||||
|
||||
;; A minor-mode menu for mode-line
|
||||
(use-package minions
|
||||
:hook (elpaca-after-init . minions-mode))
|
||||
|
||||
;; Iconos bonitos para varias cosas
|
||||
(use-package nerd-icons)
|
||||
|
||||
;; nerd-icons en ibuffer
|
||||
(use-package nerd-icons-ibuffer
|
||||
:hook (ibuffer-mode . nerd-icons-ibuffer-mode))
|
||||
|
||||
;; Nerd icons para vertico
|
||||
(use-package nerd-icons-completion
|
||||
:hook (vertico-mode . nerd-icons-completion-mode))
|
||||
|
||||
;; Usar nerd-icons en dired
|
||||
(use-package nerd-icons-dired
|
||||
:after nerd-icons
|
||||
:hook (dired-mode . nerd-icons-dired-mode)
|
||||
:init
|
||||
(advice-add 'dired-revert :after
|
||||
(lambda (&rest _)
|
||||
(when (bound-and-true-p nerd-icons-dired-mode)
|
||||
(nerd-icons-dired--refresh)))))
|
||||
|
||||
(provide 'init-ui)
|
||||
;;; init-ui.el ends here
|
||||
200
configs/init-utils.el
Normal file
200
configs/init-utils.el
Normal file
@@ -0,0 +1,200 @@
|
||||
;; init-utils.el --- Initialize ultilities. -*- lexical-binding: t -*-
|
||||
|
||||
;; Author: kj <webmaster@outcontrol.net>
|
||||
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Some usefule Utilities.
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Mejora del reemplazo
|
||||
(use-package anzu
|
||||
:bind (([remap query-replace] . anzu-query-replace)
|
||||
([remap query-replace-regexp] . anzu-query-replace-regexp)))
|
||||
|
||||
;; Intercamiar buffers de lugar
|
||||
(use-package buffer-move
|
||||
: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))
|
||||
)
|
||||
|
||||
;; Cuando inicias un atajo de teclas te muestra las posibilidades
|
||||
(use-package which-key
|
||||
:diminish
|
||||
:init (setq which-key-max-description-length 30
|
||||
which-key-lighter nil
|
||||
which-key-show-remaining-keys t)
|
||||
:hook ( elpaca-after-init . which-key-mode))
|
||||
|
||||
;; Paquete para exportar buffers de emacs a HTML
|
||||
(use-package htmlize)
|
||||
|
||||
;; eww
|
||||
(use-package eww
|
||||
:ensure nil
|
||||
:init
|
||||
;; Install: npm install -g readability-cli
|
||||
(when (executable-find "readable")
|
||||
(setq eww-retrieve-command '("readable"))))
|
||||
|
||||
;; Restaurar el estado de los frames
|
||||
(use-package winner
|
||||
:ensure nil
|
||||
:bind (("s-u" . winner-undo)
|
||||
("s-U" . winner-redo))
|
||||
:hook (elpaca-after-init . winner-mode))
|
||||
|
||||
;; Moverme entre frames
|
||||
(use-package windmove
|
||||
:ensure nil
|
||||
:bind (("M-I" . windmove-up)
|
||||
("M-K" . windmove-down)
|
||||
("M-J" . windmove-left)
|
||||
("M-L" . windmove-right)
|
||||
("M-O" . other-window)
|
||||
("M-o" . other-window)))
|
||||
|
||||
;; Terminal
|
||||
(use-package vterm
|
||||
: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
|
||||
)
|
||||
|
||||
;; Multiple vterm
|
||||
(use-package multi-vterm
|
||||
: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)
|
||||
))
|
||||
|
||||
;; Mecanografía
|
||||
(use-package speed-type
|
||||
:hook
|
||||
(speed-type-mode . (lambda ()
|
||||
(corfu-mode 0)
|
||||
(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 15725 24536)
|
||||
speed-type-min-chars 300
|
||||
speed-type-max-chars 600))
|
||||
|
||||
;; Mostrar lo que se está presionando en pantalla
|
||||
(use-package keypression
|
||||
: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))
|
||||
)
|
||||
|
||||
;; Un bonito y sencillo panel de inicio
|
||||
(use-package dashboard
|
||||
;; :init
|
||||
;; (dashboard-setup-startup-hook)
|
||||
:diminish dashboard-mode
|
||||
:custom-face
|
||||
(dashboard-heading ((t (:inherit (font-lock-string-face bold)))))
|
||||
(dashboard-items-face ((t (:weight normal))))
|
||||
(dashboard-no-items-face ((t (:weight normal))))
|
||||
: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 '(
|
||||
;; (recents . 10)
|
||||
(agenda . 10)
|
||||
))
|
||||
)
|
||||
|
||||
;; Hydra - Permite crear conjuntos de atajos.
|
||||
(use-package hydra
|
||||
:defines posframe-border-width
|
||||
:functions childframe-workable-p
|
||||
:hook (emacs-lisp-mode . hydra-add-imenu)
|
||||
)
|
||||
|
||||
;; Pretty-Hydra - Su nombre ya indica lo que hace
|
||||
(use-package pretty-hydra
|
||||
:bind ("<f6>" . toggles-hydra/body)
|
||||
:hook (emacs-lisp-mode . (lambda ()
|
||||
(add-to-list
|
||||
'imenu-generic-expression
|
||||
'("Hydras"
|
||||
"^.*(\\(pretty-hydra-define\\) \\([a-zA-Z-]+\\)"
|
||||
2))))
|
||||
:init
|
||||
(cl-defun pretty-hydra-title (title &optional icon-type icon-name
|
||||
&key face height v-adjust)
|
||||
"Add an icon in the hydra title."
|
||||
(let ((face (or face 'mode-line-emphasis))
|
||||
(height (or height 1.2))
|
||||
(v-adjust (or v-adjust 0.0)))
|
||||
(concat
|
||||
(when (and icon-type icon-name)
|
||||
(let ((f (intern (format "nerd-icons-%s" icon-type))))
|
||||
(when (fboundp f)
|
||||
(concat
|
||||
(apply f (list icon-name :face face :height height :v-adjust v-adjust))
|
||||
" "))))
|
||||
(propertize title 'face face))))
|
||||
|
||||
;; Global toggles
|
||||
(with-no-warnings
|
||||
(pretty-hydra-define toggles-hydra (:title (pretty-hydra-title "Toggles" 'faicon "nf-fa-toggle_on")
|
||||
:color pink :quit-key ("q" "C-g"))
|
||||
("Basic"
|
||||
(("n" (cond ((fboundp 'display-line-numbers-mode)
|
||||
(display-line-numbers-mode (if display-line-numbers-mode -1 1)))
|
||||
((fboundp 'gblobal-linum-mode)
|
||||
(global-linum-mode (if global-linum-mode -1 1))))
|
||||
"line number"
|
||||
:toggle (or (bound-and-true-p display-line-numbers-mode)
|
||||
(bound-and-true-p global-linum-mode)))
|
||||
("a" global-aggressive-indent-mode "aggressive indent" :toggle t)
|
||||
("d" global-hungry-delete-mode "hungry delete" :toggle t)
|
||||
("e" electric-pair-mode "electric pair" :toggle t)
|
||||
("s" prettify-symbols-mode "pretty symbol" :toggle t)
|
||||
("h" display-time-mode "time" :toggle t)
|
||||
("i" indent-bars-mode "indent bars" :toggle t))
|
||||
"Highlight"
|
||||
(("l" global-hl-line-mode "line" :toggle t)
|
||||
("p" show-paren-mode "brackets pairs" :toggle t)
|
||||
("b" global-blamer-mode "Git blamer" :toggle t)
|
||||
("r" rainbow-delimiters-mode "rainbow brackets" :toggle t)
|
||||
("w" global-display-fill-column-indicator-mode "fill column indicator" :toggle t)
|
||||
("t" global-hl-todo-mode "todo" :toggle t))
|
||||
"Program"
|
||||
(("F" flymake-mode "flymake" :toggle t)
|
||||
("f" flyspell-mode "spell check" :toggle t)
|
||||
("u" subword-mode "subword" :toggle t)
|
||||
("v" global-diff-hl-mode "gutter" :toggle t)
|
||||
("V" diff-hl-flydiff-mode "live gutter" :toggle t)
|
||||
("M" diff-hl-margin-mode "margin gutter" :toggle t)
|
||||
("D" diff-hl-dired-mode "dired gutter" :toggle t))
|
||||
))))
|
||||
|
||||
(provide 'init-utils)
|
||||
;;; init-utils.el ends here
|
||||
160
configs/init-vc.el
Normal file
160
configs/init-vc.el
Normal file
@@ -0,0 +1,160 @@
|
||||
;;; init-vc.el --- Configuración del control de versiones -*- 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 control de versiones.
|
||||
;;
|
||||
;; Puedes que hoy en día la norma es usar git para este trabajo,
|
||||
;; la gran mayoría de configuraciones son justamente para el mismo.
|
||||
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Mostrar el commit de la línea actual
|
||||
(use-package blamer
|
||||
:ensure t
|
||||
:custom
|
||||
(blamer-idle-time 0.3)
|
||||
(blamer-min-offset 70)
|
||||
(blamer-show-avatar-p nil)
|
||||
(blamer-max-commit-message-length 80)
|
||||
:custom-face
|
||||
(blamer-face ((t :foreground "#808080"
|
||||
:background nil
|
||||
:height 100
|
||||
:italic t)))
|
||||
:bind ("C-c i" . blamer-show-posframe-commit-info))
|
||||
|
||||
;; Resolver diferencias entre 2 archivos o versiones del mismo.
|
||||
(use-package ediff
|
||||
: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))
|
||||
|
||||
;; Marca a la izq. si una linea ha sido agregada, editada o eliminada desde el último commit.
|
||||
(use-package diff-hl
|
||||
:custom (diff-hl-draw-borders nil)
|
||||
:autoload diff-hl-flydiff-mode
|
||||
:custom-face
|
||||
(diff-hl-change ((t (:inherit custom-changed :foreground unspecified :background unspecified))))
|
||||
(diff-hl-insert ((t (:inherit diff-added :background unspecified))))
|
||||
(diff-hl-delete ((t (:inherit diff-removed :background unspecified))))
|
||||
:bind (:map diff-hl-command-map
|
||||
("SPC" . diff-hl-mark-hunk))
|
||||
:hook ((elpaca-after-init . global-diff-hl-mode)
|
||||
(elpaca-after-init . global-diff-hl-show-hunk-mouse-mode)
|
||||
(dired-mode . diff-hl-dired-mode))
|
||||
:config
|
||||
;; Highlight on-the-fly
|
||||
(diff-hl-flydiff-mode 1)
|
||||
|
||||
;; Set fringe style
|
||||
(setq-default fringes-outside-margins t)
|
||||
|
||||
(with-no-warnings
|
||||
(unless (display-graphic-p)
|
||||
;; Fall back to the display margin since the fringe is unavailable in tty
|
||||
(diff-hl-margin-mode 1)
|
||||
;; Avoid restoring `diff-hl-margin-mode'
|
||||
(with-eval-after-load 'desktop
|
||||
(add-to-list 'desktop-minor-mode-table
|
||||
'(diff-hl-margin-mode nil))))
|
||||
|
||||
;; Integration with magit
|
||||
(with-eval-after-load 'magit
|
||||
(add-hook 'magit-pre-refresh-hook #'diff-hl-magit-pre-refresh)
|
||||
(add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))))
|
||||
|
||||
;; Visitar rápidamente viejas versiones de un archivo rápidamente
|
||||
(use-package git-timemachine
|
||||
:custom-face
|
||||
(git-timemachine-minibuffer-author-face ((t (:inherit success :foreground unspecified))))
|
||||
(git-timemachine-minibuffer-detail-face ((t (:inherit warning :foreground unspecified))))
|
||||
:bind (:map vc-prefix-map
|
||||
("t" . git-timemachine))
|
||||
:hook ((git-timemachine-mode . (lambda ()
|
||||
"Improve `git-timemachine' buffers."
|
||||
;; Display different colors in mode-line
|
||||
(if (facep 'mode-line-active)
|
||||
(face-remap-add-relative 'mode-line-active 'custom-state)
|
||||
(face-remap-add-relative 'mode-line 'custom-state))
|
||||
|
||||
;; Highlight symbols in elisp
|
||||
(and (derived-mode-p 'emacs-lisp-mode)
|
||||
(fboundp 'highlight-defined-mode)
|
||||
(highlight-defined-mode t))
|
||||
|
||||
;; Display line numbers
|
||||
(and (derived-mode-p 'prog-mode 'yaml-mode)
|
||||
(fboundp 'display-line-numbers-mode)
|
||||
(display-line-numbers-mode t))))
|
||||
(before-revert . (lambda ()
|
||||
(when (bound-and-true-p git-timemachine-mode)
|
||||
(user-error "Cannot revert the timemachine buffer"))))))
|
||||
|
||||
;; Generador automatizado de archivos de licencia
|
||||
(use-package license-templates)
|
||||
|
||||
;; Magia para git
|
||||
(use-package magit
|
||||
:config
|
||||
(setq magit-diff-refine-hunk 'all))
|
||||
|
||||
;; Todolist en magit de todos los archivos del projecto.
|
||||
(use-package magit-todos
|
||||
:after magit-status
|
||||
:commands magit-todos-mode
|
||||
:init
|
||||
(setq magit-todos-nice (if (executable-find "nice") t nil))
|
||||
(magit-todos-mode 1))
|
||||
|
||||
;; Modo para resolución de confictos
|
||||
(use-package smerge-mode
|
||||
:ensure nil
|
||||
:config
|
||||
(defhydra hydra-smerge (:color pink
|
||||
:hint nil)
|
||||
"
|
||||
^Move^ ^Keep^ ^Diff^ ^Other^
|
||||
^^-----------^^-------------------^^---------------------^^-------
|
||||
_n_ext _b_ase _<_: upper/base _C_ombine
|
||||
_p_rev _u_pper _=_: upper/lower _r_esolve
|
||||
^^ _l_ower _>_: base/lower _k_ill current
|
||||
^^ _a_ll _R_efine
|
||||
^^ _RET_: current _E_diff
|
||||
"
|
||||
("n" smerge-next)
|
||||
("p" smerge-prev)
|
||||
("b" smerge-keep-base)
|
||||
("u" smerge-keep-upper)
|
||||
("l" smerge-keep-lower)
|
||||
("a" smerge-keep-all)
|
||||
("RET" smerge-keep-current)
|
||||
("\C-m" smerge-keep-current)
|
||||
("<" smerge-diff-base-upper)
|
||||
("=" smerge-diff-upper-lower)
|
||||
(">" smerge-diff-base-lower)
|
||||
("R" smerge-refine)
|
||||
("E" smerge-ediff)
|
||||
("C" smerge-combine-with-next)
|
||||
("r" smerge-resolve)
|
||||
("k" smerge-kill-current)
|
||||
("q" nil "cancel" :color blue))
|
||||
)
|
||||
|
||||
(use-package transient)
|
||||
|
||||
;; Mostrar el último commit que modificó la linea actual
|
||||
(use-package vc-msg
|
||||
:bind (("C-c C-v" . vc-msg-show))
|
||||
)
|
||||
|
||||
|
||||
(provide 'init-vc)
|
||||
;;; init-vc.el ends here
|
||||
@@ -1,14 +1,27 @@
|
||||
;;; 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
|
||||
:defer t)
|
||||
(use-package go-ts-mode
|
||||
:ensure nil
|
||||
:mode "\\.go\\'"
|
||||
:custom
|
||||
(go-ts-mode-indent-offset 4)
|
||||
(indent-tabs-mode 1)
|
||||
:hook
|
||||
(go-ts-mode . (lambda ()
|
||||
(add-hook 'before-save-hook
|
||||
(lambda ()
|
||||
(ignore-errors (eglot-code-actions nil nil "source.organizeImports" t))
|
||||
(eglot-format-buffer))
|
||||
nil 'local))))
|
||||
|
||||
(provide 'lang-go)
|
||||
;;; lang-go.el ends here
|
||||
|
||||
36
configs/lang-html.el
Normal file
36
configs/lang-html.el
Normal file
@@ -0,0 +1,36 @@
|
||||
;;; 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
|
||||
:config
|
||||
;; Add web-mode for .vue files
|
||||
(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)
|
||||
|
||||
:init
|
||||
;; web-mode setup for VUE
|
||||
(define-derived-mode vue-mode web-mode "Vue")
|
||||
(add-to-list 'auto-mode-alist '("\\.vue\\'" . vue-mode))
|
||||
)
|
||||
|
||||
(use-package css-mode
|
||||
:ensure nil
|
||||
:config
|
||||
(setq css-indent-offset 2))
|
||||
|
||||
(use-package auto-rename-tag
|
||||
:ensure (:host github :repo "jcs-elpa/auto-rename-tag"))
|
||||
|
||||
(provide 'lang-html)
|
||||
;;; lang-html.el ends here
|
||||
@@ -1,23 +1,26 @@
|
||||
;;; 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)
|
||||
:init
|
||||
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode))
|
||||
:config
|
||||
(setq js-indent-level 2))
|
||||
|
||||
;; json-mode
|
||||
(use-package json-mode
|
||||
:defer t
|
||||
:ensure t
|
||||
:mode
|
||||
("\\.json$" . json-mode)
|
||||
:config
|
||||
|
||||
@@ -1,30 +1,64 @@
|
||||
;;; 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:
|
||||
|
||||
;; Archivo de configuración para el lenguaje PHP
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package company-php :defer t)
|
||||
(use-package ac-php :defer t)
|
||||
(use-package php-ts-mode
|
||||
:mode "\\.php\\'"
|
||||
:ensure nil)
|
||||
|
||||
(use-package php-mode
|
||||
:defer t
|
||||
:bind ("<C-tab>" . 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
|
||||
))
|
||||
)
|
||||
:bind (:map php-mode-map
|
||||
("C-c C-f" . nil)
|
||||
("C-." . nil)))
|
||||
|
||||
(use-package php-doc-block
|
||||
:load-path (lambda() (concat private-dir "/packages/php-doc-block"))
|
||||
:after php-ts-mode
|
||||
:bind ("C-c d b" . php-doc-block)
|
||||
:ensure (:host github :repo "moskalyovd/emacs-php-doc-block")
|
||||
)
|
||||
|
||||
;; Consola REPL para php. Similar a "php -a" pero con extras
|
||||
(use-package psysh)
|
||||
|
||||
;; Composer
|
||||
(use-package composer)
|
||||
|
||||
;; PHPUnit
|
||||
(use-package phpunit)
|
||||
|
||||
(use-package php-cs-fixer
|
||||
:custom
|
||||
(php-cs-fixer-config-option (expand-file-name
|
||||
(concat user-emacs-directory "php-cs-fixer-config")))
|
||||
:init
|
||||
(defcustom php-cs-fixer-before-save-enabled t
|
||||
"Enable/disable php-cs-fixer-before-save hook."
|
||||
:type 'boolean)
|
||||
|
||||
(defun php-cs-fixer-before-save-toggle ()
|
||||
"Toggle php-cs-fixer-before-save hook."
|
||||
(interactive)
|
||||
(setq php-cs-fixer-before-save-enabled (not php-cs-fixer-before-save-enabled)))
|
||||
:hook (
|
||||
(before-save . (lambda ()
|
||||
(when php-cs-fixer-before-save-enabled
|
||||
(php-cs-fixer-before-save))))
|
||||
)
|
||||
)
|
||||
|
||||
(use-package magit-psr
|
||||
:ensure (:host github :repo "KJ2ME/magit-psr")
|
||||
:custom
|
||||
(magit-psr-recent-commits 5)
|
||||
(magit-psr-show-warnings t)
|
||||
(magit-psr-show-placeholder nil))
|
||||
|
||||
(provide 'lang-php)
|
||||
;;; lang-php.el ends here
|
||||
|
||||
19
configs/lang-rust.el
Normal file
19
configs/lang-rust.el
Normal 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
|
||||
:init
|
||||
(setq rust-mode-treesitter-derive t)
|
||||
:config
|
||||
(setq rust-format-on-save t))
|
||||
|
||||
(provide 'lang-rust)
|
||||
;;; lang-rust.el ends here
|
||||
BIN
duck-small.png
BIN
duck-small.png
Binary file not shown.
|
Before Width: | Height: | Size: 59 KiB |
25833
duck.svg
Normal file
25833
duck.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 826 KiB |
76
early-init.el
Normal file
76
early-init.el
Normal file
@@ -0,0 +1,76 @@
|
||||
;;; 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:
|
||||
|
||||
;; Defer garbage collection further back in the startup process
|
||||
(setq gc-cons-threshold most-positive-fixnum)
|
||||
|
||||
;; Prevent unwanted runtime compilation for gccemacs (native-comp) users;
|
||||
;; packages are compiled ahead-of-time when they are installed and site files
|
||||
;; are compiled when gccemacs is installed.
|
||||
(setq native-comp-deferred-compilation nil ;; obsolete since 29.1
|
||||
native-comp-jit-compilation nil)
|
||||
|
||||
;; 'use-package' is builtin since 29.
|
||||
;; It must be set before loading 'use-package'.
|
||||
(setq use-package-enable-imenu-support t)
|
||||
|
||||
;; In noninteractive sessions, prioritize non-byte-compiled source files to
|
||||
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
|
||||
;; to skip the mtime checks on every *.elc file.
|
||||
(setq load-prefer-newer noninteractive)
|
||||
|
||||
;; Explicitly set the prefered coding systems to avoid annoying prompt
|
||||
;; from emacs (especially on Microsoft Windows)
|
||||
(prefer-coding-system 'utf-8)
|
||||
|
||||
;; Permitir solo la búsqueda de archivos a cargar en la carpeta config case sensitive.
|
||||
(setq auto-mode-case-fold nil)
|
||||
|
||||
;; Definimos que la shell por defecto será bash
|
||||
(setq shell-file-name "/bin/bash")
|
||||
|
||||
;; 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.
|
||||
(push '(vertical-scroll-bars) default-frame-alist)
|
||||
(when (featurep 'ns)
|
||||
(push '(ns-transparent-titlebar . t) default-frame-alist))
|
||||
|
||||
;; Prevent flash of unstyled mode line
|
||||
(setq mode-line-format nil)
|
||||
|
||||
;; 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
|
||||
@@ -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 "$*"
|
||||
54
init.el
54
init.el
@@ -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,58 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (concat user-emacs-directory "configs"))
|
||||
;; Optimize Garbage Collection for Startup
|
||||
(setq gc-cons-threshold most-positive-fixnum)
|
||||
|
||||
(require 'base)
|
||||
(require 'base-extensions)
|
||||
(require 'base-functions)
|
||||
(require 'base-keys)
|
||||
;; Optimize `auto-mode-alist`
|
||||
(setq auto-mode-case-fold nil)
|
||||
|
||||
(unless (or (daemonp) noninteractive init-file-debug)
|
||||
;; Temporarily suppress file-handler processing to speed up startup
|
||||
(let ((default-handlers file-name-handler-alist))
|
||||
(setq file-name-handler-alist nil)
|
||||
;; Recover handlers after startup
|
||||
(add-hook 'emacs-startup-hook
|
||||
(lambda ()
|
||||
(setq file-name-handler-alist
|
||||
(delete-dups (append file-name-handler-alist default-handlers))))
|
||||
101)))
|
||||
|
||||
;; Función para añadir 'config' a la ruta de carga código elisp de emacs
|
||||
(defun update-load-path (&rest _)
|
||||
"Update the `load-path` to prioritize personal configurations."
|
||||
(push (expand-file-name "configs" user-emacs-directory) load-path))
|
||||
|
||||
;; Nos aseguramos de que ejecute 'update-load-path' antes de 'package-initialize'
|
||||
(advice-add #'package-initialize :after #'update-load-path)
|
||||
|
||||
;; Ahora lo corremos implícitamente
|
||||
(update-load-path)
|
||||
|
||||
;; Paquetes base
|
||||
(require 'init-package)
|
||||
(require 'init-base)
|
||||
(require 'init-utils)
|
||||
(require 'init-ui)
|
||||
(require 'init-editor)
|
||||
(require 'init-prog)
|
||||
(require 'init-highlight)
|
||||
(require 'init-theme)
|
||||
(require 'init-ai)
|
||||
(require 'init-vc)
|
||||
(require 'init-org)
|
||||
(require 'init-lsp)
|
||||
(require 'init-completion)
|
||||
(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
|
||||
|
||||
24
php-cs-fixer-config
Normal file
24
php-cs-fixer-config
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$finder = \PhpCsFixer\Finder::create();
|
||||
|
||||
$config = new \PhpCsFixer\Config();
|
||||
$config->setRules([
|
||||
'@PSR12' => true,
|
||||
'ordered_imports' => ['sort_algorithm' => 'alpha'],
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'whitespace_after_comma_in_array' => true,
|
||||
'align_multiline_comment' => true,
|
||||
'no_unused_imports' => true,
|
||||
'phpdoc_align' => true,
|
||||
'phpdoc_indent' => true,
|
||||
// 'psr_autoloading' => true,
|
||||
'no_useless_return' => true,
|
||||
'return_assignment' => true,
|
||||
'trailing_comma_in_multiline' => true,
|
||||
])->setRiskyAllowed(true);
|
||||
|
||||
return $config->setFinder($finder);
|
||||
@@ -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
|
||||
61
readme.md
61
readme.md
@@ -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)
|
||||
62
readme.org
Normal file
62
readme.org
Normal file
@@ -0,0 +1,62 @@
|
||||
#+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:
|
||||
|
||||
- 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 [[file:configs/init-editor.el][init-editor.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]]
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: @import
|
||||
# key: imp
|
||||
# uuid: imp
|
||||
# --
|
||||
@import "`(doom-snippets-text nil t)`$0";
|
||||
@@ -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}");
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: @import url(...)
|
||||
# key: impurl
|
||||
# uuid: impurl
|
||||
# --
|
||||
@import url("`(doom-snippets-text nil t)`$0");
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: margin: ...;
|
||||
# key: mar
|
||||
# uuid: mar
|
||||
# --
|
||||
margin: ${1:0 auto};
|
||||
@@ -1,8 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: @media
|
||||
# key: med
|
||||
# uuid: med
|
||||
# --
|
||||
@media ${1:screen} {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: @media (orientation: ?)
|
||||
# condition: (looking-back "@media " (line-beginning-position))
|
||||
# --
|
||||
(orientation: ${1:landscape})
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: @media print { ... }
|
||||
# --
|
||||
@media print {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: padding: ...;
|
||||
# key: pad
|
||||
# uuid: pad
|
||||
# --
|
||||
padding: ${1:10px};
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ...: ...;
|
||||
# key: :
|
||||
# uuid: :
|
||||
# --
|
||||
${1:prop}: ${2:`%`};
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: append
|
||||
# --
|
||||
${1:type} = append($1, ${2:elems})
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ... := ...
|
||||
# key: :=
|
||||
# uuid: :=
|
||||
# --
|
||||
${1:x} := ${2:`%`}
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Seong Yong-ju
|
||||
# name: const ... = ...
|
||||
# --
|
||||
const ${1:name}${2: type} = ${3:value}$0
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ctx context.Context
|
||||
# --
|
||||
ctx context.Context
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func ...(...) ... { ... }
|
||||
# --
|
||||
func ${1:name}(${2:args})${3: return type} {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func (target) name(args) (results) { ... }
|
||||
# --
|
||||
func (${1:target}) ${2:name}(${3:args})${4: return type} {
|
||||
$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for ... { ... }
|
||||
# --
|
||||
for $1 {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for key, value := range ... { ... }
|
||||
# --
|
||||
for ${1:key}, ${2:value} := range ${3:target} {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for key, value := range ... { ... }
|
||||
# --
|
||||
for ${1:key}, ${2:value} := range ${3:target} {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for i := 0; i < n; i++ { ... }
|
||||
# --
|
||||
for ${1:i} := ${2:0}; $1 < ${3:10}; $1++ {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for ... { ... }
|
||||
# --
|
||||
for $1 {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func ...(...) ... { ... }
|
||||
# --
|
||||
func ${1:name}(${2:args})${3: return type} {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: go
|
||||
# --
|
||||
go ${1:func}(${2:args})$0
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: go func
|
||||
# --
|
||||
go func (${1:args}) {
|
||||
$0
|
||||
}(${2:values})
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: go func (short)
|
||||
# --
|
||||
go func (${1:args}) {
|
||||
$0
|
||||
}(${2:values})
|
||||
@@ -1,7 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Seong Yong-ju
|
||||
# name: if ... { ... }
|
||||
# --
|
||||
if ${1:condition} {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Seong Yong-ju
|
||||
# name: if ... { ... } else { ... }
|
||||
# --
|
||||
if ${1:condition} {
|
||||
`%`$2
|
||||
} else {
|
||||
$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if err != nil { ... }
|
||||
# --
|
||||
if err != nil {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: import
|
||||
# --
|
||||
import ${1:package}$0
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: import
|
||||
# --
|
||||
import ${1:package}$0
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: type ... interface { ... }
|
||||
# --
|
||||
type $1 interface {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func main() { ... }
|
||||
# --
|
||||
func main() {
|
||||
$0
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: map
|
||||
# --
|
||||
map[${1:KeyType}]${2:ValueType}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func (target) name(args) (results) { ... }
|
||||
# --
|
||||
func (${1:target}) ${2:name}(${3:args})${4: return type} {
|
||||
$0
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: package
|
||||
# --
|
||||
package ${1:`(car (last (split-string (file-name-directory buffer-file-name) "/") 2))`}
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: package (short)
|
||||
# --
|
||||
package ${1:`(car (last (split-string (file-name-directory buffer-file-name) "/") 2))`}
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: printf
|
||||
# --
|
||||
fmt.Printf("$1\n"${2:, ${3:str}})
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: printf
|
||||
# --
|
||||
fmt.Printf("$1\n"${2:, ${3:str}})
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: println
|
||||
# --
|
||||
fmt.Println("${1:msg}")$0
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: println (short)
|
||||
# --
|
||||
fmt.Println("${1:msg}")$0
|
||||
@@ -1,7 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: select
|
||||
# --
|
||||
select {
|
||||
case ${1:cond}:
|
||||
$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: type ... struct { ... }
|
||||
# --
|
||||
type $1 struct {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: switch
|
||||
# key: switch
|
||||
# uuid: switch
|
||||
# --
|
||||
switch {
|
||||
case ${1:cond}:
|
||||
$0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func Test...() { ... }
|
||||
# --
|
||||
func Test${1:Name}(${2:t *testing.T}) {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: var
|
||||
# --
|
||||
var ${1:name} ${2:type} = ${3:value}$0
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name : for ... { ... }
|
||||
# --
|
||||
for $1 {
|
||||
`%`$0
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: http request writer
|
||||
# --
|
||||
w http.ResponseWriter, r *http.Request
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Rodrigo Setti <rodrigosetti@gmail.com>
|
||||
# name: <dd> ... </dd>
|
||||
# group: list
|
||||
# --
|
||||
<dd>$1</dd>
|
||||
@@ -1,8 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Rodrigo Setti <rodrigosetti@gmail.com>
|
||||
# name: <dl> ... </dl>
|
||||
# group: list
|
||||
# --
|
||||
<dl>
|
||||
$0
|
||||
</dl>
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: Doctype HTML 5
|
||||
# group: meta
|
||||
# --
|
||||
<!DOCTYPE html>
|
||||
@@ -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">
|
||||
@@ -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">
|
||||
@@ -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">
|
||||
@@ -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">
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Rodrigo Setti <rodrigosetti@gmail.com>
|
||||
# name: <dt> ... </dt>
|
||||
# group: list
|
||||
# --
|
||||
<dt>$1</dt>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user