An open API service indexing awesome lists of open source software.

https://github.com/sensorario/miovim


https://github.com/sensorario/miovim

Last synced: 19 days ago
JSON representation

Awesome Lists containing this project

README

          

# ๐Ÿš€ MioVim - Configurazione Vim per JavaScript e TypeScript

Una configurazione completa e ottimizzata di Vim per lo sviluppo JavaScript e TypeScript, con supporto completo per LSP, formattazione automatica, linting e debugging.

## โœจ Caratteristiche

### ๐ŸŽฏ Funzionalitร  Core
- **Language Server Protocol (LSP)** completo via COC
- **Auto-completamento intelligente** per JS/TS
- **Syntax highlighting** avanzato per JavaScript, TypeScript, JSX, TSX
- **Formattazione automatica** con Prettier
- **Linting in tempo reale** con ESLint
- **Git integration** completa
- **File explorer** avanzato con icone
- **Fuzzy finder** per navigazione rapida
- **Debugging** integrato con Vimspector

### ๐ŸŽจ Interfaccia
- **Tema Gruvbox** ottimizzato per sviluppo
- **Status line** informativa con Airline
- **Icone Nerd Font** per file e cartelle
- **Evidenziazione sintassi** per tutti i linguaggi web
- **Numeri di riga relativi** per navigazione efficiente

### โšก Performance
- **Caricamento lazy** dei plugin
- **Cache ottimizzata** per completamento
- **Backup automatici** e gestione undo persistente
- **Ricerca veloce** con indicizzazione intelligente

## ๐Ÿ› ๏ธ Installazione

### ๐Ÿš€ Installazione Rapida (Solo configurazione Vim)

```bash
# Clona il repository
git clone https://github.com/sensorario/miovim.git
cd miovim

# Installazione rapida - solo configurazione Vim
./quick-install.sh
```

### ๐Ÿ”ง Installazione Completa (Consigliata)

```bash
# Clona il repository
git clone https://github.com/sensorario/miovim.git
cd miovim

# Installazione completa con tutte le dipendenze
./install.sh
```

Lo script completo installerร  automaticamente:
- โœ… Vim (se non presente)
- โœ… Node.js e npm (versione LTS)
- โœ… Dipendenze npm globali (TypeScript, ESLint, Prettier, etc.)
- โœ… Nerd Fonts per le icone
- โœ… Tutti i plugin Vim necessari
- โœ… Estensioni COC per LSP
- โœ… File di configurazione esempio

### โšก Installazione Avanzata con Opzioni

```bash
# Installazione con opzioni personalizzate
./install-advanced.sh --help

# Esempi:
./install-advanced.sh -y # Non interattiva
./install-advanced.sh --minimal # Solo base
./install-advanced.sh --no-nodejs # Senza Node.js
./install-advanced.sh --theme dracula # Con tema Dracula
./install-advanced.sh --config-only # Solo configurazioni
```

### ๐Ÿ› ๏ธ Utilizzo con Makefile

```bash
# Mostra tutti i comandi disponibili
make help

# Installazioni
make install # Installazione completa
make quick # Installazione rapida (solo Vim)
make minimal # Installazione minimale
make advanced # Installazione con opzioni

# Utilitร 
make demo # Crea progetto demo
make backup # Backup configurazione
make test # Testa configurazione
make check-deps # Verifica dipendenze
make update # Aggiorna configurazione
make uninstall # Disinstalla
```

### Installazione Manuale

Clicca per vedere i passaggi manuali

1. **Installa le dipendenze di sistema:**
```bash
# macOS
brew install vim node

# Ubuntu/Debian
sudo apt update && sudo apt install vim nodejs npm

# CentOS/RHEL
sudo yum install vim nodejs npm
```

2. **Installa dipendenze npm globali:**
```bash
npm install -g typescript eslint prettier @typescript-eslint/parser @typescript-eslint/eslint-plugin
```

3. **Copia la configurazione:**
```bash
cp .vimrc ~/.vimrc
cp coc-settings.json ~/.vim/
cat coc-config.vim >> ~/.vimrc
```

4. **Installa i plugin:**
```bash
vim +PlugInstall +qall
```

5. **Installa le estensioni COC:**
```bash
vim +"CocInstall coc-tsserver coc-json coc-prettier coc-eslint" +qall
```

