Compare commits

...

2 Commits

Author SHA1 Message Date
kj
d1c00e505c Add rust lang. 2022-05-06 17:29:24 -04:00
kj
9cddf59c1d Improve yasnippets and enable yas-minor-mode on html-mode. 2022-05-06 16:07:54 -04:00
285 changed files with 38 additions and 1885 deletions

View File

@ -8,11 +8,7 @@
;;; Code: ;;; Code:
;; use-package - No necesita presentación ;; use-package - No necesita presentación
(use-package use-package (use-package use-package :defer t)
:defer t
:config
(setq use-package-always-ensure t) ; auto-instalar paquetes que no estésn instalados
)
;; Auto-actualizar los paquetes ;; Auto-actualizar los paquetes
(use-package auto-package-update (use-package auto-package-update
@ -147,7 +143,10 @@
:config :config
(yas-reload-all) (yas-reload-all)
:hook :hook
((prog-mode feature-mode) . yas-minor-mode)) ((prog-mode feature-mode) . yas-minor-mode-on)
(html-mode . yas-minor-mode))
(use-package yasnippet-snippets :ensure t :defer t)
;; Restaurar el estado de los frames ;; Restaurar el estado de los frames
(use-package winner (use-package winner
@ -276,6 +275,7 @@
(all-the-icons-ivy-rich-mode 1) (all-the-icons-ivy-rich-mode 1)
(which-key-mode) (which-key-mode)
(smartparens-global-mode t) (smartparens-global-mode t)
(setq use-package-always-ensure t) ; auto-instalar paquetes que no estésn instalados
;; Org-Mode ;; Org-Mode
(require 'org-config) (require 'org-config)

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

@ -0,0 +1,22 @@
;;; lang-rust.el --- Configuración para el lenguaje PHP
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;;; Code:
(use-package rust-mode
:defer t
:ensure t)
(use-package rustic
:defer t
:ensure t
:config
(setq rustic-lsp-client nil)
(push 'rustic-clippy flycheck-checkers))
(provide 'lang-rust)
;;; lang-rust.el ends here

View File

@ -19,6 +19,7 @@
(require 'lang-php) (require 'lang-php)
(require 'lang-js) (require 'lang-js)
(require 'lang-go) (require 'lang-go)
(require 'lang-rust)
(provide 'init) (provide 'init)
;;; init.el ends here ;;; init.el ends here

View File

@ -18,6 +18,15 @@ Al igual que la versión anterior, puede ser necesario ejecutar el siguiente com
Y eso sería todo. Y eso sería todo.
## Dependencias espefícicas
Algunos lenguajes, ya sea para hacer uso de flycheck, lsp o autocompletado, pueden requerir que instales algunas cosas en específico.
- *Javascript*: Necesita de al menos [deno](https://deno.land/) para LSP y [node](https://nodejs.org/es/) para flycheck, aunque creo que con deno puede bastar para ambos.
- *PHP*: Requiere instalar php-cli (`apt install php-cli`) para flycheck.
- *GO*: Necesita etener instalado [go](https://go.dev/) para linter (gofmt) y [gopls](https://github.com/golang/tools/tree/master/gopls) para LSP.
- *Rust*: Necesita clippy para flycheck y [rust-analyzer](https://rust-analyzer.github.io) para el autocompletado.
## Usar el modo daemon ## 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 [documentación de emacs](https://www.emacswiki.org/emacs/EmacsAsDaemon). 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 [documentación de emacs](https://www.emacswiki.org/emacs/EmacsAsDaemon).

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: class
# key: class
# uuid: class
# --
${1:public }class ${2:`(f-base buffer-file-name)`} {
$0
}

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: constructor
# key: __init__
# uuid: __init__
# --
public ${1:`(f-base buffer-file-name)`}($2) {
$0
}

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: doc
# key: /*
# uuid: /*
# condition: (not (use-region-p))
# --
/**
* $0
*/

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: equals
# key: eq
# uuid: eq
# --
public boolean equals(${1:Class} other) {
$0
}

View File

@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# name: file_class
# key: file
# uuid: file
# --
public class ${1:`(file-name-base
(or (buffer-file-name)
(buffer-name)))`} {
$0
}

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: for
# key: for
# uuid: for
# --
for (${1:int i = 0}; ${2:i < N}; ${3:i++}) {
`%`$0
}

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: foreach
# key: fore
# uuid: fore
# --
for (${1:Object} ${2:var} : ${3:iterator}) {
$0
}

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: if
# key: if
# uuid: if
# condition: (not (sp-point-in-string-or-comment))
# --
if (${1:true}) {
$0
}

View File

@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# name: ife
# key: ife
# uuid: ife
# --
if (${1:true}) {
`%`$2
} else {
$0
}

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: import
# --
import ${1:System.};
$0

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: interface
# key: interface
# uuid: interface
# --
interface ${1:`(f-base buffer-file-name)`} {
$0
}

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: iterator
# key: iterator
# uuid: iterator
# --
public Iterator<${1:type}> iterator() {
$0
}

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: javadoc
# key: doc
# uuid: doc
# --
/**
* $0
*
*/

View File

@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: main
# key: main
# uuid: main
# --
public static void main(String[] args) {
$0
}

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: method
# key: method
# uuid: method
# condition: (not (sp-point-in-string-or-comment))
# --
${1:void} ${2:name}($3) {
$0
}

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: @Override method
# key: method@
# uuid: method@
# condition: (not (sp-point-in-string-or-comment))
# --
@Override ${1:public} ${2:void} ${3:methodName}($4) {
$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: new
# key: new
# uuid: new
# --
${1:Type} ${2:obj} = new ${3:$1}($4);$0

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: paintComponent (Swing)
# key: paintComponent
# uuid: paintComponent
# condition: (not (sp-point-in-string-or-comment))
# --
@Override public void paintComponent(Graphics g) {
`%`$0
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: printf
# key: printf
# uuid: printf
# --
System.out.printf("`%`$0%n");

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: println
# key: println
# uuid: println
# --
System.out.println("`%`$0");

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: private
# key: pri
# uuid: pri
# --
private $0

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: protected
# key: pr
# uuid: pr
# --
protected $0

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: public
# key: p
# uuid: p
# --
public $0

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# name: return
# key: ret
# uuid: ret
# condition: (not (sp-point-in-string-or-comment))
# --
return `%`$0;

View File

@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: test
# key: test
# uuid: test
# --
@Test
public void test_${1:Case}() {
$0
}

View File

@ -1,13 +0,0 @@
# -*- mode: snippet -*-
# name: testClass
# key: tc
# uuid: tc
# --
import junit.framework.*;
import junit.textui.*;
public class Test${1:Class} extends TestCase {
protected void setUp() {
$0
}
}

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name: this
# key: .
# uuid: .
# --
this.$0

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