How to display the name of a Vim file?

How to display the name of a Vim file?

These commands can go in your .vimrc file, or you can enter them as commands while in vim by typing ‘:’ in command mode. Then set status line to %f for short file name. For the full path to the file, use %F. :set title to display file name in window title bar.

Is there way to always show menu bar in Vim?

To always show this menu-bar, use Although this makes only sense when you really want to work with tabs (I can recommend it). Otherwise I’d suggest to set the name in the statusbar as outlined by others. Also check out vim-airline. Note that you still have to use “set laststatus=2” show the status line.

How to get the name of the current file?

In insert mode, type Ctrl-R then % to insert the name of the current file. In command mode (after typing a colon), type Ctrl-R then % to insert the name of the current file.

When to set syntax for an extension in Vim?

You probably don’t want to set the syntax every time you open a file with an extension vim doesn’t recognize, though, so here’s an example of how to set the syntax automatically in such cases. Say you have a JSON file you designed for storing information about your meals to monitor your health whose extension is “.meals”.

What do you mean by syntax coloring in Vim?

You mean vim/vim61/syntax. The ftplugin files contain such things as useful mappings for editing certain filetypes, not syntax colouring. Something that is also very useful for PHP programmers: Sometimes, when you are at a particular place in a file, the Vim buffer “forgets” what the highlighting should be, PHP or HTML.

Is there a way to set indentation in Vim?

While you can configure Vim’s indentation just fine using the indent plugin or manually using the settings, I recommend using a python script called Vindect that automatically sets the relevant settings for you when you open a python file. Use this tip to make using Vindect even more effective.