Upgrading Vim on Mac OS X. Ask Question. I love how easy it is to move around and edit code. I can only imagine what it will be like when I really feel comfortable with it. And I don't want to install via MacPorts/HomeBrew/Whatever. I want Vim 7.3 from source. I've only just entered the world of Unix and having already bricked my.
The vim text editor, a standard tool included on Linux and macOS, can quickly encrypt text files with a password. It’s faster and more convenient than encrypting a text file with a separate utility. Here’s how to set it up.
Make Sure Your System’s Vim Has Encryption Support
Some Linux distributions, including Ubuntu, include a minimal version of vim by default, intended only for basic text editing. For example, Ubuntu calls this package “vim-tiny”. If you try to use encryption in such a minimal version of vim, you’ll see a “Sorry, this command isn’t available in this version” message.
You may need to install the full version of vim to get this feature on your Linux distribution. For example, on Ubuntu, you can get the full version of vim that by running the following command:
The version of vim included by default with macOS does include encryption support, so you don’t need to install anything else on a Mac. Just launch a terminal window from Finder > Applications > Utilities > Terminal and the commands will work the same on macOS as they do on Linux.
How to Encrypt a File With a Password
RELATED:A Beginner’s Guide to Editing Text Files With Vi
The basic process is relatively simple if you know how to use vi. If you don’t, you might get hung up on vi’s modal interface. When you open a text file in vim, there are two modes. By default, you’re in a “command mode” where you can use the keys on your keyboard to perform commands. You can also press “i” to enter “Insert mode”, where you can type normally and move the cursor around with the arrow keys, as you would in other text editors. To leave insert mode, press “Esc” and you’ll be back to command mode.
First, launch vim. For example, the following command will launch vim and point it at a file named “example” in the current directory. If that file doesn’t exist, vim will create a file named “example” in the current directory when you save it:
You can also point vi at another path with a command like the below one. You don’t have to create a file in the current directory.
Edit the file normally. For example, you can press “i” to enter insert mode and then type text normally. While editing a file, press Esc to ensure you’re in command mode and not insert mode. Type :X
and press Enter.
You’ll be prompted to enter a password, which the text file will be encrypted with. Type the password you want to use, press Enter, and type it again to confirm. You’ll need to enter this password any time you want to open the file in the future.
Vim will warn that you’re using a weak encryption method by default. We’ll show you how to use a more secure encryption method later.
A password will be associated with the current text file in Vim, but you’ll need to save your changes before the password is actually assigned to the file. To do this, press Esc to ensure you’re in command mode, and then type :wq
and press Enter to write the file to disk and quit Vim.
The next time you attempt to open the file in Vim—for example, by running “vi example
“—Vim will ask you for the password associated with the file.
If you enter the wrong password, the contents of the file will be gibberish.
Warning: Don’t save the file if you open it and see gibberish. This will save the corrupted data back to the file and overwrite your encrypted data. Just run :q
to quit Vim without saving the file to disk.
There’s one other shortcut you can use here. Rather than creating or opening a file with “vim /path/to/file
“, you can run the following command to have vim create or open a file and make it immediately prompt you to encrypt the file with a password:
Note that you need to use a lower-case x here, while you need to use an upper-case X when running the associated encryption command from inside Vim.
How to Enable Stronger Encryption in Vim
By default, Vim uses very bad encryption for these files. The default “zip” or “pkzip’ encryption method is backwards compatible with versions 7.2 and below of vim. Unfortunately, it can be cracked very, very easily—even on hardware from the 90’s. As the official documentation puts it: “The algorithm used for ‘cryptmethod’ “zip” is breakable. A 4 character key in about one hour, a 6 character key in one day (on a Pentium 133 PC).”
You should not use pkzip encryption for your text documents if you want any security at all. However, Vim provides better encryption methods. Version 7.3 of Vim released in 2010 added a “blowfish” encryption method, which is better. Version 7.4.399 released in 2014 included a new Blowfish encryption method that fixes security problems in the original “blowfish” encryption method, and dubs it “blowfish2”.
The only problem is that files you create with stronger encryption methods require these newer versions of Vim. So, if you want to use “blowfish2” encryption, you’ll only be able to open that file with Vim versions 7.4.399 and above. As long as you’re fine with that, you should use the strongest encryption method possible.
To check which encryption method a file is using, open the file in vim, press the Esc key to ensure you’re in command mode, type the following command, and press Enter.
The “cm” here stands for “cryptmethod”.
You’ll see the encryption method used for the current file displayed at the bottom of the vim screen.
To choose an encryption method, run one of the following commands. The “blowfish2” encryption is best for security.
Once you’ve selected your encryption algorithm, use the :w
command to write the file to disk or the :wq
command to write the file to disk and quit.
The next time you re-open the file in Vim, it won’t complain about a weak encryption algorithm. You’ll also see the encryption algorithm you selected at the bottom of the vim screen when you open the file.
How to Change or Remove a Password
To remove a password from a file, open that file in Vim and run the :X
command. You’ll be prompted to provide a new encryption key. Enter the new password you want to use here. To remove the password completely, leave the password field blank and just press Enter twice.
Save the file and quit afterwards with :wq
. The file will be decrypted, so you won’t be prompted to enter a password when you open the file in the future.
Be sure to remember whatever password you set or you won’t be able to access the contents of the file in the future.
READ NEXT- › How to Use Pipes on Linux
- › Why Does USB Have to Be So Complicated?
- › What Should You Do If You Receive a Phishing Email?
- › Why Do You Have to Log In to Your Home PC, Anyway?
- › The Best New Features in Android 10, Available Now
MS-Windows: | Click this link to download the self-installing executable(using ftp). |
Unix: | See the GitHub page, or Mercurial, if you prefer that. |
Mac: | See the MacVim project |
Details and options for:
Mirrors | Alternative sites to download Vim files from. |
Sources | Build Vim yourself and/or make changes. |
GitHub | Obtain Vim sources with a git client (recommended). |
Mercurial | Obtain Vim sources with a Mercurial client(recommended if you don't like git). |
Patches | Include the latest improvements (requires sources and rebuilding). |
Runtime | Get the latest syntax files, documentation, etc.. |
Script links | Links to individual syntax, indent, color, compiler and ftplugin scripts. |
Translations | Non-English documentation packages. |
Versions before 7.3 can also be obtained withSubversionandCVS.Vim 8.1 is the latest stable version. It is highly recommended, many bugs have been fixed since 7.4 and earlier.If you have a problem with it (e.g.,when it's too big for your system), you could try version 6.4 or 5.8 instead.
To avoid having to update this page for every new version, there arelinks to the directories. From there select the files you want to download.In the file names ## stands for the version number. For example,vim##src.zipwith version 8.1 is vim81src.zip andvim-##-src.tar.gz for version 8.1is vim-8.1-src.tar.gz.Links are provided for quick access to the latest version.
Note that the links point to the latest version (currently 8.1) to avoidthat caching causes you to get an older version.
You need to download at the sources and the runtime files.And apply all the latest patches.For Vim 6 up to 7.2 you can optionally get the 'lang' archive, which adds translated messages and menus. For 7.3 and later this is included with the runtime files.
The explanations are on this page:GitHub
Summary:
The explanations are on this page:Mercurial
Summary:
The detailed explanation can be foundhere.This does require Python and installing Aap. Please report problems to Bram ATa-a-p.org.
How To Install Vim Editor In Mac
The runtime and source files together: | vim-##.tar.bz2 | vim-8.1.tar.bz2 (ftp) |
The language files. | vim-##-lang.tar.gz | vim-7.2-lang.tar.gz (ftp) |
The runtime and source files together: | vim-##.tar.bz2 | vim-6.4.tar.bz2 (ftp) |
The runtime files part 1: | vim-##-rt1.tar.gz | vim-6.4-rt1.tar.gz (ftp) |
The runtime files part 2: | vim-##-rt2.tar.gz | vim-6.4-rt2.tar.gz (ftp) |
The source files part 1: | vim-##-src1.tar.gz | vim-6.4-src1.tar.gz (ftp) |
The source files part 2. | vim-##-src2.tar.gz | vim-6.4-src2.tar.gz (ftp) |
The language files. | vim-##-lang.tar.gz | vim-6.4-lang.tar.gz (ftp) |
The runtime files: | vim-##-rt.tar.gz | vim-5.8-rt.tar.gz |
The source files: | vim-##-src.tar.gz | vim-5.8-src.tar.gz (ftp) |
The single big file ending in '.tar.bz2' is a tar archive compressed withbzip2. Uncompress and unpack it withbunzip2 -c filename | tar -xf -.
All archives should be unpacked in the same directory.
If you can't compile yourself or don't want to, look at the site of thesupplier of your Unix version for a packaged Vim executable. For Linuxdistributions and FreeBSD these are often available shortly after a new Vimversion has been released. But you can't change the features then.
- Debian packages are available at:http://packages.debian.org/vim.
- Sun Solaris Vim is included in the Companion Software:http://wwws.sun.com/software/solaris/freeware/.
Vim for other Sun systems can be found athttp://sunfreeware.com/. - HPUX with GTK GUI for various HPUX versions:http://hpux.its.tudelft.nl/hppd/hpux/Editors/vim-6.2/ orhttp://hpux.connect.org.uk/hppd/hpux/Editors/vim-6.2/ (note that the remark about the GNU GPL is wrong)
gvim81.exe (ftp)
It includes GUI and console versions, for 32 bit and 64 bit systems.You can select what you want to install and includes an uninstaller.
If you want the most recent improvements, with a small risk that something isbroken, you can get the nightly build from
vim-win32-installer
It supports many interfaces, such as Perl, Tcl, Lua, Python and Ruby.
A 64 bit version, which only runs on 64 bit MS-Windows and uses a lot more memory, but is compatible with 64 bit plugins, can be foundhereYou can also find links to interfaces to install there (Python, Perl, Ruby, etc.).
For the latest version with all patches included see Creambelow. These versions are unofficial, but the download numberis high and complaints are few.
Since there are so many different versions of MS operating systems, there areseveral versions of Vim for them.
For Vim 5.x, Vim 6.x and Vim 7 look inthe pc directory (ftp).
- Self-installing executable gvim##.exe gvim81.exe (ftp)
- For Vim 6 and later. This includes a GUI versionof Vim - with many features and OLE support - and all the runtime files.It works well on MS-Windows 95/98/ME/NT/2000/XP/Vista/7.Use this if you have enough disk space and memory. It's the simplest way tostart using Vim on the PC. The installer allows you to skip the parts youdon't want.
For Vim 6.3 and later it also includes a console version, both for MS-Windows 95/98/ME and MS-Windows NT/2000/XP/Vista/7. The installer automatically selects the right one.
- Runtime files vim##rt.zip vim81rt.zip (ftp)
- For all the following binary versions you need this runtime archive, whichincludes the documentation, syntax files, etc. Always get this, unless youuse the self-installing executable.
There are three versions that run as an MS-Windows application. These providemenus, scrollbars and a toolbar.
- GUI executable gvim##.zip gvim81.zip (ftp)
- This is the 'normal' GUI version.
- OLE GUI executable gvim##ole.zip gvim81ole.zip (ftp)
- A GUI version with OLE support. This offers a few extra features,such as integration with Visual Developer Studio. But it uses quite a bitmore memory.
- Win32s GUI executable gvim##_s.zip gvim73_46_s.zip (ftp)
- GUI version for Windows 3.1 with win32s support. (Not available for Vim 6.2, 6.3 and 7.4 and later)
A true Windows 3.1 version can be found here:http://www.bulbous.freeserve.co.uk/vim16.html
- 16 bit DOS executable vim##d16.zip vim71d16.zip (ftp)
- The 16 bit DOS version is the only one that runs on old MS-DOS systems. Onlyuse this if you are really desparate, because it excludes many useful features(such as syntax highlighting and long file names) and quickly runs out ofmemory.
The last version available is 7.1. Version 7.2 and later are too big to fit in the DOS memory model. - 32 bit DOS executable vim##d32.zip vim73_46d32.zip (ftp)
- The 32 bit DOS version works well on MS-Windows 95/98/ME. It requires a DPMImanager, which needs to be installed on MS-DOS. MS-Windows already has one.It supports long file names, but NOT on MS-Windows NT/2000/XP/Vista/7. It is compiled with 'big' features.
Not available for 7.4 and later. - Win32 console executable vim##w32.zip vim81w32.zip (ftp)
- The Win32 console version works well on MS-Windows NT/2000/XP/Vista/7. It supports long file names and is compiled with 'big' features. It does not runperfectly well on MS-Windows 95/98/ME, especially when resizing the consolewindow (this may crash MS-Windows...).
- iconv librarylibiconv
- A library used for converting character sets.Put 'iconv.dll' in the same directory as gvim.exe to be able to edit files inmany encodings. You can find the dll file in the bin directory of the'libiconv-win32' archive.
- newer intl librarylibintl
- The included libintl.dll does not support encoding conversion.If you have installed the iconv library, as mentioned above, you can install agettext library that uses it.Get 'intl.dll' from the bin directory in the gettext-win32 archive and store itas 'libintl.dll' in the same directory as gvim.exe, overwriting the filethat may already be there.
- PC sources vim##src.zip vim81src.zip (ftp)
- The source files, packed for the PC. This only includes the files needed onthe PC, not for other systems. The files are in dos format CR-LF.
- PC debug files gvim##.pdb gvim81.pdb (ftp) gvim##ole.pdb gvim81ole.pdb (ftp) vim##w32.pdb vim80w32.pdb (ftp)
- When you notice a bug or a crash in Vim these files can be used to help tracing down the problem. In Vim 7 do ':help debug-win32' to see how.
- PC translations vim##lang.zip vim72lang.zip (ftp)
- Only for 7.2 and earlier, for 7.3 and later these are included in the 'rt' archive.Translated messages and menu files, packed for the PC. Use this to seenon-English menus. The messages are only translated when the libintl.dlllibrary is installed.
- Windows 3.1 GUI executable gvim##w16.zip and gvim##m16.zip
- These are GUI versions for 16 bit windows (Windows 3.1). The 'w16' has manyfeatures, 'm16' has few features (for when you're short on memory).
Alternate distributions
- Cream
- For an unofficial version that does include all the latest patches andoptionally a bitmore: Cream.The 'one-click installer' mentioned includes the Cream changes.For the 'real Vim' use the 'without Cream' version listed further down.
- Yongwei's build
- You may also try Yongwei's build,executables with slightly different interfaces supported.
- Cygwin
- For a Cygwin binary look at others.
- Win64
- The 32-bit version of Vim runs fine on 64-bit windows.There was a 64-bit binary, but it wasn't used much and maintenance stopped.
For Vim 5.x and Vim 6 look inthe amiga directory (ftp).
Vim 7 files can be found atos4depot.net. This is for AmigaOS 4. Made by Peter Bengtsson.
- Runtime files vim##rt.tgz vim64rt.tgz (ftp)
- Documentation, syntax files, etc. You always need this.
- Executable vim##bin.tgz vim64bin.tgz (ftp)
- The executables for Vim and Xxd.For Vim 6 it includes 'big' features, for Vim 5.x itincludes the normal features.For Vim 6.2 it is not available (my Amiga had harddisk problems then, this miraculously healed later).
- Big executable vim##big.tgz
- Vim with 'big' features and Xxd. Only for Vim 5.x.
- Sources vim##src.tgz vim64src.tgz (ftp)
- The source files for the Amiga.Only needed when you want to compile Vim yourself.
For Vim 5.x and Vim 6 look inthe os2 directory (ftp).Version 6.2 is not available.Versions 6.3 and 6.4 were compiled by David Sanders.
Version 7.0 was compiled by David Sanders.
- Runtime files vim##rt.zip vim70rt.zip (ftp)
- Documentation, syntax files, etc. You always need this.
- Executables vim##os2.zip vim70os2.zip (ftp)
- Vim, Xxd, Tee and EMX libraries.
If you want to compile the OS/2 version, you need the EMX compiler. Use theUnix source archive, runtime files and the extra archive. After unpacking theruntime archive, move all the files and directories in the 'runtime'directory one level up.
The Macintosh binaries are not on the Vim ftp site. They are produced by a fewMacintosh lovers. Often they lag behind a few versions.Since MacOS 10.3 the 'vi' program is actually a console version of Vim 6.2 or later. It has few features. If you want a GUI version or more features Vim needs to be installed separately.
There are currently two kinds of Vim for Macintosh:
- Using the Cocoa GUI. Also known as MacVim. This is the latest and is being actively developed. This behaves like a Mac application.
- Using the Carbon GUI. This is an older way of doing things and isn'tupdated much any more. This behaves more like Vim on Unix.
Cocoa (MacVim)
MacVim has more a Mac look and feel, is developed actively and most peopleprefer this version. Most of MacVim was made by Björn Winckler.
MacVim can be downloaded here: https://github.com/macvim-dev/macvim
New versions are made quite often.Subscribe to thevim-mac maillistto be informed about bugs and updates.
Carbon
Recent binaries for Mac OS/X can be found on thisSourceForge project.Maintained by Nicholas Stallard.
Others
There is also a version for Mac OSX that works in a terminal window and a GUIversion for X11 with GTK (produced by Marc Liyanage):
http://www.entropy.ch/software/macosx/welcome.html#vim
Here is a multi-byte version of Vim 5.7 (for Japanese, possibly also forKorean and Chinese; not for Unicode):
http://www-imai.is.s.u-tokyo.ac.jp/~asai/macvim-e.html
Most of the work forthe Macintosh port (Classic and Carbon) was done by Dany St-Amant.
If you have OSX and a setup for compiling programs, you can use the Unix andExtra source code archives and compile yourself. See the Unix sectionabove.The development tools can be downloaded from Apple's developer web site.Hint: stuffit expander can handle .bz2 files.Turn to the vim-mac maillist to meet otherVim-Mac users.
This is a list of links to sites where various versions of Vim can be obtained.These are supported by individuals, use at your own risk.Android | Search for 'Vim Touch' by Momodalo in the Play Store. |
i/OS | Run Vim on your iPhone or Ipad. |
QNX (ftp) | Provided by Yakov Zaytsev. Requires QNX 6.3.0/6.3.2 with service pack 2. |
Agenda | http://pi7.fernuni-hagen.de/hartrumpf/agenda/vim/vim.vr3 |
Cygwin (with GTK GUI) | http://lassauge.free.fr/cygwin/ |
Open VMS | http://www.polarhome.com/vim/ |
MorphOS | http://www.akcaagac.com/index_vim.html |
How To Install Vim On Linux
TOP