1. Introduction
The Importance of Vim on Ubuntu
On Ubuntu and other Linux distributions, Vim is one of the most important text editors available.
“Vim (Vi IMproved)” is, as its name suggests, an enhanced and extended version of the classic “vi” editor. It offers high-speed operation and flexible customization.
Because Vim is widely used for server administration, programming, and many other tasks in Linux environments, mastering Vim is a significant advantage for Ubuntu users.
Benefits of Using Vim
There are many advantages to installing and using Vim on Ubuntu.
The main benefits are summarized below.
- Lightweight and fast: Vim launches extremely quickly and runs smoothly even on low-spec systems.
- Highly customizable: By editing the configuration file (
.vimrc), you can build an editor environment tailored to your preferences. - Optimized for keyboard use: All operations can be completed using only the keyboard, dramatically improving productivity.
- Extensible with plugins: You can add features as needed and gradually evolve Vim into your ideal editor.
Purpose and Structure of This Article
The goal of this article is to help you “install Vim on Ubuntu and start using it effectively.”
In addition to installation steps, this guide explains basic configuration, how to set up a Japanese input environment, and how to troubleshoot common issues, all in a beginner-friendly, step-by-step manner.
If you are planning to start using Vim on Ubuntu, this article will guide you through a solid first step. Please read on until the end.
2. Installing Vim on Ubuntu
Checking Whether Vim Is Already Installed
On Ubuntu, a minimal version called “vim-tiny” may be preinstalled by default.
First, open a terminal and run the following command to check whether Vim is installed.
vim --versionIf Vim is installed, version information will be displayed.
If you see an error or notice that only a minimal version such as “vim-tiny” is installed, it is recommended to install the full version of Vim.
How to Install Vim
On Ubuntu, Vim can be easily installed using APT (Advanced Package Tool), the standard package management system.
Follow the steps below to install the latest version of Vim.
1. Update the package list
First, update the system’s package list to the latest state.
sudo apt update2. Install Vim
Next, install Vim.
sudo apt install vimThe required packages will be downloaded and installed automatically.
When prompted with “Do you want to continue? [Y/n]”, press Y and hit Enter.
Checking the Vim Version
After installation is complete, check the Vim version again.
vim --versionThe output includes the installed version number and build options such as +clipboard.
If +clipboard is enabled, you can copy and paste between Vim and the system clipboard, which significantly improves usability.
Optional: Installing Vim via the GUI Software Center (For Beginners)
If you are not comfortable using the terminal, you can also install Vim via Ubuntu Software (the Software Center).
- Launch “Ubuntu Software” from the application list
- Enter “Vim” in the search bar
- Select Vim from the results and click the “Install” button
This method allows you to install Vim intuitively without using command-line operations, making it ideal for Linux beginners.
3. Basic Vim Configuration
The Role of the .vimrc File and How to Create It
The configuration file used to customize Vim’s behavior is called .vimrc.
By writing settings in this file, they are automatically applied at startup, allowing you to create a more comfortable editing environment.
Typically, the .vimrc file is placed in the user’s home directory (~/.vimrc).
If the file does not exist, create it using the following command.
touch ~/.vimrcAfter creating it, open the file with Vim or any editor to edit it.
vim ~/.vimrcRecommended Basic Settings for Beginners
Below are some essential settings recommended for those who are new to Vim on Ubuntu.
Display line numbers
Line numbers are very useful when editing code or text.
set numberEnable syntax highlighting
This makes code easier to read by applying colors based on syntax.
syntax onAdjust indentation settings
This configuration standardizes indentation to four spaces, improving readability.
set tabstop=4
set shiftwidth=4
set expandtabIgnore case when searching
This setting allows searches to match text regardless of letter case.
set ignorecase
set smartcaseignorecase always ignores case, while smartcase becomes case-sensitive only when uppercase letters are included in the search term.
Saving and Applying Settings
After editing the .vimrc file, save it and restart Vim.
Vim loads .vimrc at startup, so closing and reopening the editor applies the settings.
You can also reload the configuration instantly by running the following command inside Vim.
:source ~/.vimrcThis is useful when testing configuration changes without restarting Vim.
4. Setting Up a Japanese Input Environment
Installing and Configuring a Japanese Input Method (IME)
To input Japanese text in Vim, a Japanese input method (IME) must be properly installed on Ubuntu.
Common options include “fcitx-mozc” and “ibus-mozc”. Below are two widely used methods.
Installing fcitx-mozc
Fcitx is a lightweight and fast IME framework widely used by Ubuntu users.
You can install Fcitx and the Mozc Japanese input engine with the following commands.
sudo apt update
sudo apt install fcitx-mozcAfter installation, change the keyboard input system to “fcitx” in the system’s language support settings.
Log out and log back in to activate Fcitx.
Installing ibus-mozc
If you prefer Ubuntu’s default input system, IBus, install Mozc using the following commands.
sudo apt update
sudo apt install ibus-mozcAfter installation, go to “Region & Language” in system settings, add “Japanese (Mozc)” as an input source, and the setup will be complete.
Important Notes When Using Japanese Input in Vim
Because Vim was originally developed for English-based environments, there are some important considerations when using Japanese input.
Differences in IME behavior by mode
Vim has a “Normal mode” and an “Insert mode.”
Japanese input is generally needed only in Insert mode.
If the IME is active in Normal mode, it may cause unintended command execution. Being mindful of switching IME states by mode can improve workflow efficiency.

