Personalizzazioni per emacs

This commit is contained in:
Fabio Scotto di Santolo
2019-12-07 12:02:37 +01:00
parent 950b3dce24
commit 3a59d8b46a
116 changed files with 1341 additions and 36 deletions

View File

@@ -0,0 +1 @@
c-mode

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: catch (...) { ... }
# key: catch
# --
catch ($1) {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for (...: ...) { ... }
# key: fore
# --
for ($1: $2) {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: namespace Namespace
# key: ns
# --
namespace ${1:Namespace} {
$0
} // namespace $1

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: #ifndef XXX; #define XXX; #endif
# key: once
# --
#ifndef ${1:`(upcase (replace-regexp-in-string "\\." "_" (file-name-nondirectory (buffer-file-name))))`_}
#define $1
$0
#endif // $1

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: qdebug
# key: qdebug
# --
qDebug() << "----------------------------------------";
qDebug() << "$0";
qDebug() << "----------------------------------------";

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: try { ... }
# key: try
# --
try {
$0
}

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: using namespace std;
# key: uns
# --
using namespace std;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: std::vector<T>
# key: vec
# --
std::vector<$1> $2;$0

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: { ... }
# key: {
# --
{
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: else if (...) { ... }
# key: elif
# --
else if (${1:condition}) {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: else { ... }
# key: else
# --
else {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for (...; ...; ...) { ... }
# key: for
# --
for (${1:init}; ${2:condition}; ${3:increment}) {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: if (...) { ... }
# key: if
# --
if (${1:condition}) {
$0
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: while (...) { ... }
# key: while
# --
while (${1:condition}) {
$0
}

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: #include <...>
# key: inc
# --
#include <$0>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: #include "..."
# key: incq
# --
#include "$0"

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: int main(argc, argv) { ... }
# key: main
# --
int main(int argc, char *argv[])
{
$0
return 0;
}

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: background-color: ...
# key: bg
# --
background-color: #${1:DDD};

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: background-image: ...
# key: bgi
# --
background-image: url($1);

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: border size style color
# key: bor
# --
border: ${1:1px} ${2:solid} #${3:999};

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: clear: ...
# key: cl
# --
clear: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: display: block
# key: dispb
# --
display: block;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: display: inline
# key: dispi
# --
display: inline;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: display: none
# key: dispn
# --
display: none;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: font-family: ...
# key: ff
# --
font-family: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: font-size: ...
# key: fs
# --
font-size: ${12px};

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin: ...
# key: mar
# --
margin: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin-bottom: ...
# key: marb
# --
margin-bottom: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin-left: ...
# key: marl
# --
margin-left: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin-right: ...
# key: marr
# --
margin-right: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: margin-top: ...
# key: mart
# --
margin-top: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding: ...
# key: pad
# --
padding: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding-bottom: ...
# key: padb
# --
padding-bottom: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding-left: ...
# key: padl
# --
padding-left: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding-right: ...
# key: padr
# --
padding-right: $1;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: padding-top: ...
# key: padt
# --
padding-top: $1;

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: immutable
# key: imm
# --
immutable $0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: import <...>;
# key: imp
# --
import $0;

View File

@@ -0,0 +1,42 @@
# -*- mode: snippet -*-
# name: emacs lisp module skeleton
# key: emacs-lisp-module
# --
;;; ${1:`(file-name-nondirectory (buffer-file-name))`} --- ${2:Package Description} -*- lexical-binding: t -*-
;; Copyright (C) `(format-time-string "%Y" (current-time))` ${3:Alexey Kutepov <reximkut@gmail.com>}
;; Author: $3
;; URL: $4
;; Permission is hereby granted, free of charge, to any person
;; obtaining a copy of this software and associated documentation
;; files (the "Software"), to deal in the Software without
;; restriction, including without limitation the rights to use, copy,
;; modify, merge, publish, distribute, sublicense, and/or sell copies
;; of the Software, and to permit persons to whom the Software is
;; furnished to do so, subject to the following conditions:
;; The above copyright notice and this permission notice shall be
;; included in all copies or substantial portions of the Software.
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;; SOFTWARE.
;;; Commentary:
;; $5
;;; Code:
$0
(provide '${6:`(file-name-sans-extension (file-name-nondirectory (buffer-file-name)))`})
;;; $1 ends here

View File

@@ -0,0 +1,41 @@
# -*- mode: snippet -*-
# name: pacmacs module skeleton
# key: pacmacs-module
# --
;;; ${1:`(file-name-nondirectory (buffer-file-name))`} --- Pacman for Emacs -*- lexical-binding: t -*-
;; Copyright (C) `(format-time-string "%Y" (current-time))` Codingteam
;; Author: Codingteam <codingteam@conference.jabber.ru>
;; Maintainer: Alexey Kutepov <reximkut@gmail.com>
;; URL: http://github.com/rexim/pacmacs.el
;; Permission is hereby granted, free of charge, to any person
;; obtaining a copy of this software and associated documentation
;; files (the "Software"), to deal in the Software without
;; restriction, including without limitation the rights to use, copy,
;; modify, merge, publish, distribute, sublicense, and/or sell copies
;; of the Software, and to permit persons to whom the Software is
;; furnished to do so, subject to the following conditions:
;; The above copyright notice and this permission notice shall be
;; included in all copies or substantial portions of the Software.
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;; SOFTWARE.
;;; Commentary:
;; $2
;;; Code:
$0
;;; $1 ends here

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: public static
# key: ps
# --
public static

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: public static void
# key: psv
# --
public static void

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: item
# key: item
# --
${1:Item} {
$0
} // $1

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: \begin{environment} ... \end{environment}
# key: begin
# --
\begin{${1:environment}}
$0
\end{$1}

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: todo
# key: todo
# type: command
# binding: C-x t
# --
(if (region-active-p)
(yas-expand-snippet "<!--TODO:-->`yas-selected-text`<!--$0-->")
(yas-expand-snippet "<!--TODO: $0 -->"))

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <body>...</body>
# key: body
# --
<body>
$0
</body>

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <div class="...">\n...\n</div>
# key: div
# --
<div class="$1">
$0
</div>

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <head>...</head>
# key: head
# --
<head>
$0
</head>

View File

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

View File

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

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <meta http-equiv="..." content="..." />
# key: meta
# --
<meta http-equiv="${1:Content-Type}" content="${2:text/html; charset=UTF-8}" />

View File

@@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: <project>...</project>
# key: pom
# --
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${1:me.rexim}</groupId>
<artifactId>${2:artifactId}</artifactId>
<version>${3:0.0.1-SNAPSHOT}</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

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

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <span class="...">\n...\n</span>
# key: span
# --
<span class="$1">$0</span>

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: <tag>\n...\n</tag>
# key: tag
# --
<${1:tag}$2>
$0
</$1>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <tag>...</tag>
# key: tag
# --
<${1:tag}$2>$0</$1>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <tag />
# key: tag
# --
<${1:tag} $2/>$0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <title>...</title>
# key: title
# --
<title>$0</title>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
# key: xml
# --
<?xml version="1.0" encoding="UTF-8" ?>

View File

@@ -0,0 +1,43 @@
# -*- mode: snippet -*-
# name: pomo table
# key: pomo
# --
|-------+-------+----------|
| start | type | duration |
|-------+-------+----------|
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 20m |
|-------+-------+----------|
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 20m |
|-------+-------+----------|
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 20m |
|-------+-------+----------|
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 10m |
| | work | 20m |
| | break | 20m |
|-------+-------+----------|

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: foreach (...) { ... }
# key: fore
# --
foreach ($1) {
$0
}

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1 @@
c-like-syntax

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: snippet snippet
# key: snip
# --
# -*- mode: snippet -*-
# name: $1
# key: ${2:`(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))`}
# --
$0

View File

@@ -0,0 +1 @@
c-like-syntax