15 votes

How do you reload your .vimrc file without restarting vim?

Key mappings " Quickly edit/reload this configuration file nnoremap gev :e $MYVIMRC<CR> nnoremap gsv :so $MYVIMRC<CR> Completely automated solution To automatically reload upon save, ...
Tom Hale's user avatar
  • 2,430
14 votes

Creating ~/.vimrc disables syntax highlighting

Your system default vimrc no longer gets loaded when you create your own (and that's as it should be). You also won't get filetype based indenting and other things. The solution is to add these ...
Heptite's user avatar
  • 19.9k
14 votes

Creating ~/.vimrc disables syntax highlighting

Or you can move the content of your ~/.vimrc file to ~/.vim/plugin/CUSTOM_NAME.vim. Vim will automatically load your configurations (without touching any other defaults)
weshouman's user avatar
  • 243
12 votes

Splitting a single file into multiple windows on Vim

As has already been pointed out, you can use splits displaying the same buffer to get you most of the way there. :vsplit or :split As for displaying only a specific section of the file, one way of ...
Veen's user avatar
  • 121
10 votes

Change menu/ui language of vim to english

It works for me to simply add one line language en_US.utf8 at the top of .vimrc. Since en_US.utf8 is the output of you $ locale -a command, you should use language en_US.utf8 instead of ...
heyrict's user avatar
  • 101
8 votes

How can I make the Sign Column show up all the time even if no Signs have been added to it?

While the little dance defining a sign and placing it works ok, a more elegant alternative that works well for me is: autocmd BufRead,BufNewFile * setlocal signcolumn=yes And if there are certain ...
innaM's user avatar
  • 10.3k
7 votes

Vim: How to change the current item highlight color when substituting

When inside vim you can use the command mode: :highlight IncSearch guibg=green ctermbg=green term=underline To have it always, put this into your .vimrc: highlight IncSearch guibg=green ctermbg=green ...
p1100i's user avatar
  • 990
6 votes

Where should the .vimrc file be located on Windows 7?

Easiest way I found is to simply echo the location of the vimrc file currently in use - you can then replace with your own custom version. :echo $MYVIMRC
Patrick's user avatar
  • 161
5 votes
Accepted

Vim isn't recognizing my vimrc file

The problem you are experiencing is that in all RedHat distributions and their derivatives--including CentOS--/bin/vi is the "tiny"/"small" version of Vim which has very limited functionality. It ...
Heptite's user avatar
  • 19.9k
5 votes
Accepted

How to disable navigation keys in Vim?

You're right: it can be done by mapping those keys to nothing, or to be precise, to <Nop>. :nmap <Up> <Nop> :nmap <Down> <Nop> :nmap <Left> <Nop> :nmap <...
garyjohn's user avatar
  • 35.4k
4 votes

vim how to unmap [[

The @ in the output means the mapping is buffer local, and you have to unmap it as buffer local: :unmap <buffer> [[ See: :help :map-local :help map-listing
Heptite's user avatar
  • 19.9k
4 votes

Why does Option+Left Arrow work in Vim, but not Right Arrow on Mac OS X?

As of OS X Mojave 10.14.5, there is a much simpler solution: You actually don't need to change anything in mac preferences. After a lot of experimentation it appears that all you need to do is put :...
profPlum's user avatar
  • 149
4 votes

Vim: remove line numbers and colorcolumn from quickfix window

If you don't mind having an extra line in your ~/.vimrc instead: au FileType qf setlocal nonumber colorcolumn=
svlasov's user avatar
  • 163
4 votes

Why does VIM say there are trailing characters on this command?

You might have used # for comments inside .vimrc whereas you should use " instead. Example In this ~/.vimrc file, the first line is the right way: " Correct comment # Incorrect comment The ...
stevec's user avatar
  • 767
4 votes

Splitting a single file into multiple windows on Vim

This is a actually pretty straightforward, and thankfully doesn't need any configuration. Once you open up your file, run :vsplit or the keyboard shortcut <C-w>v which does the same thing. ...
DJMcMayhem's user avatar
  • 1,052
4 votes
Accepted

Source a vimrc from a webpage?

Vim ships with the netrw plugin, which enables transparent access of web (or SSH / FTP / etc.) resources, even for :source. $ vim -S http://foo.bar/myvimrc Note: You cannot use vim -u ..., because ...
Ingo Karkat's user avatar
  • 23.1k
4 votes

Change menu/ui language of vim to english

I've used different settings: language messages English_United States set langmenu=en_US.UTF-8 This worked for me. I added this at the top of _vimrc. I have Windows 10 in Korean, and gVim 8.0.586
HoJin's user avatar
  • 41
3 votes

Get rid of vim sidebar and top bar

I don't know much about Amix' vimrc, but I do know that that top bar looks like a tabline. It usually only shows up when there's more than one tab, but Amix' vimrc must set it to 2 (always show). To ...
NighttimeDriver50000's user avatar
3 votes

How can I test for plugins and only include them if they exist in .vimrc?

Initially posted in another question: https://stackoverflow.com/a/48178537/2843583 Just as an alternative you may also use a regexp to decide if the plugin at hand is in your runtimepath: if &...
bergercookie's user avatar
3 votes

Highlight the character the cursor is on in vim

switch to terminal mode :ter and then switch back to edit/ view mode. exit Automatically the cursor will be highlighted.
S A's user avatar
  • 131
3 votes

How to map ctrl/p clear cache and refresh NERDTree root node?

Refresh both CtrlP and NERDTree I use a custom key map to refresh both NERDTree and CtrlP: nmap <Leader>r :NERDTreeFocus<cr>R<c-w><c-p>:CtrlPClearCache<cr> I've mapped ...
Sheharyar's user avatar
  • 317
3 votes
Accepted

How can I Insert the result of a ".w" evaluation at the end of a line in Vim?

If your lines look like: 4+5= you could use something like: :map "_ay/=^Mo^[!!echo ^Ra \| bc^MkJ _ ............... to jump to start of actual line "ay/=^M ... to yank till = into buffer a o^[ ........
Horst's user avatar
  • 46
3 votes

How to make Vim "repeat search" direction absolute instead of relative?

Here is the solution to add into your .vimrc Based on this solution https://vi.stackexchange.com/a/2366 nnoremap <expr> n (v:searchforward ? 'n' : 'N') nnoremap <expr> N (v:searchforward ?...
Nicolas LIENART's user avatar
3 votes

How do I move all of my dotfiles to a custom directory?

vim predates the XDG spec, and doesn't follow it. You could override the path to the config file using the VIMINIT variable in your shell profile, according to https://tlvince.com/vim-respect-xdg I've ...
Neal Fultz's user avatar
3 votes

How do I move all of my dotfiles to a custom directory?

Since 7.3.1178 vim will search for ~/.vim/vimrc if ~/.vimrc is not found. $ cat "$XDG_CONFIG_HOME"/vim/vimrc set runtimepath^=$XDG_CONFIG_HOME/vim set runtimepath+=$XDG_DATA_HOME/vim set ...
test1696150's user avatar
2 votes
Accepted

How can I remove the dependency of having a `vimfiles` folder in windows?

Windows does not hide files and folders with names containing a leading dot. I can't recall why the decision was made to make the user-runtime directory vimfiles under Windows, but it was. Without ...
Heptite's user avatar
  • 19.9k
2 votes
Accepted

Get rid of vim sidebar and top bar

That side bar is most likely the 'foldcolumn', and you can get rid of it by doing: :set foldcolumn=0 If that doesn't work, try: :sign unplace * In the interest of completeness in my answer, I will ...
Heptite's user avatar
  • 19.9k
2 votes
Accepted

autocmd behaviour not as expected

The command :se hls turns on an option only. You will visually see nothing change. See: :help 'hlsearch' (The quotes are meant to be typed.) If what you are trying to do is get Vim to start ...
Heptite's user avatar
  • 19.9k
2 votes
Accepted

Vim: Error message on sourcing, but not on start up

There is an easy solution for this problem. Try and move the kolor.vim file to the ~/.vim/colors . Also, you don't really need to do changes to the runtime path. Vundles does it automatically for you. ...
Vinit Kumar's user avatar
2 votes
Accepted

Vim: How can I remap a key, but only when I combined it with a number?

You can do it this way: function! s:MoveAndCenter(motion) return a:motion . (v:count > 1 ? 'zz' : '') endfunction noremap <silent> <expr> j <sid>MoveAndCenter('j') noremap &...
Heptite's user avatar
  • 19.9k

Only top scored, non community-wiki answers of a minimum length are eligible