Compatibility issues between Vim and IME
In some Ubuntu environments, IME may not work properly within Vim.
In particular, terminal-based Vim may fail to display the candidate window correctly, depending on the environment.
In such cases, using the GUI version of Vim (e.g., gvim) or adjusting settings such as fonts and encoding may resolve the issue.
Configuring IME Shortcut Keys
Setting shortcut keys for switching between Japanese and English input improves efficiency.
For example, when using Fcitx, follow these steps.
- Open the Fcitx configuration screen
- Select the “Global Config” tab
- Set the input method toggle key to your preferred key (e.g., the Half-width/Full-width key)
This allows quick switching between Japanese and English input across all applications, including Vim.
5. Creating a More Comfortable Vim Environment
Recommended Plugins
Vim is powerful even with its default features, but plugins can further enhance comfort and efficiency.
Below are some especially recommended plugins for Vim on Ubuntu.
vim-airline
vim-airline enhances Vim’s status line with a clean and informative design.
It displays information such as file name, line number, and encoding at a glance, improving productivity.
Installation example:
Plug 'vim-airline/vim-airline'nerdtree
nerdtree displays a file tree inside Vim.
It allows you to visually navigate directory structures like a GUI editor, which is especially useful for large projects.
Installation example:
Plug 'preservim/nerdtree'To launch NERDTree, use the following command.
:NERDTreeToggleInstalling a Plugin Manager (vim-plug)
Using a plugin manager makes it easier to manage multiple plugins.
Here, we introduce “vim-plug”, a simple and popular choice.
How to Install vim-plug
- Download and place vim-plug.
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim- Add the plugin list to
.vimrc.
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'preservim/nerdtree'
call plug#end()- Launch Vim and run the following command.
:PlugInstallThe configured plugins will be installed automatically.
Improving Cursor Movement During Japanese Input
When typing Japanese, cursor movement may feel sluggish or unstable.
There are several ways to improve this behavior.
Automatic IME on/off by Vim mode
Automatically toggling IME based on Vim mode helps prevent accidental input and enables smoother Japanese typing.
This can be achieved using plugins such as “fcitx.vim”.
Using skkeleton (for Neovim)
For Neovim users, the Japanese input plugin “skkeleton” has gained attention.
It allows native Japanese input control inside Vim, providing a very smooth editing experience.
6. Troubleshooting
If Vim Does Not Start or Displays Errors
After installing Vim, you may encounter startup errors or find that Vim does not start at all.
Common causes include the following.
- Dependency packages were not installed correctly
- Errors in the
.vimrcconfiguration file - Permission issues preventing required files from being read
How to Resolve
- First, confirm that Vim is installed correctly.
vim --version- If installation issues are suspected, uninstall and reinstall Vim.
sudo apt remove vim
sudo apt install vim- If
.vimrcis causing issues, you can start Vim while ignoring the configuration file.
vim -u NONEIf Vim starts normally, review the contents of your .vimrc.
If Japanese Input Does Not Work
On Ubuntu, Japanese input issues may occur not only in Vim but system-wide.
Because Vim depends on proper IME integration, check the following points.
- Is your IME (fcitx or ibus) running correctly?
- Is Japanese input enabled in system settings?
- Are font and encoding settings correctly configured in the terminal?
If terminal-based Vim does not work well, using the GUI version (gvim) may help.
Checklist When Settings Are Not Applied
If changes in .vimrc are not reflected, check the following items.
- Is the
.vimrcfile in the correct location?
- Expected path:
~/.vimrc
- Is the file name correct?
- Ensure correct capitalization (use
.vimrc, not.Vimrc).
- Are there any syntax errors?
- Even a single typo can invalidate a Vim command.
- Did you restart Vim after saving the file?
- Alternatively, apply changes immediately using the following command.
:source ~/.vimrcFollowing this checklist resolves most configuration issues.
7. Conclusion
Steps to Start Using Vim on Ubuntu
In this article, we covered the entire process of using Vim on Ubuntu—from installation and basic configuration to Japanese input setup, plugin usage, and troubleshooting.
In summary, you can start using Vim by following these steps.
- Install Vim via the terminal or Ubuntu Software
- Create a
.vimrcfile and apply basic settings such as line numbers and syntax highlighting - Install fcitx-mozc or ibus-mozc to enable Japanese input
- Enhance productivity with plugins like vim-airline and nerdtree
- Troubleshoot startup or Japanese input issues as they arise
By following these steps, even beginners can comfortably use Vim on Ubuntu.
Next Steps: Taking Vim Further
This guide covers only the first step of using Vim.
Thanks to its deep customization and powerful features, Vim becomes more rewarding the more you learn.
As next steps, consider exploring the following topics.
- Automation using Vim scripts (VimL)
- Advanced programming support with LSP (Language Server Protocol)
- Migrating to Neovim and leveraging its extended ecosystem
- Optimizing writing workflows with seamless Japanese and English switching
Enjoy the process of building your own ideal editor environment.


