aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: e9eb8fa6dc74f313926ebbf6776b58e55359ba9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# emacs-personal

> Lightweight Emacs configuration with essential utilities and personal customizations

![emacs-personal](https://archive.org/download/libreweb/emacs-personal-1.1.png?raw=true "emacs-personal")

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
[![Emacs](https://img.shields.io/badge/Emacs-25+-7F5AB6.svg?logo=gnu-emacs&logoColor=white)](https://www.gnu.org/software/emacs/)

---

## Table of Contents

- [Features](#features)
- [Quick Start](#quick-start)
- [Installation](#installation)
- [Requirements](#requirements)
- [Configuration](#configuration)
- [Key Bindings](#key-bindings)
- [Language Support](#language-support)
- [Troubleshooting](#troubleshooting)
- [Project Structure](#project-structure)
- [License](#license)

---

## Features

- **Fast Startup** - Optimized loading with garbage collection tuning
- **Modern Theme** - VSCode-inspired dark theme
- **Package Management** - ELPA + MELPA integration
- **Enhanced Navigation** - Ivy + Projectile for fuzzy finding
- **Intelligent Completion** - Company mode with multiple backends
- **Multi-language Support** - Python, JS/TS, PHP, Go, C/C++, and more
- **Code Quality** - Flycheck + Linter integration
- **File Explorer** - Neotree sidebar
- **Dashboard** - Clean startup screen
- **Developer Tools** - Docker, Terraform, REST client

---

## Quick Start

```bash
# Clone the repository
git clone https://git.fridu.us/software/emacs-personal.git ~/.emacs.d/

# Copy environment configuration
cp ~/.emacs.d/.env.example ~/.emacs.d/.env

# Initialize packages (first time only)
emacs --batch --eval='(load-file "~/.emacs.d/init.el")'
```

---

## Installation

### Step 1: Refresh Package Contents

Inside Emacs, run:

```elisp
M-x package-refresh-contents [RET]
```

### Step 2: Clone Repository

#### Primary Mirror

```bash
git clone https://git.fridu.us/software/emacs-personal.git ~/.emacs.d/
```

#### Secondary Mirror

```bash
git clone https://git.sr.ht/~heckyel/emacs-personal ~/.emacs.d/
```

### Step 3: Configure Environment

```bash
cp -v ~/.emacs.d/.env.example ~/.emacs.d/.env
```

### Step 4: Initialize

```bash
emacs --batch --eval='(load-file "~/.emacs.d/init.el")'
```

---

## Requirements

### System Dependencies

| Package | Description |
|---------|-------------|
| `ttf-hack` | Hack font family |
| `ttf-anonymous-pro` | Anonymous Pro font |
| `hyphen` | Hyphenation patterns |
| `hyphen-es` | Spanish hyphenation |
| `markdown` | Markdown processor |
| `shellcheck` | Shell script analyzer |
| `python-virtualenv` | Python virtual environments |
| `python-pylint` | Python linter |

### Install on Arch Linux

```bash
sudo pacman -S ttf-hack ttf-anonymous-pro hyphen hyphen-es \
             markdown shellcheck python-virtualenv python-pylint
```

### Install on Debian/Ubuntu

```bash
sudo apt install fonts-hack fonts-anonymous-pro hyphen hyphen-es \
                 markdown shellcheck python3-venv pylint
```

---

## Configuration

### Fonts

Edit [`init-gui.el`](modules/init-gui.el#L54) to customize typography:

```elisp
(if (member "Hack" (font-family-list))
    (set-frame-font "Hack-9")
  (set-frame-font "DejaVu Sans Mono-10"))
```

### Icons

Install `all-the-icons` package:

```bash
emacs --batch --eval="(progn (package-initialize) (package-install 'all-the-icons))"
```

Then press `F8` to open Neotree (will prompt to install fonts on first run).

### Environment Variables

Copy and edit `.env.example`:

```bash
cp ~/.emacs.d/.env.example ~/.emacs.d/.env
```

---

## Key Bindings

| Key | Action |
|-----|--------|
| `F6` | Toggle line numbers |
| `F8` | Open Neotree file explorer |
| `F11` | Toggle fullscreen |
| `F12` | Revert buffer |
| `M-0` | Reset frame transparency |
| `S-C-+` | Increase font size |
| `S-C--` | Decrease font size |
| `S-h` | Toggle highlight current line |
| `C->` | Mark next occurrence (multi-cursor) |
| `C-<` | Mark previous occurrence (multi-cursor) |
| `C-c C-<` | Mark all occurrences (multi-cursor) |
| `C-x e` | Evaluate last expression |

---

## Language Support

### Python

```bash
# Install dependencies
sudo pacman -S python-virtualenv python-pylint
```

| Command | Action |
|---------|--------|
| `M-x pyvenv-mode` | Toggle virtualenv |
| `M-x pyvenv-create` | Create virtualenv |
| `M-x pyvenv-activate` | Activate virtualenv |

### JavaScript / TypeScript

- Auto-completion with Company mode
- Syntax checking with Flycheck
- Emmet support for HTML/CSS

### Shell Scripts

```bash
sudo pacman -S shellcheck
```

### Markdown

```bash
# Arch
sudo pacman -S markdown

# Debian/Ubuntu
sudo apt install markdown
```

### Other Languages

- C/C++/C#
- PHP
- Go
- Lua
- Ruby
- YAML
- Dockerfile
- Terraform
- reStructuredText (ox-reveal)

---

## Troubleshooting

### GPG Signature Error

```
Failed to verify signature archive-contents.sig:
No public key for 066DAFCB81E42C40
```

#### Method 1: Import GPG Key

```bash
gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
```

#### Method 2: Disable Signature Check (Temporary)

```bash
# Disable signature check
sed -i "s|(setq package-check-signature 'allow-unsigned)|(setq package-check-signature nil)|g" \
  "$HOME/.emacs.d/init.el"

# Inside Emacs
M-x package-install RET gnu-elpa-keyring-update RET

# Re-enable signature check
sed -i "s|(setq package-check-signature nil)|(setq package-check-signature 'allow-unsigned)|g" \
  "$HOME/.emacs.d/init.el"
```

### Package Installation Issues

If packages fail to install, try:

```elisp
M-x package-refresh-contents
M-x package-reinstall RET <package-name> RET
```

### Font Issues

If fonts don't render correctly:

1. Install fonts: `M-x all-the-icons-install-fonts`
2. Restart Emacs
3. Check available fonts: `M-x font-selector`

---

## Project Structure

```
~/.emacs.d/
├── init.el              # Main configuration file
├── custom.el            # User customizations (auto-generated)
├── settings.el          # Personal settings
├── .env.example         # Environment variables template
├── modules/             # Feature modules
│   ├── init-gui.el      # GUI settings
│   ├── init-elpa.el     # Package management
│   ├── init-company.el  # Auto-completion
│   ├── init-flycheck.el # Syntax checking
│   ├── init-python.el   # Python support
│   └── ...
└── elpa/                # Installed packages
```

---

## License

This project is licensed under the GNU General Public License v3.0 or later - see the [LICENSE](LICENSE) file for details.

---

## Acknowledgments

- [GNU Emacs](https://www.gnu.org/software/emacs/)
- [MELPA](https://melpa.org/)
- [Doom Emacs](https://github.com/hlissner/doom-emacs)
- [Spacemacs](https://www.spacemacs.org/)

---

<div align="center">
  <p>Hosted on <a href="https://git.fridu.us/software/emacs-personal.git">git.fridu.us</a></p>
  <p>Happy hacking!</p>
</div>