migrations
This commit is contained in:
parent
d1b0670d71
commit
f2b07c9f30
57 changed files with 2970 additions and 1 deletions
143
10-linux/00-utils/helix/buffer.md
Normal file
143
10-linux/00-utils/helix/buffer.md
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
В Helix управление буферами очень удобно. Вот основные команды и действия, чтобы:
|
||||
|
||||
---
|
||||
|
||||
## Как открыть новый буфер
|
||||
|
||||
- Открыть файл в новом буфере:
|
||||
|
||||
text
|
||||
|
||||
`:open filename`
|
||||
|
||||
или клавиша быстрого вызова:
|
||||
|
||||
text
|
||||
|
||||
`<space> f`
|
||||
|
||||
Вызовет **file picker**, где можно выбрать или ввести имя файла.
|
||||
|
||||
- Открыть новый пустой (scratch) буфер:
|
||||
|
||||
text
|
||||
|
||||
`:new`
|
||||
|
||||
Можно использовать также `:vnew` (вертикальный сплит) или `:hsplit` (горизонтальный сплит).
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Как переключаться между буферами
|
||||
|
||||
- Открыть список буферов (buffer picker):
|
||||
|
||||
text
|
||||
|
||||
`<space> b`
|
||||
|
||||
Навигация стрелками для выбора.
|
||||
|
||||
- Следующий буфер:
|
||||
|
||||
text
|
||||
|
||||
`gn`
|
||||
|
||||
- Предыдущий буфер:
|
||||
|
||||
text
|
||||
|
||||
`gp`
|
||||
|
||||
- Перейти к конкретному буферу по номеру (если есть номера в конфиге):
|
||||
|
||||
text
|
||||
|
||||
`:buffer N`
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Как закрыть буфер
|
||||
|
||||
- Закрыть текущий буфер:
|
||||
|
||||
text
|
||||
|
||||
`:buffer-close`
|
||||
|
||||
или короче
|
||||
|
||||
text
|
||||
|
||||
`bc`
|
||||
|
||||
- Закрыть все другие буферы кроме текущего:
|
||||
|
||||
text
|
||||
|
||||
`:buffer-close-others`
|
||||
|
||||
или
|
||||
|
||||
text
|
||||
|
||||
`bca`
|
||||
|
||||
- Закрыть буфер с сохранением:
|
||||
|
||||
text
|
||||
|
||||
`:write-buffer-close`
|
||||
|
||||
или
|
||||
|
||||
text
|
||||
|
||||
`wbc`
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Полезные команды для буферов
|
||||
|
||||
|Команда|Назначение|
|
||||
|---|---|
|
||||
|`<space> b`|Открыть picker буферов|
|
||||
|`gn`|Следующий буфер|
|
||||
|`gp`|Предыдущий буфер|
|
||||
|`bc`|Закрыть текущий буфер|
|
||||
|`bca`|Закрыть все, кроме текущего|
|
||||
|`:open filename`|Открыть файл в новом буфере|
|
||||
|`:new`|Новый пустой буфер (scratch)|
|
||||
|`wbc`|Сохранить и закрыть буфер|
|
||||
|
||||
---
|
||||
|
||||
## Быстрая шпаргалка по буферам
|
||||
|
||||
|Действие|Команда|
|
||||
|---|---|
|
||||
|Открыть файл в буфере|`<space> f` / `:open filename`|
|
||||
|Переключиться|`gn` / `gp` / `<space> b`|
|
||||
|Закрыть буфер|`bc`|
|
||||
|Закрыть другие буферы|`bca`|
|
||||
|Новый пустой буфер|`:new`|
|
||||
|Сохранить и закрыть|`wbc`|
|
||||
|
||||
---
|
||||
|
||||
Это покрывает весь базовый и продвинутый workflow вокруг работы с буферами в Helix, удобно и быстро! 🚀
|
||||
|
||||
1. [https://github.com/helix-editor/helix/discussions/5865](https://github.com/helix-editor/helix/discussions/5865)
|
||||
2. [https://github.com/helix-editor/helix/issues/475](https://github.com/helix-editor/helix/issues/475)
|
||||
3. [https://github.com/helix-editor/helix/discussions/10430](https://github.com/helix-editor/helix/discussions/10430)
|
||||
4. [https://rushter.com/blog/helix-editor/](https://rushter.com/blog/helix-editor/)
|
||||
5. [https://www.youtube.com/watch?v=2P8GP1LEfKE](https://www.youtube.com/watch?v=2P8GP1LEfKE)
|
||||
6. [https://github.com/helix-editor/helix/discussions/6057](https://github.com/helix-editor/helix/discussions/6057)
|
||||
7. [https://www.reddit.com/r/HelixEditor/comments/1i2m50c/i_keep_closing_the_whole_editor_when_i_want_to/](https://www.reddit.com/r/HelixEditor/comments/1i2m50c/i_keep_closing_the_whole_editor_when_i_want_to/)
|
||||
8. [https://github.com/helix-editor/helix/discussions/6983](https://github.com/helix-editor/helix/discussions/6983)
|
||||
9. [https://docs.helix-editor.com/commands.html](https://docs.helix-editor.com/commands.html)
|
||||
10. [https://www.youtube.com/watch?v=S4tTZjz-NTc](https://www.youtube.com/watch?v=S4tTZjz-NTc)
|
||||
97
10-linux/00-utils/helix/changes.md
Normal file
97
10-linux/00-utils/helix/changes.md
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
Отлично! В Helix есть **несколько способов** увидеть несохранённые изменения:
|
||||
|
||||
## 1. Индикатор в статус-баре (самый простой)
|
||||
|
||||
**Смотри на статус-бар внизу экрана**:[github+1](https://github.com/helix-editor/helix/issues/4686)
|
||||
|
||||
text
|
||||
|
||||
`NOR path/to/file.rs [+] 12:34 rust ↑ несохранённые изменения!`
|
||||
|
||||
**`[+]`** (или `[modified]`) означает, что файл изменён но не сохранён.[dev+1](https://dev.to/rajasegar/the-helix-way-36mh)
|
||||
|
||||
Если индикатора нет — файл сохранён ✅
|
||||
|
||||
## 2. Git diff gutter (если файл в git)
|
||||
|
||||
**Цветные полоски слева от номеров строк**:[helix-editor](https://docs.helix-editor.com/master/editor.html)
|
||||
|
||||
text
|
||||
|
||||
`│ 1 fn main() { ~ 2 println!("modified"); ← оранжевая волна = изменено + 3 let x = 5; ← зелёная полоса = добавлено - 4 // deleted line ← красная полоса = удалено │ 5 }`
|
||||
|
||||
Включено по умолчанию для git-репозиториев.[helix-editor](https://docs.helix-editor.com/master/editor.html)
|
||||
|
||||
## 3. Команды навигации по изменениям
|
||||
|
||||
**`]g`** — следующее изменение (goto next change)[helix-editor](https://docs.helix-editor.com/commands.html)
|
||||
**`[g`** — предыдущее изменение (goto prev change)[helix-editor](https://docs.helix-editor.com/commands.html)
|
||||
**`]G`** — последнее изменение (goto last change)[helix-editor](https://docs.helix-editor.com/commands.html)
|
||||
**`[G`** — первое изменение (goto first change)[helix-editor](https://docs.helix-editor.com/commands.html)
|
||||
|
||||
Прыгает курсором между изменёнными строками, чтобы ты мог быстро посмотреть, что менялось.[helix-editor](https://docs.helix-editor.com/commands.html)
|
||||
|
||||
## 4. Проверка при выходе
|
||||
|
||||
Если пытаешься выйти с несохранёнными изменениями:
|
||||
|
||||
**`:q`** или **`:quit`** — Helix покажет **предупреждение**:
|
||||
|
||||
text
|
||||
|
||||
`Error: Unsaved changes! Use :q! to force quit.`
|
||||
|
||||
**`:q!`** или **`:quit!`** — выйти БЕЗ сохранения (потеря изменений).[helix-editor](https://docs.helix-editor.com/commands.html)
|
||||
|
||||
## 5. Список открытых буферов (buffer line)
|
||||
|
||||
Включи **buffer line** в конфиге:[dev](https://dev.to/rajasegar/the-helix-way-36mh)
|
||||
|
||||
text
|
||||
|
||||
`# ~/.config/helix/config.toml [editor] bufferline = "always" # или "multiple"`
|
||||
|
||||
Тогда сверху появится панель со всеми открытыми файлами:
|
||||
|
||||
text
|
||||
|
||||
`file1.rs file2.rs [+] file3.c ↑ несохранённый файл`
|
||||
|
||||
## 6. Diff с сохранённой версией (нет из коробки)
|
||||
|
||||
К сожалению, Helix **пока не поддерживает** встроенную команду "show unsaved changes" (как в VSCode или Sublime). Это feature request.[github+1](https://github.com/helix-editor/helix/discussions/8864)
|
||||
|
||||
**Workaround**: используй git diff:
|
||||
|
||||
bash
|
||||
|
||||
`# В терминале (вне Helix) git diff file.rs`
|
||||
|
||||
Или внутри Helix через shell:
|
||||
**Space+c** → напечатай `!git diff %` (% = текущий файл)
|
||||
|
||||
## Лучшая практика
|
||||
|
||||
Комбинируй:
|
||||
|
||||
1. **Смотри на `[+]`** в статус-баре — главный индикатор[github](https://github.com/helix-editor/helix/issues/4686)
|
||||
|
||||
2. **Используй git diff gutter** — видишь изменения прямо в редакторе[helix-editor](https://docs.helix-editor.com/master/editor.html)
|
||||
|
||||
3. **Прыгай по `]g` / `[g`** — быстро проверить все правки[helix-editor](https://docs.helix-editor.com/commands.html)
|
||||
|
||||
4. **Включи bufferline** — видеть все несохранённые файлы сверху[dev](https://dev.to/rajasegar/the-helix-way-36mh)
|
||||
|
||||
|
||||
Теперь никогда не потеряешь изменения!
|
||||
|
||||
1. [https://github.com/helix-editor/helix/issues/4686](https://github.com/helix-editor/helix/issues/4686)
|
||||
2. [https://dev.to/rajasegar/the-helix-way-36mh](https://dev.to/rajasegar/the-helix-way-36mh)
|
||||
3. [https://docs.helix-editor.com/master/editor.html](https://docs.helix-editor.com/master/editor.html)
|
||||
4. [https://docs.helix-editor.com/commands.html](https://docs.helix-editor.com/commands.html)
|
||||
5. [https://github.com/helix-editor/helix/discussions/8864](https://github.com/helix-editor/helix/discussions/8864)
|
||||
6. [https://forum.sublimetext.com/t/improve-the-diff-shown-by-show-unsaved-changes/62198](https://forum.sublimetext.com/t/improve-the-diff-shown-by-show-unsaved-changes/62198)
|
||||
7. [https://github.com/helix-editor/helix/issues/1125](https://github.com/helix-editor/helix/issues/1125)
|
||||
8. [https://stackoverflow.com/questions/65874120/see-unsaved-changes-in-vscode](https://stackoverflow.com/questions/65874120/see-unsaved-changes-in-vscode)
|
||||
9. [https://github.com/helix-editor/helix/issues/7481](https://github.com/helix-editor/helix/issues/7481)
|
||||
10. [https://github.com/helix-editor/helix/issues/9655](https://github.com/helix-editor/helix/issues/9655)
|
||||
274
10-linux/00-utils/helix/cheatsheet.md
Normal file
274
10-linux/00-utils/helix/cheatsheet.md
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
# Полная Шпаргалка Клавиш Helix
|
||||
|
||||
## Основные Режимы (Mode Keys)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`i`|Insert mode (вставка перед курсором)|
|
||||
|`a`|Append (вставка после курсора)|
|
||||
|`I`|Insert в начале строки|
|
||||
|`A`|Append в конце строки|
|
||||
|`o`|Open line below (новая строка ниже)|
|
||||
|`O`|Open line above (новая строка выше)|
|
||||
|`v`|Select/extend mode (режим выделения)|
|
||||
|`Esc`|Вернуться в Normal mode|
|
||||
|`:`|Command mode (командный режим)|
|
||||
|
||||
## Движение (Movement)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`h`|Влево на символ|
|
||||
|`j`|Вниз на строку|
|
||||
|`k`|Вверх на строку|
|
||||
|`l`|Вправо на символ|
|
||||
|`w`|Следующее слово (начало)|
|
||||
|`b`|Предыдущее слово (начало)|
|
||||
|`e`|Следующее слово (конец)|
|
||||
|`W`|Следующее WORD (с пробелами)|
|
||||
|`B`|Предыдущее WORD|
|
||||
|`E`|Конец WORD|
|
||||
|`0`|Начало строки|
|
||||
|`$`|Конец строки|
|
||||
|`^`|Первый непробельный символ строки|
|
||||
|`gg`|Начало файла|
|
||||
|`ge` или `G`|Конец файла|
|
||||
|`Ctrl-d`|Полстраницы вниз|
|
||||
|`Ctrl-u`|Полстраницы вверх|
|
||||
|`Ctrl-f`|Страница вниз (PageDown)|
|
||||
|`Ctrl-b`|Страница вверх (PageUp)|
|
||||
|`%`|Найти парную скобку|
|
||||
|
||||
## Выделение (Selection)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`x`|Выделить строку целиком|
|
||||
|`X`|Выделить строку (без перевода строки)|
|
||||
|`w`|Выделить слово вперёд|
|
||||
|`b`|Выделить слово назад|
|
||||
|`%`|Выделить весь файл|
|
||||
|`s`|Split selection (поиск по regex)|
|
||||
|`;`|Collapse selection (убрать выделение)|
|
||||
|`,`|Remove primary selection|
|
||||
|`Alt-,`|Remove all secondary selections|
|
||||
|`C`|Duplicate cursor down|
|
||||
|`Alt-C`|Duplicate cursor up|
|
||||
|`&`|Align selections|
|
||||
|
||||
## Match Mode (m + клавиша)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`mm`|Goto matching bracket|
|
||||
|`ms`|Surround add (добавить окружение)|
|
||||
|`mr`|Surround replace|
|
||||
|`md`|Surround delete|
|
||||
|`mi(`|Select inside parentheses|
|
||||
|`ma(`|Select around parentheses|
|
||||
|`mi{`|Select inside braces|
|
||||
|`ma{`|Select around braces|
|
||||
|`mi"`|Select inside quotes|
|
||||
|`ma"`|Select around quotes|
|
||||
|`miw`|Select inside word|
|
||||
|`maw`|Select around word|
|
||||
|`mif`|Select inside function|
|
||||
|`maf`|Select around function|
|
||||
|
||||
## Редактирование (Edit)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`c`|Change (удалить выделение и войти в insert)|
|
||||
|`d`|Delete (удалить выделение)|
|
||||
|`y`|Yank (копировать)|
|
||||
|`p`|Paste after cursor|
|
||||
|`P`|Paste before cursor|
|
||||
|`R`|Replace with yanked text|
|
||||
|`u`|Undo|
|
||||
|`U`|Redo|
|
||||
|`r`|Replace character|
|
||||
|`~`|Toggle case (upper/lower)|
|
||||
|`` ` ``|Convert to lowercase|
|
||||
|` Alt-`` ` ``|Convert to uppercase|
|
||||
|`>`|Indent (вправо)|
|
||||
|`<`|Unindent (влево)|
|
||||
|`=`|Format selection (форматирование)|
|
||||
|`J`|Join lines|
|
||||
|`Alt-J`|Join lines with space|
|
||||
|`K`|Keep selections matching regex|
|
||||
|`Alt-K`|Remove selections matching regex|
|
||||
|
||||
## Поиск (Search)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`/`|Search forward|
|
||||
|`?`|Search backward|
|
||||
|`n`|Next search match|
|
||||
|`N`|Previous search match|
|
||||
|`*`|Search current selection forward|
|
||||
|
||||
## Goto Mode (g + клавиша)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`gh`|Goto line start|
|
||||
|`gl`|Goto line end|
|
||||
|`gs`|Goto first non-whitespace|
|
||||
|`ge`|Goto last line|
|
||||
|`gg`|Goto first line|
|
||||
|`gt`|Goto window top|
|
||||
|`gc`|Goto window center|
|
||||
|`gb`|Goto window bottom|
|
||||
|`gd`|Goto definition (LSP)|
|
||||
|`gy`|Goto type definition|
|
||||
|`gr`|Goto references|
|
||||
|`gi`|Goto implementation|
|
||||
|`ga`|Goto last accessed file|
|
||||
|`gm`|Goto last modified file|
|
||||
|`gn`|Goto next buffer|
|
||||
|`gp`|Goto previous buffer|
|
||||
|`g.`|Goto last modification|
|
||||
|
||||
## View Mode (z + клавиша)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`zz`|Center cursor vertically|
|
||||
|`zt`|Align cursor to top|
|
||||
|`zb`|Align cursor to bottom|
|
||||
|`zm`|Align cursor to middle|
|
||||
|`zj`|Scroll down (одна строка)|
|
||||
|`zk`|Scroll up (одна строка)|
|
||||
|`Z`|Enter **sticky view mode** (прокрутка без движения курсора)|
|
||||
|`Ctrl-d`|Scroll half page down|
|
||||
|`Ctrl-u`|Scroll half page up|
|
||||
|
||||
## Window Mode (Ctrl-w + клавиша)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`Ctrl-w v`|Vertical split|
|
||||
|`Ctrl-w s`|Horizontal split|
|
||||
|`Ctrl-w w`|Switch to next window|
|
||||
|`Ctrl-w h`|Goto left window|
|
||||
|`Ctrl-w j`|Goto bottom window|
|
||||
|`Ctrl-w k`|Goto top window|
|
||||
|`Ctrl-w l`|Goto right window|
|
||||
|`Ctrl-w q`|Close current window|
|
||||
|`Ctrl-w o`|Close all windows except current|
|
||||
|`Ctrl-w H`|Swap window left|
|
||||
|`Ctrl-w J`|Swap window down|
|
||||
|`Ctrl-w K`|Swap window up|
|
||||
|`Ctrl-w L`|Swap window right|
|
||||
|
||||
## Space Mode (Space + клавиша)
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`Space f`|File picker (открыть файл)|
|
||||
|`Space F`|File picker (current directory)|
|
||||
|`Space b`|Buffer picker (открытые файлы)|
|
||||
|`Space k`|Hover (показать документацию LSP)|
|
||||
|`Space s`|Symbol picker (функции/структуры)|
|
||||
|`Space S`|Workspace symbol picker|
|
||||
|`Space a`|Code actions (LSP)|
|
||||
|`Space r`|Rename symbol (LSP)|
|
||||
|`Space d`|Diagnostics picker (ошибки)|
|
||||
|`Space D`|Workspace diagnostics|
|
||||
|`Space h`|Highlight all occurrences|
|
||||
|`Space /`|Global search (ripgrep)|
|
||||
|`Space ?`|Command palette|
|
||||
|`Space y`|Yank (copy) to clipboard|
|
||||
|`Space p`|Paste from clipboard|
|
||||
|`Space P`|Paste from clipboard before|
|
||||
|`Space R`|Replace selections with clipboard|
|
||||
|`Space w`|Save file (:write)|
|
||||
|`Space q`|Quit (:quit)|
|
||||
|
||||
## LSP Специфичные
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`K`|Hover documentation|
|
||||
|`gd`|Goto definition|
|
||||
|`gy`|Goto type definition|
|
||||
|`gr`|Goto references|
|
||||
|`gi`|Goto implementation|
|
||||
|`]d`|Next diagnostic (ошибка)|
|
||||
|`[d`|Previous diagnostic|
|
||||
|`Space a`|Code actions|
|
||||
|`Space r`|Rename symbol|
|
||||
|
||||
## Insert Mode Специфичные
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`Ctrl-x`|Autocomplete|
|
||||
|`Ctrl-w`|Delete word backward|
|
||||
|`Ctrl-u`|Delete to line start|
|
||||
|`Ctrl-k`|Delete to line end|
|
||||
|`Ctrl-h`|Backspace|
|
||||
|`Ctrl-d`|Delete forward|
|
||||
|`Ctrl-j`|Insert newline|
|
||||
|
||||
## Диагностика и Отладка
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`]d`|Next diagnostic|
|
||||
|`[d`|Previous diagnostic|
|
||||
|`]g`|Next git change|
|
||||
|`[g`|Previous git change|
|
||||
|`]f`|Next function|
|
||||
|`[f`|Previous function|
|
||||
|`]c`|Next class|
|
||||
|`[c`|Previous class|
|
||||
|
||||
## Дополнительные
|
||||
|
||||
|Клавиша|Действие|
|
||||
|---|---|
|
||||
|`.`|Repeat last change|
|
||||
|`q`|Record macro (например, `qa` → запись в регистр a)|
|
||||
|`Q`|Replay macro (например, `@a` в Vim, но в Helix просто `Q`)|
|
||||
|`@`|Shell pipe (выполнить shell команду)|
|
||||
|`!`|Shell pipe replace|
|
||||
|`Alt-!`|Shell append output|
|
||||
|`$`|Shell pipe each selection|
|
||||
|
||||
---
|
||||
|
||||
## Командный Режим (после `:`)
|
||||
|
||||
|Команда|Действие|
|
||||
|---|---|
|
||||
|`:w`|Write (save) file|
|
||||
|`:q`|Quit|
|
||||
|`:wq` или `:x`|Write and quit|
|
||||
|`:q!`|Force quit (без сохранения)|
|
||||
|`:open file.txt`|Open file|
|
||||
|`:buffer-close`|Close current buffer|
|
||||
|`:reload`|Reload file from disk|
|
||||
|`:set key value`|Set option|
|
||||
|`:vsplit`|Vertical split|
|
||||
|`:hsplit`|Horizontal split|
|
||||
|`:sh command`|Run shell command|
|
||||
|`:insert-output command`|Insert shell command output|
|
||||
|`:pipe command`|Pipe selection through command|
|
||||
|
||||
---
|
||||
|
||||
Эта шпаргалка покрывает **95% ежедневного использования** Helix. Сохрани в Obsidian и распечатай — первые недели будешь часто подглядывать, потом всё в мышечную память! 🚀
|
||||
|
||||
**Ключевое отличие от Vim:** в Helix **сначала выделение** (selection-first), **потом действие**. Это делает редактирование **предсказуемым** — ты всегда видишь, что изменишь, перед тем как это сделать.
|
||||
|
||||
1. [https://docs.helix-editor.com/keymap.html](https://docs.helix-editor.com/keymap.html)
|
||||
2. [https://github.com/helix-editor/helix/discussions/12270](https://github.com/helix-editor/helix/discussions/12270)
|
||||
3. [https://www.reddit.com/r/HelixEditor/comments/11hvikl/in_editor_keyboard_shortcuts_cheatsheet/](https://www.reddit.com/r/HelixEditor/comments/11hvikl/in_editor_keyboard_shortcuts_cheatsheet/)
|
||||
4. [https://docs.helix-editor.com/remapping.html](https://docs.helix-editor.com/remapping.html)
|
||||
5. [https://github.com/helix-editor/helix/issues/4864](https://github.com/helix-editor/helix/issues/4864)
|
||||
6. [https://news.ycombinator.com/item?id=40492300](https://news.ycombinator.com/item?id=40492300)
|
||||
7. [https://blog.ohheybrian.com/2023/01/this-was-written-with-helix](https://blog.ohheybrian.com/2023/01/this-was-written-with-helix)
|
||||
8. [https://jonathan-frere.com/posts/helix/](https://jonathan-frere.com/posts/helix/)
|
||||
161
10-linux/00-utils/helix/keys.md
Normal file
161
10-linux/00-utils/helix/keys.md
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
**:w** или **:write**
|
||||
**:bc** или **:buffer-close**
|
||||
|
||||
Отлично! В Helix есть мощная LSP-интеграция для навигации по коду. Вот полный гайд:
|
||||
|
||||
## Переход к определению и обратно
|
||||
|
||||
## Основные команды навигации (goto mode)
|
||||
|
||||
Нажми **g** затем:[helix-editor+2](https://docs.helix-editor.com/keymap.html)
|
||||
|
||||
**К определению:**
|
||||
|
||||
- **gd** — Go to **definition** (переход к определению функции/переменной)[helix-editor+2](https://docs.helix-editor.com/commands.html)
|
||||
|
||||
- **gy** — Go to **type definition** (переход к определению типа)[huqingye-1798.xlog+1](https://huqingye-1798.xlog.app/Helix-an-jian-ying-she--zhuan-)
|
||||
|
||||
- **gi** — Go to **implementation** (переход к реализации трейта/интерфейса)[helix-editor+1](https://docs.helix-editor.com/keymap.html)
|
||||
|
||||
|
||||
**К использованиям:**
|
||||
|
||||
- **gr** — Go to **references** (показать все места, где используется функция)[kapeli+2](https://kapeli.com/cheat_sheets/Helix.docset/Contents/Resources/Documents/index)
|
||||
|
||||
|
||||
## Возврат назад (Jumplist)
|
||||
|
||||
После перехода по `gd`, Helix автоматически сохраняет твою предыдущую позицию в **jumplist** (список переходов):[helix-editor](https://docs.helix-editor.com/master/jumplist.html)youtube
|
||||
|
||||
- **Ctrl+o** — jump **Out** (вернуться назад по jumplist)[reddit+1](https://www.reddit.com/r/HelixEditor/comments/1hhae1n/undo_go_to_definition/)youtube
|
||||
|
||||
- **Ctrl+i** — jump **In** (вернуться вперёд по jumplist)youtube[helix-editor](https://docs.helix-editor.com/master/jumplist.html)
|
||||
|
||||
- **Ctrl+s** — вручную сохранить текущую позицию в jumplist[helix-editor](https://docs.helix-editor.com/master/jumplist.html)youtube
|
||||
|
||||
|
||||
**Пример воркфлоу:**
|
||||
|
||||
1. Ты на вызове функции `calculate_sum()`
|
||||
|
||||
2. Жмёшь **gd** → переходишь к определению
|
||||
|
||||
3. Смотришь код, делаешь правки
|
||||
|
||||
4. Жмёшь **Ctrl+o** → возвращаешься к вызову
|
||||
|
||||
5. Если нужно снова к определению — **Ctrl+i**
|
||||
|
||||
|
||||
## Просмотр всего jumplist
|
||||
|
||||
**Space+j** — открыть picker со всеми сохранёнными переходамиyoutube[helix-editor](https://docs.helix-editor.com/master/jumplist.html)
|
||||
|
||||
Это интерактивное меню, где видны все позиции, куда ты прыгал. Можешь выбрать любую стрелками и нажать Enter.youtube
|
||||
|
||||
## Навигация между вызовами функции
|
||||
|
||||
**Найти все использования:**
|
||||
|
||||
1. Встань на имя функции
|
||||
|
||||
2. Нажми **gr** (goto references)[kapeli+1](https://kapeli.com/cheat_sheets/Helix.docset/Contents/Resources/Documents/index)
|
||||
|
||||
3. Откроется picker со всеми местами, где функция вызывается
|
||||
|
||||
4. Используй стрелки для выбора, Enter для перехода[huqingye-1798.xlog](https://huqingye-1798.xlog.app/Helix-an-jian-ying-she--zhuan-)
|
||||
|
||||
|
||||
**Переход между функциями в файле:**
|
||||
|
||||
- **]f** — следующая функция (next function)[helix-editor+1](https://docs.helix-editor.com/keymap.html)
|
||||
|
||||
- **[f** — предыдущая функция (previous function)[huqingye-1798.xlog+1](https://huqingye-1798.xlog.app/Helix-an-jian-ying-she--zhuan-)
|
||||
|
||||
|
||||
Это работает через Tree-sitter (TS), не требует LSP.[helix-editor+1](https://docs.helix-editor.com/keymap.html)
|
||||
|
||||
## Навигация по диагностике (ошибки/предупреждения)
|
||||
|
||||
Бонус для дебага:[huqingye-1798.xlog+1](https://huqingye-1798.xlog.app/Helix-an-jian-ying-she--zhuan-)
|
||||
|
||||
- **]d** — следующая ошибка/предупреждение
|
||||
|
||||
- **[d** — предыдущая ошибка
|
||||
|
||||
- **[D** — первая ошибка в файле
|
||||
|
||||
- **]D** — последняя ошибка в файле
|
||||
|
||||
|
||||
## Полный workflow для Rust-разработки
|
||||
|
||||
**Сценарий 1: Изучение чужого кода**
|
||||
|
||||
text
|
||||
|
||||
`1. Встал на функцию → gd (перешёл к определению) 2. Посмотрел типы → gy (перешёл к type definition) 3. Хочу вернуться → Ctrl+o (назад к вызову) 4. Хочу посмотреть все вызовы → gr (список references) 5. Выбрал другой вызов → Enter 6. Возвращаюсь к первому → Space+j (jumplist picker)`
|
||||
|
||||
**Сценарий 2: Рефакторинг**
|
||||
|
||||
text
|
||||
|
||||
`1. Встал на функцию → gr (показать все вызовы) 2. Перешёл к первому → Enter 3. Сделал правки → Ctrl+s (сохранил позицию в jumplist) 4. Следующий вызов → выбрал из picker 5. Вернулся к предыдущему → Ctrl+o`
|
||||
|
||||
**Сценарий 3: Исследование трейтов**
|
||||
|
||||
text
|
||||
|
||||
`1. Встал на трейт → gy (type definition) 2. Хочу увидеть реализации → gi (implementations) 3. Picker показал все impl блоки → выбираю нужный 4. Возврат → Ctrl+o`
|
||||
|
||||
## Горячие клавиши для закладок (опционально)
|
||||
|
||||
Если хочешь быстро прыгать между важными местами, используй **marks** (закладки):[helix-editor](https://docs.helix-editor.com/remapping.html)
|
||||
|
||||
- **m** затем **буква** — установить закладку (например, `ma` для закладки 'a')
|
||||
|
||||
- **` ** (backtick) затем **буква** — перейти к закладке (например, `` ` a``)
|
||||
|
||||
|
||||
Это полезно для долгой работы над одним участком кода.[helix-editor](https://docs.helix-editor.com/remapping.html)
|
||||
|
||||
1. [https://docs.helix-editor.com/keymap.html](https://docs.helix-editor.com/keymap.html)
|
||||
2. [https://docs.helix-editor.com/commands.html](https://docs.helix-editor.com/commands.html)
|
||||
3. [https://kapeli.com/cheat_sheets/Helix.docset/Contents/Resources/Documents/index](https://kapeli.com/cheat_sheets/Helix.docset/Contents/Resources/Documents/index)
|
||||
4. [https://www.reddit.com/r/HelixEditor/comments/1hhae1n/undo_go_to_definition/](https://www.reddit.com/r/HelixEditor/comments/1hhae1n/undo_go_to_definition/)
|
||||
5. [https://huqingye-1798.xlog.app/Helix-an-jian-ying-she--zhuan-](https://huqingye-1798.xlog.app/Helix-an-jian-ying-she--zhuan-)
|
||||
6. [https://docs.helix-editor.com/master/jumplist.html](https://docs.helix-editor.com/master/jumplist.html)
|
||||
7. [https://www.youtube.com/watch?v=B3vQDHzsU0g](https://www.youtube.com/watch?v=B3vQDHzsU0g)
|
||||
8. [https://docs.helix-editor.com/remapping.html](https://docs.helix-editor.com/remapping.html)
|
||||
9. [https://github.com/helix-editor/helix/issues/3167](https://github.com/helix-editor/helix/issues/3167)
|
||||
10. [https://zed.dev/docs/key-bindings](https://zed.dev/docs/key-bindings)
|
||||
|
||||
В Helix для удаления строки используется **двухнажатийная комбинация** (не одна клавиша, как в некоторых редакторах):
|
||||
|
||||
## Основная команда
|
||||
|
||||
**x d**
|
||||
|
||||
- **x** — выделить текущую строку целиком
|
||||
|
||||
- **d** — удалить выделение
|
||||
|
||||
|
||||
Это самый быстрый и стандартный способ в Helix.[](https://pikabu.ru/story/osnovyi_helix_mini_gayd_13142410)
|
||||
|
||||
|
||||
|
||||
## Удаление нескольких строк
|
||||
|
||||
Если нужно удалить несколько строк подряд:
|
||||
|
||||
- **5x d** — удалить 5 строк (начиная с текущей вниз)
|
||||
|
||||
- **x 3k d** — выделить строку, расширить на 3 строки вверх, удалить
|
||||
|
||||
|
||||
## Удаление и переход в режим вставки
|
||||
|
||||
**x c** — удалить строку и сразу войти в insert mode (аналог vim's `cc`)
|
||||
|
||||
shift + A - это сразу войти в режим i
|
||||
95
10-linux/00-utils/helix/lsps.md
Normal file
95
10-linux/00-utils/helix/lsps.md
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
Отлично! Держи полный список **ключевых LSP** для всех основных языков — это всё, что нужно для профессиональной разработки в Helix.[helix-editor+1](https://docs.helix-editor.com/lang-support.html)
|
||||
|
||||
---
|
||||
|
||||
## 🦀 Systems Programming
|
||||
|
||||
text
|
||||
|
||||
```
|
||||
# Rust rust-analyzer # Официальный LSP от Rust Foundation # C/C++ clangd # LLVM-based LSP (рекомендуется) # или ccls # Альтернатива clangd # Zig zls # Официальный Zig Language Server # Go gopls # Официальный LSP от Google # D serve-d # D Language Server
|
||||
```
|
||||
---
|
||||
|
||||
## 🌐 Web Development
|
||||
|
||||
text
|
||||
|
||||
`# JavaScript/TypeScript nodePackages.typescript-language-server # или nodePackages.vscode-langservers-extracted # HTML/CSS/JSON тоже # Deno (альтернатива Node) deno # Deno встроенный LSP # Vue.js nodePackages.volar # Vue 3 LSP # Svelte nodePackages.svelte-language-server # Tailwind CSS nodePackages."@tailwindcss/language-server"`
|
||||
|
||||
---
|
||||
|
||||
## 🐍 Scripting Languages
|
||||
|
||||
text
|
||||
|
||||
`# Python python3Packages.python-lsp-server # pylsp (рекомендуется) # или pyright # Microsoft LSP (быстрее) # или basedpyright # Fork pyright # Ruby solargraph # Ruby LSP # Lua lua-language-server # sumneko_lua # Perl perlnavigator # Perl LSP`
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ DevOps & Config
|
||||
|
||||
text
|
||||
|
||||
`# Nix nil # Nix LSP (рекомендуется) # или nixd # Альтернатива с лучшей поддержкой flakes # YAML nodePackages.yaml-language-server # TOML taplo # Taplo LSP # JSON nodePackages.vscode-json-languageserver # Terraform terraform-ls # HashiCorp Terraform LSP # Docker nodePackages.dockerfile-language-server-nodejs # Ansible ansible-language-server`
|
||||
|
||||
---
|
||||
|
||||
## 🎨 Functional & Academic
|
||||
|
||||
text
|
||||
|
||||
`# Haskell haskell-language-server # HLS # OCaml ocamlPackages.ocaml-lsp # ocamllsp # Elixir elixir-ls # Elixir Language Server # Erlang erlang-ls # Erlang LS # Clojure clojure-lsp # Clojure LSP # Racket racket-langserver # Racket LS # PureScript nodePackages.purescript-language-server`
|
||||
|
||||
---
|
||||
|
||||
## 🏢 Enterprise & JVM
|
||||
|
||||
text
|
||||
|
||||
`# Java jdt-language-server # Eclipse JDT # Kotlin kotlin-language-server # Scala metals # Scalameta LSP # Groovy groovy-language-server`
|
||||
|
||||
---
|
||||
|
||||
## 📝 Markup & Data
|
||||
|
||||
text
|
||||
|
||||
`# Markdown marksman # Markdown LSP # LaTeX texlab # LaTeX LSP # GraphQL nodePackages.graphql-language-service-cli # Protobuf buf-language-server # Protobuf LSP`
|
||||
|
||||
---
|
||||
|
||||
## 🔥 Special Mention
|
||||
|
||||
text
|
||||
|
||||
`# Helix-GPT (AI completion) helix-gpt # OpenAI/Copilot в Helix # Emmet (HTML/CSS snippets) emmet-ls # Emmet expansion`
|
||||
|
||||
---
|
||||
|
||||
## 📋 Для копирования в Obsidian
|
||||
|
||||
text
|
||||
|
||||
``# Language Servers для Helix ## Systems - `rust-analyzer` — Rust - `clangd` — C/C++ - `zls` — Zig - `gopls` — Go ## Web - `typescript-language-server` — JS/TS - `vscode-langservers-extracted` — HTML/CSS/JSON - `volar` — Vue.js - `svelte-language-server` — Svelte - `@tailwindcss/language-server` — Tailwind ## Scripting - `python-lsp-server` — Python (или `pyright`) - `solargraph` — Ruby - `lua-language-server` — Lua ## DevOps - `nil` — Nix (или `nixd`) - `yaml-language-server` — YAML - `taplo` — TOML - `terraform-ls` — Terraform - `dockerfile-language-server` — Docker ## Functional - `haskell-language-server` — Haskell - `ocaml-lsp` — OCaml - `elixir-ls` — Elixir - `clojure-lsp` — Clojure ## JVM - `jdt-language-server` — Java - `kotlin-language-server` — Kotlin - `metals` — Scala ## Markup - `marksman` — Markdown - `texlab` — LaTeX - `graphql-language-service-cli` — GraphQL ## Bonus - `helix-gpt` — AI completion (OpenAI/Copilot) - `emmet-ls` — HTML/CSS snippets``
|
||||
|
||||
---
|
||||
|
||||
## Проверка установленных LSP
|
||||
|
||||
bash
|
||||
|
||||
`hx --health`
|
||||
|
||||
Покажет, какие LSP найдены и работают.[github+1](https://github.com/helix-editor/helix/discussions/7067)
|
||||
|
||||
1. [https://docs.helix-editor.com/lang-support.html](https://docs.helix-editor.com/lang-support.html)
|
||||
2. [https://langserver.org](https://langserver.org)
|
||||
3. [https://github.com/helix-editor/helix/discussions/7067](https://github.com/helix-editor/helix/discussions/7067)
|
||||
4. [https://discourse.nixos.org/t/helix-lsp-servers/34833](https://discourse.nixos.org/t/helix-lsp-servers/34833)
|
||||
5. [https://github.com/helix-editor/helix/discussions/8474](https://github.com/helix-editor/helix/discussions/8474)
|
||||
6. [https://www.reddit.com/r/NixOS/comments/1gu5q3q/what_lsp_do_you_use/](https://www.reddit.com/r/NixOS/comments/1gu5q3q/what_lsp_do_you_use/)
|
||||
7. [https://en.wikipedia.org/wiki/Language_Server_Protocol](https://en.wikipedia.org/wiki/Language_Server_Protocol)
|
||||
8. [https://docs.codelite.org/plugins/lsp/](https://docs.codelite.org/plugins/lsp/)
|
||||
9. [https://mynixos.com/nixpkgs/package/helix-gpt](https://mynixos.com/nixpkgs/package/helix-gpt)
|
||||
10. [https://github.com/isaacphi/mcp-language-server](https://github.com/isaacphi/mcp-language-server)
|
||||
1
10-linux/00-utils/helix/replace.md
Normal file
1
10-linux/00-utils/helix/replace.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
![[Pasted image 20251115162400.png]]
|
||||
46
10-linux/00-utils/helix/selection.md
Normal file
46
10-linux/00-utils/helix/selection.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
| Действие | Команда |
|
||||
| ---------------------------------- | --------------------- |
|
||||
| Войти в режим выделения | v |
|
||||
| Расширить выделение вниз (колонка) | Shift-CилиAlt-Shift-C |
|
||||
| Войти в мультикурсорный ввод | I(заглавная) |
|
||||
| Ввести текст одновременно | Печатать текст |
|
||||
| Выйти из мультикурсорного режима | Esc |
|
||||
| Добавить курсор ниже | C |
|
||||
| Удалить дополнительные курсоры | , |
|
||||
| Оставить один курсор (удалить все) | ; |
|
||||
|
||||
| Задача | Команда |
|
||||
| ----------------------------- | ------- |
|
||||
| Добавить курсор вниз | C |
|
||||
| Добавить курсор вниз n строк | nC |
|
||||
| Добавить курсор вверх | Alt-C |
|
||||
| Добавить курсор вверх n строк | nAlt-C |
|
||||
|
||||
| Действие | Команда |
|
||||
| ------------------------------------------- | ------- |
|
||||
| Добавить курсор вниз | C |
|
||||
| Добавить курсор вверх | Alt-C |
|
||||
| Добавить курсор вниз n строк | nC |
|
||||
| Добавить курсор вверх n строк | nAlt-C |
|
||||
| Удалить все дополнительные курсоры | , |
|
||||
| Начать выделение | v |
|
||||
| Расширить выделение движением | h/j/k/l |
|
||||
| Расширить выделение n строк вниз | nj |
|
||||
| Расширить выделение n строк вверх | nk |
|
||||
|
||||
|Действие|Команда|
|
||||
|---|---|
|
||||
|Войти в visual mode|v|
|
||||
|Расширить выделение вниз|j|
|
||||
|Расширить выделение вверх|k|
|
||||
|Переключить курсор и anchor|Alt-;|
|
||||
|Удалить все доп. курсоры|,|
|
||||
|Collapse selection|;|
|
||||
|Добавить курсор вниз|C|
|
||||
|Добавить курсор вверх|Alt-C|
|
||||
|
||||
| Действие | Команда / Клавиши | Описание |
|
||||
| ---------------------------------- | -------------------------------- | --------------------------------------------------- |
|
||||
| Переключение каретки в выделении | Alt + ; | Поменять активный конец (каретку) выделения |
|
||||
| Замена всех вхождений по паттерну | %→s→{pattern}→Enter→c→{new text} | Выделить весь файл, найти по паттерну, заменить все |
|
||||
| Логи нажатий (для проверки клавиш) | :log-open | Открыть лог нажатий клавиш для диагностики |
|
||||
Loading…
Add table
Add a link
Reference in a new issue