## ๐ŸŽฎ Utilizzo

### Tasti e Shortcuts

#### Leader Key: ``

### ๐Ÿ“ Gestione File
| Shortcut | Descrizione |
|----------|-------------|
| `nt` | Apri/chiudi NERDTree |
| `nf` | Trova file corrente in NERDTree |
| `e` | Apri COC Explorer |
| `p` | Fuzzy finder (CtrlP) |
| `pb` | Lista buffer aperti |
| `pm` | File recenti (MRU) |

### โœ๏ธ Editing e Formattazione (come VS Code)
| Shortcut | Descrizione |
|----------|-------------|
| `w` | Salva file |
| `q` | Chiudi file |
| `x` | Salva e chiudi |
| `f` | Formatta documento/selezione |
| `f` | Formatta con Prettier (esatto come VS Code) |
| `pr` | Prettier: formatta file |
| `pc` | Prettier: check formato |
| `tf` | Toggle format on save |
| `rn` | Rinomina symbol |
| `ca` | Code actions |
| `qf` | Quick fix |

**Prettier configurato identico a VS Code:**
- โœ… Semicoloni abilitati (default VS Code)
- โœ… Doppi apici (default VS Code)
- โœ… Format on save automatico
- โœ… Stesse impostazioni di formattazione

### ๐Ÿ” Navigazione e Ricerca
| Shortcut | Descrizione |
|----------|-------------|
| `gd` | Vai alla definizione |
| `gy` | Vai al tipo |
| `gi` | Vai all'implementazione |
| `gr` | Trova riferimenti |
| `K` | Mostra documentazione |
| `a` | Ricerca globale (Ack) |
| `/` | Rimuovi highlight ricerca |

### ๐Ÿ”„ Buffer e Split
| Shortcut | Descrizione |
|----------|-------------|
| `bn` | Buffer successivo |
| `bp` | Buffer precedente |
| `bd` | Chiudi buffer |
| `h/j/k/l` | Naviga tra split |
| `+/-` | Ridimensiona split orizzontale |
| `>` | Ridimensiona split verticale |

### ๐ŸŒฟ Git
| Shortcut | Descrizione |
|----------|-------------|
| `gs` | Git status |
| `gc` | Git commit |
| `gp` | Git push |
| `gl` | Git pull |
| `gd` | Git diff |

### ๐Ÿš€ COC (LSP)
| Shortcut | Descrizione |
|----------|-------------|
| `` | Accetta completamento |
| `Space` | Trigger completamento |
| `[g` / `]g` | Diagnostico precedente/successivo |
| `cd` | Lista diagnostici |
| `ce` | Lista estensioni |
| `cc` | Lista comandi |
| `co` | Outline documento |

### ๐Ÿ’ป Terminale
| Shortcut | Descrizione |
|----------|-------------|
| `tt` | Apri terminale integrato |
| `r` | Ricarica configurazione |

## โš™๏ธ Configurazione

### File di Configurazione

La configurazione include i seguenti file:

- **`.vimrc`** - Configurazione principale Vim
- **`coc-settings.json`** - Configurazione COC/LSP
- **`eslintrc.example.json`** - Configurazione ESLint esempio
- **`prettierrc.example.json`** - Configurazione Prettier esempio
- **`tsconfig.example.json`** - Configurazione TypeScript esempio
- **`.editorconfig`** - Configurazione editor cross-platform

### Plugin Installati

#### Core
- `vim-sensible` - Configurazioni base sensate
- `nerdtree` - File explorer
- `ctrlp.vim` - Fuzzy finder
- `vim-fugitive` - Git integration
- `vim-airline` - Status bar migliorata

#### JavaScript/TypeScript
- `vim-javascript` - Syntax highlighting JS
- `typescript-vim` - Syntax highlighting TS
- `vim-jsx-pretty` - JSX support
- `vim-jsx-typescript` - TSX support
- `coc.nvim` - Language Server Protocol

#### Editing
- `vim-surround` - Gestione quotes/brackets
- `vim-commentary` - Commenti intelligenti
- `auto-pairs` - Auto-chiusura parentesi
- `vim-closetag` - Auto-chiusura tag HTML/JSX

#### Formattazione e Linting
- `vim-prettier` - Prettier integration
- `ale` - Linting asincrono

### Estensioni COC

- `coc-tsserver` - TypeScript language server
- `coc-eslint` - ESLint integration
- `coc-prettier` - Prettier integration
- `coc-json` - JSON support
- `coc-html` - HTML support
- `coc-css` - CSS support
- `coc-emmet` - Emmet abbreviations
- `coc-snippets` - Code snippets
- `coc-explorer` - File explorer avanzato
- `coc-git` - Git integration

## ๐ŸŽจ Personalizzazione

### Cambiare Tema

Per cambiare il tema da Gruvbox:

```vim
" In .vimrc, sostituisci:
colorscheme gruvbox
" Con il tema desiderato, es:
colorscheme dracula
```

Temi consigliati:
- `dracula/vim`
- `joshdick/onedark.vim`
- `arcticicestudio/nord-vim`

### Modificare Impostazioni LSP

Modifica `~/.vim/coc-settings.json` per personalizzare:

```json
{
"typescript.preferences.includePackageJsonAutoImports": "on",
"prettier.printWidth": 120,
"eslint.autoFixOnSave": true
}
```

### Aggiungere Plugin

Aggiungi plugin in `.vimrc` nella sezione `call plug#begin()`:

```vim
call plug#begin('~/.vim/plugged')
" ... plugin esistenti ...
Plug 'nuovo/plugin'
call plug#end()
```

Poi esegui `:PlugInstall` in Vim.

## ๐Ÿ› Troubleshooting

### Problemi Comuni

#### COC non funziona
```bash
# Verifica Node.js
node --version # Deve essere >= 14.x

# Reinstalla estensioni COC
vim +"CocInstall coc-tsserver coc-eslint coc-prettier" +qall
```

#### Font/Icone mancanti
```bash
# macOS
brew install --cask font-fira-code-nerd-font

# Linux
# Scarica e installa manualmente i Nerd Fonts
```

#### ESLint non funziona
```bash
# Installa ESLint globalmente
npm install -g eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin

# Crea .eslintrc.json nel progetto
cp eslintrc.example.json .eslintrc.json
```

#### Prettier non formatta
```bash
# Verifica configurazione in coc-settings.json
# Assicurati che sia presente:
"coc.preferences.formatOnSaveFiletypes": [
"javascript", "typescript", "javascriptreact", "typescriptreact"
]
```

### Log e Debug

#### Debug COC
```vim
:CocInfo " Informazioni sistema
:CocLog " Log COC
:CocConfig " Apri configurazione
```

#### Check Health
```vim
:checkhealth " Solo in Neovim
" In Vim classico verifica manualmente le dipendenze
```

## ๐Ÿ“š Risorse Utili

### Documentazione
- [Vim Tips Wiki](https://vim.fandom.com/wiki/Vim_Tips_Wiki)
- [COC.nvim Documentation](https://github.com/neoclide/coc.nvim)
- [TypeScript in Vim](https://pragmatic-coder.net/setup-typescript-vim-development/)

### Cheat Sheets
- [Vim Cheat Sheet](https://vim.rtorr.com/)
- [COC Shortcuts](https://github.com/neoclide/coc.nvim#example-vim-configuration)

### Community
- [r/vim](https://reddit.com/r/vim)
- [Vi and Vim Stack Exchange](https://vi.stackexchange.com/)

## ๐Ÿค Contribuire

1. Fork il repository
2. Crea una feature branch (`git checkout -b feature/amazing-feature`)
3. Commit le modifiche (`git commit -m 'Add amazing feature'`)
4. Push al branch (`git push origin feature/amazing-feature`)
5. Apri una Pull Request

## ๐Ÿ“ License

Questo progetto รจ sotto licenza MIT. Vedi `LICENSE` per dettagli.

## ๐Ÿ™ Ringraziamenti

- [Vim](https://www.vim.org/) - L'editor che ha reso tutto possibile
- [COC.nvim](https://github.com/neoclide/coc.nvim) - LSP amazing per Vim
- [Gruvbox](https://github.com/morhetz/gruvbox) - Tema fantastico
- Tutti i maintainer dei plugin utilizzati

---

**Happy Coding! ๐ŸŽ‰**

*Fatto con โค๏ธ per la community JavaScript/TypeScript*