@fredlackey/devutils 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +1 -1
- package/src/commands/install.js +374 -36
- package/src/installs/adobe-creative-cloud.js +527 -25
- package/src/installs/adobe-creative-cloud.md +605 -0
- package/src/installs/appcleaner.js +303 -26
- package/src/installs/appcleaner.md +699 -0
- package/src/installs/apt-transport-https.js +390 -0
- package/src/installs/apt-transport-https.md +678 -0
- package/src/installs/atomicparsley.js +624 -26
- package/src/installs/atomicparsley.md +795 -0
- package/src/installs/aws-cli.js +779 -26
- package/src/installs/aws-cli.md +727 -0
- package/src/installs/balena-etcher.js +688 -26
- package/src/installs/balena-etcher.md +761 -0
- package/src/installs/bambu-studio.js +912 -26
- package/src/installs/bambu-studio.md +780 -0
- package/src/installs/bash-completion.js +554 -23
- package/src/installs/bash-completion.md +833 -0
- package/src/installs/bash.js +399 -26
- package/src/installs/bash.md +993 -0
- package/src/installs/beyond-compare.js +585 -26
- package/src/installs/beyond-compare.md +813 -0
- package/src/installs/build-essential.js +511 -26
- package/src/installs/build-essential.md +977 -0
- package/src/installs/ca-certificates.js +618 -0
- package/src/installs/ca-certificates.md +937 -0
- package/src/installs/caffeine.js +490 -26
- package/src/installs/caffeine.md +839 -0
- package/src/installs/camtasia.js +577 -25
- package/src/installs/camtasia.md +762 -0
- package/src/installs/chatgpt.js +458 -26
- package/src/installs/chatgpt.md +814 -0
- package/src/installs/chocolatey.js +447 -0
- package/src/installs/chocolatey.md +661 -0
- package/src/installs/chrome-canary.js +472 -26
- package/src/installs/chrome-canary.md +641 -0
- package/src/installs/chromium.js +645 -26
- package/src/installs/chromium.md +838 -0
- package/src/installs/claude-code.js +558 -26
- package/src/installs/claude-code.md +1173 -0
- package/src/installs/curl.js +361 -26
- package/src/installs/curl.md +714 -0
- package/src/installs/cursor.js +561 -26
- package/src/installs/cursor.md +970 -0
- package/src/installs/dbschema.js +674 -26
- package/src/installs/dbschema.md +925 -0
- package/src/installs/dependencies.md +435 -0
- package/src/installs/development-tools.js +600 -0
- package/src/installs/development-tools.md +977 -0
- package/src/installs/docker.js +1010 -25
- package/src/installs/docker.md +1109 -0
- package/src/installs/drawio.js +1001 -26
- package/src/installs/drawio.md +795 -0
- package/src/installs/elmedia-player.js +328 -25
- package/src/installs/elmedia-player.md +556 -0
- package/src/installs/ffmpeg.js +870 -25
- package/src/installs/ffmpeg.md +852 -0
- package/src/installs/file.js +464 -0
- package/src/installs/file.md +987 -0
- package/src/installs/gemini-cli.js +793 -26
- package/src/installs/gemini-cli.md +1153 -0
- package/src/installs/git.js +382 -26
- package/src/installs/git.md +907 -0
- package/src/installs/gitego.js +931 -26
- package/src/installs/gitego.md +1172 -0
- package/src/installs/go.js +913 -26
- package/src/installs/go.md +958 -0
- package/src/installs/google-chrome.js +801 -25
- package/src/installs/google-chrome.md +862 -0
- package/src/installs/gpg.js +412 -73
- package/src/installs/gpg.md +1056 -0
- package/src/installs/homebrew.js +1015 -26
- package/src/installs/homebrew.md +988 -0
- package/src/installs/imageoptim.js +950 -26
- package/src/installs/imageoptim.md +1119 -0
- package/src/installs/installers.json +2297 -0
- package/src/installs/jq.js +382 -26
- package/src/installs/jq.md +809 -0
- package/src/installs/keyboard-maestro.js +701 -26
- package/src/installs/keyboard-maestro.md +825 -0
- package/src/installs/latex.js +771 -26
- package/src/installs/latex.md +1095 -0
- package/src/installs/lftp.js +338 -26
- package/src/installs/lftp.md +907 -0
- package/src/installs/lsb-release.js +346 -0
- package/src/installs/lsb-release.md +814 -0
- package/src/installs/messenger.js +829 -26
- package/src/installs/messenger.md +900 -0
- package/src/installs/microsoft-office.js +550 -26
- package/src/installs/microsoft-office.md +760 -0
- package/src/installs/microsoft-teams.js +782 -25
- package/src/installs/microsoft-teams.md +886 -0
- package/src/installs/node.js +886 -26
- package/src/installs/node.md +1153 -0
- package/src/installs/nordpass.js +698 -26
- package/src/installs/nordpass.md +921 -0
- package/src/installs/nvm.js +977 -26
- package/src/installs/nvm.md +1057 -0
- package/src/installs/openssh.js +734 -64
- package/src/installs/openssh.md +1056 -0
- package/src/installs/pandoc.js +644 -26
- package/src/installs/pandoc.md +1036 -0
- package/src/installs/pinentry.js +492 -26
- package/src/installs/pinentry.md +1142 -0
- package/src/installs/pngyu.js +851 -26
- package/src/installs/pngyu.md +896 -0
- package/src/installs/postman.js +781 -26
- package/src/installs/postman.md +940 -0
- package/src/installs/procps.js +425 -0
- package/src/installs/procps.md +851 -0
- package/src/installs/safari-tech-preview.js +355 -25
- package/src/installs/safari-tech-preview.md +533 -0
- package/src/installs/sfnt2woff.js +640 -26
- package/src/installs/sfnt2woff.md +795 -0
- package/src/installs/shellcheck.js +463 -26
- package/src/installs/shellcheck.md +1005 -0
- package/src/installs/slack.js +722 -25
- package/src/installs/slack.md +865 -0
- package/src/installs/snagit.js +566 -25
- package/src/installs/snagit.md +844 -0
- package/src/installs/software-properties-common.js +372 -0
- package/src/installs/software-properties-common.md +805 -0
- package/src/installs/spotify.js +858 -25
- package/src/installs/spotify.md +901 -0
- package/src/installs/studio-3t.js +803 -26
- package/src/installs/studio-3t.md +918 -0
- package/src/installs/sublime-text.js +780 -25
- package/src/installs/sublime-text.md +914 -0
- package/src/installs/superwhisper.js +687 -25
- package/src/installs/superwhisper.md +630 -0
- package/src/installs/tailscale.js +727 -26
- package/src/installs/tailscale.md +1100 -0
- package/src/installs/tar.js +389 -0
- package/src/installs/tar.md +946 -0
- package/src/installs/termius.js +780 -26
- package/src/installs/termius.md +844 -0
- package/src/installs/terraform.js +761 -26
- package/src/installs/terraform.md +899 -0
- package/src/installs/tidal.js +752 -25
- package/src/installs/tidal.md +864 -0
- package/src/installs/tmux.js +328 -26
- package/src/installs/tmux.md +1030 -0
- package/src/installs/tree.js +393 -26
- package/src/installs/tree.md +833 -0
- package/src/installs/unzip.js +460 -0
- package/src/installs/unzip.md +879 -0
- package/src/installs/vim.js +403 -26
- package/src/installs/vim.md +1040 -0
- package/src/installs/vlc.js +803 -26
- package/src/installs/vlc.md +927 -0
- package/src/installs/vscode.js +825 -26
- package/src/installs/vscode.md +1002 -0
- package/src/installs/wget.js +415 -0
- package/src/installs/wget.md +791 -0
- package/src/installs/whatsapp.js +710 -25
- package/src/installs/whatsapp.md +854 -0
- package/src/installs/winpty.js +352 -0
- package/src/installs/winpty.md +620 -0
- package/src/installs/woff2.js +535 -26
- package/src/installs/woff2.md +977 -0
- package/src/installs/wsl.js +572 -0
- package/src/installs/wsl.md +699 -0
- package/src/installs/xcode-clt.js +520 -0
- package/src/installs/xcode-clt.md +351 -0
- package/src/installs/xcode.js +542 -26
- package/src/installs/xcode.md +573 -0
- package/src/installs/yarn.js +806 -26
- package/src/installs/yarn.md +1074 -0
- package/src/installs/yq.js +636 -26
- package/src/installs/yq.md +944 -0
- package/src/installs/yt-dlp.js +683 -26
- package/src/installs/yt-dlp.md +946 -0
- package/src/installs/yum-utils.js +297 -0
- package/src/installs/yum-utils.md +648 -0
- package/src/installs/zoom.js +740 -25
- package/src/installs/zoom.md +884 -0
- package/src/scripts/README.md +567 -45
- package/src/scripts/STATUS.md +208 -0
- package/src/scripts/afk.js +395 -7
- package/src/scripts/backup-all.js +731 -9
- package/src/scripts/backup-source.js +711 -8
- package/src/scripts/brewd.js +373 -7
- package/src/scripts/brewi.js +505 -9
- package/src/scripts/brewr.js +512 -9
- package/src/scripts/brews.js +462 -9
- package/src/scripts/brewu.js +488 -7
- package/src/scripts/c.js +185 -7
- package/src/scripts/ccurl.js +325 -8
- package/src/scripts/certbot-crontab-init.js +488 -8
- package/src/scripts/certbot-init.js +641 -9
- package/src/scripts/ch.js +339 -7
- package/src/scripts/claude-danger.js +253 -8
- package/src/scripts/clean-dev.js +419 -8
- package/src/scripts/clear-dns-cache.js +525 -7
- package/src/scripts/clone.js +417 -7
- package/src/scripts/code-all.js +420 -7
- package/src/scripts/count-files.js +195 -8
- package/src/scripts/count-folders.js +195 -8
- package/src/scripts/count.js +248 -8
- package/src/scripts/d.js +203 -7
- package/src/scripts/datauri.js +373 -8
- package/src/scripts/delete-files.js +363 -7
- package/src/scripts/docker-clean.js +410 -8
- package/src/scripts/dp.js +426 -7
- package/src/scripts/e.js +375 -9
- package/src/scripts/empty-trash.js +497 -7
- package/src/scripts/evm.js +428 -9
- package/src/scripts/fetch-github-repos.js +441 -10
- package/src/scripts/get-channel.js +329 -8
- package/src/scripts/get-course.js +384 -11
- package/src/scripts/get-dependencies.js +290 -9
- package/src/scripts/get-folder.js +783 -10
- package/src/scripts/get-tunes.js +411 -10
- package/src/scripts/get-video.js +352 -9
- package/src/scripts/git-backup.js +561 -9
- package/src/scripts/git-clone.js +477 -9
- package/src/scripts/git-pup.js +303 -7
- package/src/scripts/git-push.js +380 -8
- package/src/scripts/h.js +607 -9
- package/src/scripts/hide-desktop-icons.js +483 -7
- package/src/scripts/hide-hidden-files.js +522 -7
- package/src/scripts/install-dependencies-from.js +440 -9
- package/src/scripts/ips.js +647 -10
- package/src/scripts/iso.js +354 -8
- package/src/scripts/killni.js +561 -7
- package/src/scripts/ll.js +451 -8
- package/src/scripts/local-ip.js +310 -8
- package/src/scripts/m.js +508 -8
- package/src/scripts/map.js +293 -8
- package/src/scripts/mkd.js +287 -7
- package/src/scripts/ncu-update-all.js +441 -8
- package/src/scripts/nginx-init.js +702 -12
- package/src/scripts/npmi.js +366 -7
- package/src/scripts/o.js +495 -8
- package/src/scripts/org-by-date.js +321 -7
- package/src/scripts/p.js +208 -7
- package/src/scripts/packages.js +313 -8
- package/src/scripts/path.js +209 -7
- package/src/scripts/ports.js +582 -8
- package/src/scripts/q.js +290 -8
- package/src/scripts/refresh-files.js +378 -10
- package/src/scripts/remove-smaller-files.js +500 -8
- package/src/scripts/rename-files-with-date.js +517 -9
- package/src/scripts/resize-image.js +523 -9
- package/src/scripts/rm-safe.js +653 -8
- package/src/scripts/s.js +525 -9
- package/src/scripts/set-git-public.js +349 -7
- package/src/scripts/show-desktop-icons.js +459 -7
- package/src/scripts/show-hidden-files.js +456 -7
- package/src/scripts/tpa.js +265 -8
- package/src/scripts/tpo.js +264 -7
- package/src/scripts/u.js +489 -7
- package/src/scripts/vpush.js +422 -8
- package/src/scripts/y.js +267 -7
- package/src/utils/common/os.js +94 -2
- package/src/utils/ubuntu/apt.js +13 -7
- package/src/utils/windows/choco.js +82 -26
- package/src/utils/windows/winget.js +89 -27
|
@@ -0,0 +1,1040 @@
|
|
|
1
|
+
# Installing Vim
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Vim (Vi IMproved) is a highly configurable, open-source text editor built to make creating and changing any kind of text very efficient. Originally released by Bram Moolenaar in 1991 as an improved version of the classic Unix Vi editor, Vim has become one of the most popular text editors among developers and system administrators.
|
|
6
|
+
|
|
7
|
+
Vim provides:
|
|
8
|
+
|
|
9
|
+
- Modal editing with distinct modes for inserting text and executing commands
|
|
10
|
+
- Extensive customization through configuration files and plugins
|
|
11
|
+
- Powerful search and replace with regular expression support
|
|
12
|
+
- Multi-window and multi-buffer editing
|
|
13
|
+
- Built-in scripting language (Vimscript) and support for external languages (Python, Lua, Ruby)
|
|
14
|
+
- Cross-platform availability on virtually every operating system
|
|
15
|
+
|
|
16
|
+
This guide documents Vim installation procedures for all platforms supported by DevUtils CLI.
|
|
17
|
+
|
|
18
|
+
## Dependencies
|
|
19
|
+
|
|
20
|
+
### macOS (Homebrew)
|
|
21
|
+
- **Required:**
|
|
22
|
+
- `Homebrew` - Install via `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` or run `dev install homebrew`
|
|
23
|
+
- **Optional:** None
|
|
24
|
+
- **Auto-installed:** None
|
|
25
|
+
|
|
26
|
+
### Ubuntu (APT/Snap)
|
|
27
|
+
- **Required:**
|
|
28
|
+
- `apt` - Pre-installed on Ubuntu/Debian systems
|
|
29
|
+
- `sudo` - Pre-installed, required for package installation
|
|
30
|
+
- **Optional:** None
|
|
31
|
+
- **Auto-installed:**
|
|
32
|
+
- `vim-runtime` - Runtime files, automatically installed by APT as a dependency
|
|
33
|
+
- `vim-common` - Common files shared between vim variants, automatically installed by APT
|
|
34
|
+
|
|
35
|
+
### Raspberry Pi OS (APT/Snap)
|
|
36
|
+
- **Required:**
|
|
37
|
+
- `apt` - Pre-installed on Raspberry Pi OS (Debian-based)
|
|
38
|
+
- `sudo` - Pre-installed, required for package installation
|
|
39
|
+
- **Optional:** None
|
|
40
|
+
- **Auto-installed:**
|
|
41
|
+
- `vim-runtime` - Runtime files, automatically installed by APT as a dependency
|
|
42
|
+
- `vim-common` - Common files shared between vim variants, automatically installed by APT
|
|
43
|
+
|
|
44
|
+
### Amazon Linux (DNF/YUM)
|
|
45
|
+
- **Required:**
|
|
46
|
+
- `dnf` (Amazon Linux 2023) or `yum` (Amazon Linux 2) - Pre-installed package manager
|
|
47
|
+
- `sudo` - Pre-installed, required for package installation
|
|
48
|
+
- **Optional:** None
|
|
49
|
+
- **Auto-installed:**
|
|
50
|
+
- `vim-common` - Common files, automatically installed as a dependency of vim-enhanced
|
|
51
|
+
- `vim-filesystem` - Filesystem layout, automatically installed as a dependency
|
|
52
|
+
|
|
53
|
+
### Windows (Chocolatey/winget)
|
|
54
|
+
- **Required:**
|
|
55
|
+
- `Chocolatey` - Install via PowerShell: `Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))` or run `dev install chocolatey`
|
|
56
|
+
- Administrator privileges - Required to run Chocolatey commands
|
|
57
|
+
- **Optional:** None
|
|
58
|
+
- **Auto-installed:**
|
|
59
|
+
- Runtime libraries - Chocolatey handles all runtime dependencies automatically
|
|
60
|
+
|
|
61
|
+
### Git Bash (Manual/Portable)
|
|
62
|
+
- **Required:**
|
|
63
|
+
- `Chocolatey` - Must be installed on Windows host (see Windows section above) or run `dev install chocolatey`
|
|
64
|
+
- `PowerShell` - Pre-installed on Windows, required to execute Chocolatey commands from Git Bash
|
|
65
|
+
- Windows Vim installation - Installed via `choco install vim -y` in PowerShell
|
|
66
|
+
- **Optional:** None
|
|
67
|
+
- **Auto-installed:** None (Git Bash inherits the Windows installation via PATH)
|
|
68
|
+
|
|
69
|
+
## Prerequisites
|
|
70
|
+
|
|
71
|
+
Before installing Vim on any platform, ensure:
|
|
72
|
+
|
|
73
|
+
1. **Internet connectivity** - Required to download Vim packages
|
|
74
|
+
2. **Administrative privileges** - Required for system-wide installation
|
|
75
|
+
3. **Terminal access** - Required to run installation commands
|
|
76
|
+
|
|
77
|
+
## Platform-Specific Installation
|
|
78
|
+
|
|
79
|
+
### macOS (Homebrew)
|
|
80
|
+
|
|
81
|
+
#### Prerequisites
|
|
82
|
+
|
|
83
|
+
- macOS 10.15 (Catalina) or later (macOS 14 Sonoma or later recommended)
|
|
84
|
+
- Homebrew package manager installed
|
|
85
|
+
- Command line access via Terminal.app or iTerm2
|
|
86
|
+
|
|
87
|
+
macOS includes a pre-installed version of Vim (accessible as `vi` or `vim`), but it is typically an older version with limited features. The Homebrew version provides the latest release with full feature support including Python, Lua, and Ruby integration.
|
|
88
|
+
|
|
89
|
+
If Homebrew is not installed, install it first:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Installation Steps
|
|
96
|
+
|
|
97
|
+
Run the following command to install Vim:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
brew install --quiet vim
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The `--quiet` flag suppresses non-essential output, making the installation suitable for automation and scripts.
|
|
104
|
+
|
|
105
|
+
#### Verification
|
|
106
|
+
|
|
107
|
+
Confirm the installation succeeded:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
vim --version | head -1
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Expected output (version numbers may vary):
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Dec 27 2025 12:00:00)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Verify the Homebrew version is being used (not the system version):
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
which vim
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Expected output for Apple Silicon Macs:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
/opt/homebrew/bin/vim
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Expected output for Intel Macs:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
/usr/local/bin/vim
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### Troubleshooting
|
|
138
|
+
|
|
139
|
+
**Problem**: `vim --version` shows an older version after installation
|
|
140
|
+
|
|
141
|
+
**Solution**: The system version of Vim may be taking precedence. Ensure Homebrew's bin directory is in your PATH before `/usr/bin`:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
|
|
145
|
+
source ~/.zshrc
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
For Intel Macs, use `/usr/local/bin` instead of `/opt/homebrew/bin`.
|
|
149
|
+
|
|
150
|
+
**Problem**: `brew: command not found`
|
|
151
|
+
|
|
152
|
+
**Solution**: Homebrew is not installed or not in PATH. Install Homebrew first:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Problem**: Homebrew reports conflicts with `ex-vi` or `macvim`
|
|
159
|
+
|
|
160
|
+
**Solution**: The Vim formula conflicts with these packages. Uninstall the conflicting package first:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
brew uninstall ex-vi
|
|
164
|
+
# or
|
|
165
|
+
brew uninstall macvim
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Then install Vim:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
brew install --quiet vim
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
### Ubuntu/Debian (APT)
|
|
177
|
+
|
|
178
|
+
#### Prerequisites
|
|
179
|
+
|
|
180
|
+
- Ubuntu 20.04 LTS or later, or Debian 11 (Bullseye) or later
|
|
181
|
+
- sudo privileges
|
|
182
|
+
- Internet connectivity
|
|
183
|
+
|
|
184
|
+
Ubuntu and Debian include Vim in their default repositories. The `vim` package provides the standard feature set, while `vim-gtk3` or `vim-nox` provide additional features.
|
|
185
|
+
|
|
186
|
+
#### Installation Steps
|
|
187
|
+
|
|
188
|
+
Run the following commands to update package lists and install Vim:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
|
|
192
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The `DEBIAN_FRONTEND=noninteractive` environment variable ensures no interactive prompts appear during installation, making this suitable for scripts and automation.
|
|
196
|
+
|
|
197
|
+
**For a more full-featured version** (includes Python, Perl, Ruby support without GUI):
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim-nox
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### Verification
|
|
204
|
+
|
|
205
|
+
Confirm the installation succeeded:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
vim --version | head -1
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Expected output (version numbers may vary):
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 30 2024 10:24:13)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Verify the installation location:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
which vim
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Expected output:
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
/usr/bin/vim
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### Troubleshooting
|
|
230
|
+
|
|
231
|
+
**Problem**: `E: Unable to locate package vim`
|
|
232
|
+
|
|
233
|
+
**Solution**: Update your package lists:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Problem**: Only `vi` is available, not `vim`
|
|
240
|
+
|
|
241
|
+
**Solution**: The minimal `vim-tiny` package may be installed. Install the full Vim package:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Problem**: Vim is installed but lacks Python support
|
|
248
|
+
|
|
249
|
+
**Solution**: Install the `vim-nox` package for scripting language support:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim-nox
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Problem**: Permission errors during installation
|
|
256
|
+
|
|
257
|
+
**Solution**: Ensure you are using sudo:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### Raspberry Pi OS (APT)
|
|
266
|
+
|
|
267
|
+
#### Prerequisites
|
|
268
|
+
|
|
269
|
+
- Raspberry Pi OS (Bookworm or Bullseye recommended)
|
|
270
|
+
- Raspberry Pi 3B+ or later (any model supported by Raspberry Pi OS)
|
|
271
|
+
- sudo privileges
|
|
272
|
+
- Internet connectivity
|
|
273
|
+
|
|
274
|
+
Raspberry Pi OS is based on Debian, so Vim installation follows the APT method. Vim is available in the default repositories and works on both 32-bit (armhf) and 64-bit (arm64) architectures.
|
|
275
|
+
|
|
276
|
+
**Note**: Vim is not installed by default on Raspberry Pi OS and must be installed manually.
|
|
277
|
+
|
|
278
|
+
#### Installation Steps
|
|
279
|
+
|
|
280
|
+
First, verify your architecture:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
uname -m
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
- `aarch64` = 64-bit ARM
|
|
287
|
+
- `armv7l` = 32-bit ARM
|
|
288
|
+
|
|
289
|
+
Install Vim using APT:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
|
|
293
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
The installation command is identical for both 32-bit and 64-bit Raspberry Pi OS. Vim requires approximately 30MB of storage space.
|
|
297
|
+
|
|
298
|
+
#### Verification
|
|
299
|
+
|
|
300
|
+
Confirm the installation succeeded:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
vim --version | head -1
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Expected output (version numbers may vary):
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 30 2024 10:24:13)
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Verify the installation location:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
which vim
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Expected output:
|
|
319
|
+
|
|
320
|
+
```
|
|
321
|
+
/usr/bin/vim
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Test the built-in tutorial:
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
vimtutor
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
This launches the interactive Vim tutorial, confirming Vim is working correctly.
|
|
331
|
+
|
|
332
|
+
#### Troubleshooting
|
|
333
|
+
|
|
334
|
+
**Problem**: Installation is slow
|
|
335
|
+
|
|
336
|
+
**Solution**: Raspberry Pi SD cards can be slow. Use a high-quality SD card (Class 10 or A1/A2 rated) or boot from USB/SSD for better performance.
|
|
337
|
+
|
|
338
|
+
**Problem**: `E: Unable to fetch some archives`
|
|
339
|
+
|
|
340
|
+
**Solution**: Network connectivity issues. Check your internet connection and retry:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
|
|
344
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
**Problem**: Package conflicts or broken dependencies
|
|
348
|
+
|
|
349
|
+
**Solution**: This can occur during repository updates. Fix broken packages before installing:
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -f
|
|
353
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
If the issue persists, wait a few hours and try again. Repository synchronization can cause temporary inconsistencies.
|
|
357
|
+
|
|
358
|
+
**Problem**: `vim-runtime` dependency issues
|
|
359
|
+
|
|
360
|
+
**Solution**: Install vim-runtime first:
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim-runtime
|
|
364
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
### Amazon Linux (DNF/YUM)
|
|
370
|
+
|
|
371
|
+
#### Prerequisites
|
|
372
|
+
|
|
373
|
+
- Amazon Linux 2023 (AL2023) or Amazon Linux 2 (AL2)
|
|
374
|
+
- sudo privileges
|
|
375
|
+
- EC2 instance or compatible environment
|
|
376
|
+
|
|
377
|
+
Amazon Linux 2023 uses DNF as the default package manager. Amazon Linux 2 uses YUM. Vim is available in the default repositories, though you should install `vim-enhanced` for the full-featured version.
|
|
378
|
+
|
|
379
|
+
**Note**: The default `vim-minimal` package provides only basic functionality in `/bin/vi`. Install `vim-enhanced` for the complete Vim experience.
|
|
380
|
+
|
|
381
|
+
#### Installation Steps
|
|
382
|
+
|
|
383
|
+
**For Amazon Linux 2023 (AL2023):**
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
sudo dnf install -y vim-enhanced
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**For Amazon Linux 2 (AL2):**
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
sudo yum install -y vim-enhanced
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
The `-y` flag automatically confirms installation, enabling non-interactive execution.
|
|
396
|
+
|
|
397
|
+
**Note**: The `vim-enhanced` package provides the full Vim editor with Python, Perl, and other scripting language support. The `vim-minimal` package (often pre-installed) only includes basic vi functionality.
|
|
398
|
+
|
|
399
|
+
#### Verification
|
|
400
|
+
|
|
401
|
+
Confirm the installation succeeded:
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
vim --version | head -1
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Expected output (version numbers may vary):
|
|
408
|
+
|
|
409
|
+
```
|
|
410
|
+
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 01 2024 00:00:00)
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Verify the installation location:
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
which vim
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Expected output:
|
|
420
|
+
|
|
421
|
+
```
|
|
422
|
+
/usr/bin/vim
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Check that the full version is installed (not vim-minimal):
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
rpm -q vim-enhanced
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
Expected output:
|
|
432
|
+
|
|
433
|
+
```
|
|
434
|
+
vim-enhanced-9.0.xxx-1.amzn2023.x86_64
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
#### Troubleshooting
|
|
438
|
+
|
|
439
|
+
**Problem**: `vim` command runs but has limited features
|
|
440
|
+
|
|
441
|
+
**Solution**: You may have `vim-minimal` instead of `vim-enhanced`. Install the full package:
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
# For AL2023
|
|
445
|
+
sudo dnf install -y vim-enhanced
|
|
446
|
+
|
|
447
|
+
# For AL2
|
|
448
|
+
sudo yum install -y vim-enhanced
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**Problem**: `No match for argument: vim-enhanced` on Amazon Linux 2
|
|
452
|
+
|
|
453
|
+
**Solution**: Update the yum cache and retry:
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
sudo yum makecache
|
|
457
|
+
sudo yum install -y vim-enhanced
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**Problem**: `Cannot find a valid baseurl for repo`
|
|
461
|
+
|
|
462
|
+
**Solution**: Network or repository configuration issue. Check connectivity:
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
# For AL2023
|
|
466
|
+
sudo dnf check-update
|
|
467
|
+
|
|
468
|
+
# For AL2
|
|
469
|
+
sudo yum check-update
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
**Problem**: Multiple Vim versions installed
|
|
473
|
+
|
|
474
|
+
**Solution**: List installed Vim packages and remove duplicates:
|
|
475
|
+
|
|
476
|
+
```bash
|
|
477
|
+
# For AL2023
|
|
478
|
+
sudo dnf list installed | grep vim
|
|
479
|
+
sudo dnf remove -y vim-minimal
|
|
480
|
+
|
|
481
|
+
# For AL2
|
|
482
|
+
sudo yum list installed | grep vim
|
|
483
|
+
sudo yum remove -y vim-minimal
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
488
|
+
### Windows (Chocolatey)
|
|
489
|
+
|
|
490
|
+
#### Prerequisites
|
|
491
|
+
|
|
492
|
+
- Windows 10 version 1903 or higher (64-bit), or Windows 11
|
|
493
|
+
- Administrator PowerShell or Command Prompt
|
|
494
|
+
- Chocolatey package manager installed
|
|
495
|
+
|
|
496
|
+
If Chocolatey is not installed, install it first by running this command in an Administrator PowerShell:
|
|
497
|
+
|
|
498
|
+
```powershell
|
|
499
|
+
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
#### Installation Steps
|
|
503
|
+
|
|
504
|
+
Run the following command in an Administrator PowerShell or Command Prompt:
|
|
505
|
+
|
|
506
|
+
```powershell
|
|
507
|
+
choco install vim -y
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
The `-y` flag automatically confirms all prompts, enabling fully non-interactive installation suitable for automation and scripts.
|
|
511
|
+
|
|
512
|
+
This installs:
|
|
513
|
+
|
|
514
|
+
- **vim.exe** - Terminal-based Vim editor
|
|
515
|
+
- **gvim.exe** - Graphical Vim application (GVim)
|
|
516
|
+
- **Context menu integration** - "Edit with Vim" option in Windows Explorer
|
|
517
|
+
- **Batch files** - `vim.bat`, `gvim.bat`, `view.bat`, and related commands in PATH
|
|
518
|
+
|
|
519
|
+
**Optional parameters** for customization:
|
|
520
|
+
|
|
521
|
+
```powershell
|
|
522
|
+
# Install without desktop shortcuts and context menu
|
|
523
|
+
choco install vim -y --params "'/NoDesktopShortcuts /NoContextmenu'"
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
After installation, close and reopen your terminal to ensure PATH changes take effect.
|
|
527
|
+
|
|
528
|
+
#### Verification
|
|
529
|
+
|
|
530
|
+
Open a new Command Prompt or PowerShell window, then run:
|
|
531
|
+
|
|
532
|
+
```powershell
|
|
533
|
+
vim --version
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
Expected output (version numbers may vary):
|
|
537
|
+
|
|
538
|
+
```
|
|
539
|
+
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Dec 27 2025 00:00:00)
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Verify the installation location:
|
|
543
|
+
|
|
544
|
+
```powershell
|
|
545
|
+
where vim
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
Expected output:
|
|
549
|
+
|
|
550
|
+
```
|
|
551
|
+
C:\tools\vim\vim91\vim.exe
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
Test GVim (graphical version):
|
|
555
|
+
|
|
556
|
+
```powershell
|
|
557
|
+
gvim
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
This should open the GVim window.
|
|
561
|
+
|
|
562
|
+
#### Troubleshooting
|
|
563
|
+
|
|
564
|
+
**Problem**: `'vim' is not recognized as an internal or external command`
|
|
565
|
+
|
|
566
|
+
**Solution**: Close and reopen your terminal window. If the problem persists, verify Vim is in your PATH:
|
|
567
|
+
|
|
568
|
+
```powershell
|
|
569
|
+
$env:PATH -split ';' | Select-String -Pattern 'vim'
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
If Vim is not listed, add it manually:
|
|
573
|
+
|
|
574
|
+
```powershell
|
|
575
|
+
$env:PATH += ";C:\tools\vim\vim91"
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
**Problem**: Antivirus flags Vim files
|
|
579
|
+
|
|
580
|
+
**Solution**: This is a known false positive. The official Vim builds are safe. Add an exception for the Vim installation directory in your antivirus software, or download from the official vim-win32-installer repository.
|
|
581
|
+
|
|
582
|
+
**Problem**: Chocolatey installation fails
|
|
583
|
+
|
|
584
|
+
**Solution**: Ensure you are running PowerShell as Administrator. Right-click PowerShell and select "Run as administrator".
|
|
585
|
+
|
|
586
|
+
**Problem**: "Edit with Vim" context menu not appearing
|
|
587
|
+
|
|
588
|
+
**Solution**: Reinstall with the RestartExplorer parameter:
|
|
589
|
+
|
|
590
|
+
```powershell
|
|
591
|
+
choco uninstall vim -y
|
|
592
|
+
choco install vim -y --params "'/RestartExplorer'"
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
|
|
597
|
+
### WSL (Ubuntu)
|
|
598
|
+
|
|
599
|
+
#### Prerequisites
|
|
600
|
+
|
|
601
|
+
- Windows 10 version 2004 or higher, or Windows 11
|
|
602
|
+
- WSL 2 enabled with Ubuntu distribution installed
|
|
603
|
+
- sudo privileges within WSL
|
|
604
|
+
|
|
605
|
+
WSL runs Ubuntu (or another Linux distribution) within Windows. Vim must be installed separately within WSL, as it does not share binaries with Windows.
|
|
606
|
+
|
|
607
|
+
#### Installation Steps
|
|
608
|
+
|
|
609
|
+
Open your WSL Ubuntu terminal and run:
|
|
610
|
+
|
|
611
|
+
```bash
|
|
612
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
|
|
613
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
The `DEBIAN_FRONTEND=noninteractive` environment variable prevents any interactive prompts during installation.
|
|
617
|
+
|
|
618
|
+
**For a more full-featured version** (includes Python, Perl, Ruby support):
|
|
619
|
+
|
|
620
|
+
```bash
|
|
621
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim-nox
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
#### Verification
|
|
625
|
+
|
|
626
|
+
Confirm the installation succeeded:
|
|
627
|
+
|
|
628
|
+
```bash
|
|
629
|
+
vim --version | head -1
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
Expected output (version numbers may vary):
|
|
633
|
+
|
|
634
|
+
```
|
|
635
|
+
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 30 2024 10:24:13)
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
Verify the installation location:
|
|
639
|
+
|
|
640
|
+
```bash
|
|
641
|
+
which vim
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
Expected output:
|
|
645
|
+
|
|
646
|
+
```
|
|
647
|
+
/usr/bin/vim
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
#### Troubleshooting
|
|
651
|
+
|
|
652
|
+
**Problem**: Vim version differs between WSL and Windows
|
|
653
|
+
|
|
654
|
+
**Solution**: This is expected behavior. WSL and Windows maintain separate installations. Use the appropriate Vim for each environment:
|
|
655
|
+
|
|
656
|
+
- Inside WSL terminal: Use Linux Vim (`/usr/bin/vim`)
|
|
657
|
+
- In Windows PowerShell/CMD: Use Windows Vim (if installed via Chocolatey)
|
|
658
|
+
|
|
659
|
+
**Problem**: Clipboard not shared between WSL Vim and Windows
|
|
660
|
+
|
|
661
|
+
**Solution**: Install a Vim version with clipboard support and configure it to use Windows clipboard:
|
|
662
|
+
|
|
663
|
+
```bash
|
|
664
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim-gtk3
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
Add to your `~/.vimrc`:
|
|
668
|
+
|
|
669
|
+
```vim
|
|
670
|
+
set clipboard=unnamedplus
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
**Problem**: Arrow keys produce letters (A, B, C, D) instead of moving cursor
|
|
674
|
+
|
|
675
|
+
**Solution**: This occurs when Vim is in compatible mode. Add to your `~/.vimrc`:
|
|
676
|
+
|
|
677
|
+
```vim
|
|
678
|
+
set nocompatible
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
**Problem**: Backspace key does not work as expected
|
|
682
|
+
|
|
683
|
+
**Solution**: Configure backspace behavior in `~/.vimrc`:
|
|
684
|
+
|
|
685
|
+
```vim
|
|
686
|
+
set backspace=indent,eol,start
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
---
|
|
690
|
+
|
|
691
|
+
### Git Bash (Windows Installation)
|
|
692
|
+
|
|
693
|
+
#### Prerequisites
|
|
694
|
+
|
|
695
|
+
- Windows 10 or Windows 11 (64-bit)
|
|
696
|
+
- Git for Windows installed (includes Git Bash)
|
|
697
|
+
- Vim installed on Windows (via Chocolatey, as documented above)
|
|
698
|
+
|
|
699
|
+
Git Bash is a terminal emulator for Windows that provides a Bash shell environment. Git for Windows includes a minimal version of Vim, but for full functionality, install Vim separately on Windows.
|
|
700
|
+
|
|
701
|
+
**Note**: Git Bash inherits the Windows PATH, so once Vim is installed on Windows via Chocolatey, the `vim` and `gvim` commands are available in Git Bash.
|
|
702
|
+
|
|
703
|
+
#### Installation Steps
|
|
704
|
+
|
|
705
|
+
**Step 1: Install Vim on Windows**
|
|
706
|
+
|
|
707
|
+
Run the following command in an Administrator PowerShell or Command Prompt:
|
|
708
|
+
|
|
709
|
+
```powershell
|
|
710
|
+
choco install vim -y
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
**Step 2: Restart Git Bash**
|
|
714
|
+
|
|
715
|
+
Close and reopen Git Bash to pick up the updated PATH.
|
|
716
|
+
|
|
717
|
+
**Step 3: Verify Vim is accessible**
|
|
718
|
+
|
|
719
|
+
In Git Bash, run:
|
|
720
|
+
|
|
721
|
+
```bash
|
|
722
|
+
vim --version | head -1
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
If Vim is not found, add it to your PATH in `~/.bashrc`:
|
|
726
|
+
|
|
727
|
+
```bash
|
|
728
|
+
echo 'export PATH="$PATH:/c/tools/vim/vim91"' >> ~/.bashrc
|
|
729
|
+
source ~/.bashrc
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
#### Verification
|
|
733
|
+
|
|
734
|
+
In Git Bash, confirm Vim is accessible:
|
|
735
|
+
|
|
736
|
+
```bash
|
|
737
|
+
vim --version | head -1
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
Expected output (version numbers may vary):
|
|
741
|
+
|
|
742
|
+
```
|
|
743
|
+
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Dec 27 2025 00:00:00)
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
Verify which Vim is being used:
|
|
747
|
+
|
|
748
|
+
```bash
|
|
749
|
+
which vim
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
Expected output:
|
|
753
|
+
|
|
754
|
+
```
|
|
755
|
+
/c/tools/vim/vim91/vim
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
Test GVim:
|
|
759
|
+
|
|
760
|
+
```bash
|
|
761
|
+
gvim
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
This should open the GVim window.
|
|
765
|
+
|
|
766
|
+
#### Troubleshooting
|
|
767
|
+
|
|
768
|
+
**Problem**: `vim: command not found` in Git Bash
|
|
769
|
+
|
|
770
|
+
**Solution**: Vim may not be in the PATH. Add it to your `~/.bashrc`:
|
|
771
|
+
|
|
772
|
+
```bash
|
|
773
|
+
echo 'export PATH="$PATH:/c/tools/vim/vim91"' >> ~/.bashrc
|
|
774
|
+
source ~/.bashrc
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
**Problem**: Git Bash uses the minimal Vim from Git for Windows instead of full Vim
|
|
778
|
+
|
|
779
|
+
**Solution**: The Chocolatey Vim should take precedence if PATH is correct. Verify by checking which vim is found first:
|
|
780
|
+
|
|
781
|
+
```bash
|
|
782
|
+
which -a vim
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
If the Git version appears first, reorder your PATH in `~/.bashrc`:
|
|
786
|
+
|
|
787
|
+
```bash
|
|
788
|
+
export PATH="/c/tools/vim/vim91:$PATH"
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
**Problem**: Interactive prompts hang or display incorrectly
|
|
792
|
+
|
|
793
|
+
**Solution**: Git Bash's mintty terminal has TTY compatibility issues. For interactive Vim sessions requiring special terminal features, use Windows Terminal or PowerShell instead.
|
|
794
|
+
|
|
795
|
+
**Problem**: Vim configuration file not found
|
|
796
|
+
|
|
797
|
+
**Solution**: Git Bash uses Windows home directory. Create your Vim configuration at the correct location:
|
|
798
|
+
|
|
799
|
+
```bash
|
|
800
|
+
# Check home directory
|
|
801
|
+
echo $HOME
|
|
802
|
+
|
|
803
|
+
# Create _vimrc in Windows home (Vim on Windows uses _vimrc, not .vimrc)
|
|
804
|
+
touch ~/_vimrc
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
---
|
|
808
|
+
|
|
809
|
+
## Post-Installation Configuration
|
|
810
|
+
|
|
811
|
+
After installing Vim on any platform, consider these optional but recommended configurations.
|
|
812
|
+
|
|
813
|
+
### Create a Basic Configuration File
|
|
814
|
+
|
|
815
|
+
Create a minimal `.vimrc` (Linux/macOS) or `_vimrc` (Windows) file:
|
|
816
|
+
|
|
817
|
+
**Linux/macOS** (`~/.vimrc`):
|
|
818
|
+
|
|
819
|
+
```bash
|
|
820
|
+
cat > ~/.vimrc << 'EOF'
|
|
821
|
+
" Disable compatibility mode with legacy vi
|
|
822
|
+
set nocompatible
|
|
823
|
+
|
|
824
|
+
" Enable syntax highlighting
|
|
825
|
+
syntax on
|
|
826
|
+
|
|
827
|
+
" Show line numbers
|
|
828
|
+
set number
|
|
829
|
+
|
|
830
|
+
" Enable mouse support
|
|
831
|
+
set mouse=a
|
|
832
|
+
|
|
833
|
+
" Set tab width to 4 spaces
|
|
834
|
+
set tabstop=4
|
|
835
|
+
set shiftwidth=4
|
|
836
|
+
set expandtab
|
|
837
|
+
|
|
838
|
+
" Enable auto-indentation
|
|
839
|
+
set autoindent
|
|
840
|
+
|
|
841
|
+
" Highlight search results
|
|
842
|
+
set hlsearch
|
|
843
|
+
set incsearch
|
|
844
|
+
|
|
845
|
+
" Show matching brackets
|
|
846
|
+
set showmatch
|
|
847
|
+
|
|
848
|
+
" Enable file type detection
|
|
849
|
+
filetype plugin indent on
|
|
850
|
+
|
|
851
|
+
" Use system clipboard
|
|
852
|
+
set clipboard=unnamedplus
|
|
853
|
+
EOF
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
**Windows** (`~/_vimrc` or `C:\Users\<username>\_vimrc`):
|
|
857
|
+
|
|
858
|
+
```powershell
|
|
859
|
+
@"
|
|
860
|
+
" Disable compatibility mode with legacy vi
|
|
861
|
+
set nocompatible
|
|
862
|
+
|
|
863
|
+
" Enable syntax highlighting
|
|
864
|
+
syntax on
|
|
865
|
+
|
|
866
|
+
" Show line numbers
|
|
867
|
+
set number
|
|
868
|
+
|
|
869
|
+
" Enable mouse support
|
|
870
|
+
set mouse=a
|
|
871
|
+
|
|
872
|
+
" Set tab width to 4 spaces
|
|
873
|
+
set tabstop=4
|
|
874
|
+
set shiftwidth=4
|
|
875
|
+
set expandtab
|
|
876
|
+
|
|
877
|
+
" Enable auto-indentation
|
|
878
|
+
set autoindent
|
|
879
|
+
|
|
880
|
+
" Highlight search results
|
|
881
|
+
set hlsearch
|
|
882
|
+
set incsearch
|
|
883
|
+
|
|
884
|
+
" Show matching brackets
|
|
885
|
+
set showmatch
|
|
886
|
+
|
|
887
|
+
" Enable file type detection
|
|
888
|
+
filetype plugin indent on
|
|
889
|
+
|
|
890
|
+
" Use system clipboard
|
|
891
|
+
set clipboard=unnamed
|
|
892
|
+
"@ | Out-File -FilePath "$env:USERPROFILE\_vimrc" -Encoding utf8
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
### Learn Vim Basics
|
|
896
|
+
|
|
897
|
+
Launch the built-in tutorial to learn essential Vim commands:
|
|
898
|
+
|
|
899
|
+
```bash
|
|
900
|
+
vimtutor
|
|
901
|
+
```
|
|
902
|
+
|
|
903
|
+
This interactive tutorial takes approximately 30 minutes and covers:
|
|
904
|
+
|
|
905
|
+
- Basic navigation (h, j, k, l)
|
|
906
|
+
- Editing commands (i, a, o, d, y, p)
|
|
907
|
+
- Saving and quitting (:w, :q, :wq)
|
|
908
|
+
- Search and replace
|
|
909
|
+
|
|
910
|
+
### Set Vim as Default Editor
|
|
911
|
+
|
|
912
|
+
**For Git:**
|
|
913
|
+
|
|
914
|
+
```bash
|
|
915
|
+
git config --global core.editor "vim"
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
**For shell (Linux/macOS):**
|
|
919
|
+
|
|
920
|
+
Add to `~/.bashrc` or `~/.zshrc`:
|
|
921
|
+
|
|
922
|
+
```bash
|
|
923
|
+
export EDITOR=vim
|
|
924
|
+
export VISUAL=vim
|
|
925
|
+
```
|
|
926
|
+
|
|
927
|
+
---
|
|
928
|
+
|
|
929
|
+
## Common Issues
|
|
930
|
+
|
|
931
|
+
### Issue: Arrow Keys Produce Letters (A, B, C, D)
|
|
932
|
+
|
|
933
|
+
**Symptoms**: Pressing arrow keys in insert mode types letters instead of moving the cursor
|
|
934
|
+
|
|
935
|
+
**Solution**: Enable nocompatible mode. Add to your `.vimrc`:
|
|
936
|
+
|
|
937
|
+
```vim
|
|
938
|
+
set nocompatible
|
|
939
|
+
```
|
|
940
|
+
|
|
941
|
+
### Issue: Backspace Does Not Delete Characters
|
|
942
|
+
|
|
943
|
+
**Symptoms**: Backspace key moves cursor but does not delete text
|
|
944
|
+
|
|
945
|
+
**Solution**: Configure backspace behavior. Add to your `.vimrc`:
|
|
946
|
+
|
|
947
|
+
```vim
|
|
948
|
+
set backspace=indent,eol,start
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
### Issue: Colors Look Wrong or Missing
|
|
952
|
+
|
|
953
|
+
**Symptoms**: Syntax highlighting has incorrect colors or no colors
|
|
954
|
+
|
|
955
|
+
**Solution**: Enable true color support. Add to your `.vimrc`:
|
|
956
|
+
|
|
957
|
+
```vim
|
|
958
|
+
set termguicolors
|
|
959
|
+
```
|
|
960
|
+
|
|
961
|
+
If colors still look wrong, your terminal may not support true color. Try:
|
|
962
|
+
|
|
963
|
+
```vim
|
|
964
|
+
set t_Co=256
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
### Issue: Cannot Exit Vim
|
|
968
|
+
|
|
969
|
+
**Symptoms**: New users get stuck in Vim and cannot exit
|
|
970
|
+
|
|
971
|
+
**Solution**: To exit Vim:
|
|
972
|
+
|
|
973
|
+
1. Press `Esc` to ensure you are in normal mode
|
|
974
|
+
2. Type `:q` and press `Enter` to quit (if no changes were made)
|
|
975
|
+
3. Type `:q!` and press `Enter` to quit without saving changes
|
|
976
|
+
4. Type `:wq` and press `Enter` to save and quit
|
|
977
|
+
|
|
978
|
+
### Issue: Clipboard Not Working
|
|
979
|
+
|
|
980
|
+
**Symptoms**: Yanking and pasting does not work with system clipboard
|
|
981
|
+
|
|
982
|
+
**Solution**: Verify Vim was compiled with clipboard support:
|
|
983
|
+
|
|
984
|
+
```bash
|
|
985
|
+
vim --version | grep clipboard
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
Look for `+clipboard`. If you see `-clipboard`, install a version with clipboard support:
|
|
989
|
+
|
|
990
|
+
**Ubuntu/Debian:**
|
|
991
|
+
|
|
992
|
+
```bash
|
|
993
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y vim-gtk3
|
|
994
|
+
```
|
|
995
|
+
|
|
996
|
+
**macOS (Homebrew):**
|
|
997
|
+
|
|
998
|
+
```bash
|
|
999
|
+
brew install --quiet vim
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
(Homebrew Vim includes clipboard support by default)
|
|
1003
|
+
|
|
1004
|
+
Then add to `.vimrc`:
|
|
1005
|
+
|
|
1006
|
+
```vim
|
|
1007
|
+
set clipboard=unnamedplus
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
### Issue: Slow Startup Time
|
|
1011
|
+
|
|
1012
|
+
**Symptoms**: Vim takes several seconds to start
|
|
1013
|
+
|
|
1014
|
+
**Solution**: Profile your startup time:
|
|
1015
|
+
|
|
1016
|
+
```bash
|
|
1017
|
+
vim --startuptime vim.log
|
|
1018
|
+
cat vim.log
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
Common causes:
|
|
1022
|
+
|
|
1023
|
+
- Too many plugins (consider lazy loading)
|
|
1024
|
+
- Network file systems (NFS, CIFS)
|
|
1025
|
+
- Complex `.vimrc` configurations
|
|
1026
|
+
|
|
1027
|
+
---
|
|
1028
|
+
|
|
1029
|
+
## References
|
|
1030
|
+
|
|
1031
|
+
- [Vim Official Website](https://www.vim.org/)
|
|
1032
|
+
- [Vim Official Documentation](https://www.vim.org/docs.php)
|
|
1033
|
+
- [Vim Download Page](https://www.vim.org/download.php)
|
|
1034
|
+
- [Vim GitHub Repository](https://github.com/vim/vim)
|
|
1035
|
+
- [Vim Win32 Installer](https://github.com/vim/vim-win32-installer)
|
|
1036
|
+
- [Homebrew Vim Formula](https://formulae.brew.sh/formula/vim)
|
|
1037
|
+
- [Chocolatey Vim Package](https://community.chocolatey.org/packages/vim)
|
|
1038
|
+
- [Vim on Ubuntu](https://packages.ubuntu.com/search?keywords=vim)
|
|
1039
|
+
- [Vim on Debian](https://packages.debian.org/search?keywords=vim)
|
|
1040
|
+
- [Vim Tutorial (vimtutor)](https://vimhelp.org/usr_01.txt.html)
|