Инструменты пользователя

Инструменты сайта


progs:vi

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слеваПредыдущая версия
Следующая версия
Предыдущая версия
progs:vi [22.12.2021 14:12] – [K8s manifests syntax] viacheslavprogs:vi [30.07.2024 19:21] (текущий) – внешнее изменение 127.0.0.1
Строка 1: Строка 1:
 +====== Vi ======
 +===== Start-up, Modes, Save and Quit =====
 +To enter Vi type:
 +<code bash>
 +vi FILENAME
 +</code>
 +Vi has two modes: Normal (command) mode and edit mode.\\
 +Switch to normal mode: <ESC>\\
 +Switch to edit mode: i or a
 +
 +Getting out of Vi (change to normal mode <ESC>):\\
 +Exit Vi:                       :q\\
 +Exit Vi (ignore changes):      :q!\\
 +Save:                          :w\\
 +Save and Exit:                 :wq\\
 +
 +Switch to (edit) an other file:\\
 +:edit FILENAME
 +
 +Getting help:\\
 +:help topic
 +
 +https://github.com/ksemaev/lpic_1-101/blob/master/103_8.md
 +
 +===== Цветовые схемы =====
 +Стандартный цвет комментариев - тёмно-синий на чёрном фоне, это нечитаемо. Исправить:
 +<code bash>
 +# В самом Vim
 +:color torte
 +# Сделать тему постоянной
 +echo ":color torte" >> ~/.vimrc
 +</code>
 +https://unix.stackexchange.com/questions/88879/better-colors-so-comments-arent-dark-blue-in-vim
 +===== K8s manifests syntax helper =====
 +<code bash>
 +# Установить vim-plug
 +curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
 +# Установить coc.nvim
 +mkdir ~/.vim/plugged
 +curl -sL install-node.vercel.app/lts | sudo bash
 +echo -e "call plug#begin('~/.vim/plugged')\nPlug 'neoclide/coc.nvim', {'branch': 'release'}\ncall plug#end()" >> ~/.vimrc
 +# В Vim:
 +:PlugInstall
 +:CocInstall coc-yaml
 +</code>
 +
 +''vi ~/.vim/coc-settings.json''
 +<code javascript>
 +{
 +  "languageserver": {
 +      "golang": {
 +        "command": "gopls",
 +        "rootPatterns": ["go.mod"],
 +        "filetypes": ["go"]
 +      }
 +  },
 +
 +  "yaml.schemas": {
 +      "kubernetes": "/*.yaml"
 +  }
 +}
 +</code>
 +
 +https://octetz.com/docs/2020/2020-01-06-vim-k8s-yaml-support/ (https://octetz.com/docs/2019/2019-04-24-vim-as-a-go-ide/)\\
 +https://github.com/junegunn/vim-plug\\
 +https://github.com/neoclide/coc.nvim\\
 +
 +Альтернативы:
 +
 +https://github.com/c9s/vikube.vim\\
 +https://github.com/andrewstuart/vim-kubernetes\\
 +https://github.com/rottencandy/vimkubectl
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki