I am using gvim on windows. And while editing the _vimrc file I want to reload them immediately to see the change. How can I do it?
To refresh your _vimrc whilst you are editing it, just use
:so %
which is the shortened form of saying
"Source current file".
This will instantly apply your current vimrc but keep in mind that sourcing a new vimrc doesn't undo the effect of the old vimrc in your already open vim sessions.
Related
How do I force open my .vimrc?
I recently made a modification, not certain exactly what I did, but I think I accidentally typed an "x" in my plugins when trying to close. Suddenly neither vim or .vimrc will open.
I get a pause, several blank lines, and then terminal just returns to default command line.
Use vim -u NONE .vimrc to skip reading all startup files and edit .vimrc.
I have got a .vimrc file from one of my friends, however, vim ignores it. How can I make vim use .vimrc? Thank you for the answer.
Open vim and type ":version" and hit Enter. You will get paths to your vimrc files. Make sure that your vimrc file is not overwritten by another one (with a higher priority). Please refer to Open vimrc file.
EDIT: To see a home directory, type in vim :echo $HOME
This question already has answers here:
No vimrc, gvimrc and .vim on mac
(3 answers)
Closed 8 years ago.
I'm using Mac OSX (10.9) and I'm trying to configure my vimrc file by adding "set number". I found my vimrc file in user/share/vim/ but I can't edit it because it's read-only. How can I fix this and read it?
You should not overwrite the system vimrc for various reasons. One being that with a system upgrade it will be overwritten.
Instead you can create a new .vimrc file in your home directory. Open the terminal and enter:
vim ~/.vimrc
There you can enter your various configurations. When done, you need to save the file and restart vim.
To be sure which vimrc is being used, you can ask inside of vim by typing:
:echo $MYVIMRC
I'm trying to add Pydiction into MacVim, I followed the readme file.
Put python_pydiction.vim in ~/.vim/after/ftplugin/ and write:
let g:pydiction_location = '~/pydiction/complete-dict'
into my .vimrc file. But when I press tab in MacVim, an error will rise:
undefined variable g:pydiction_location
Can anyone tell me where am I wrong ?
As discussed in the comments, you were editing a file that wasn't actually your .vimrc file. You may have typed:
:e vimrc
:e ~/vimrc
:e .vimrc
none of which will probably edit your actual .vimrc file. It must have a dot in front of it AND be located in your home directory. You can also type :pwd in vim to see the current working directory. If you do :e .vimrc it will create a new file in whatever directory you are in if it doesn't exist.
Do you use NERDTree? If so it seems that Pydiction and NERDTree conflict with each other in some way.
I have a very simple and easy question, but I do not know how to do it. I am on a ubuntu machine, logged in via ssh. I want to edit my vim so that I dont have to keep typing :set number or :colorscheme elflord. I would like it to remember that information. When browsing around I found out that I need to change a .vimrc file, and that is supposedly located in my home directory, however it is not, and furthermore #locate .vimrc does not locate anything. Can any help me with finding where this file is and editing the above commands?
Create ~/.vimrc with the lines you want in it:
set number
colorscheme elflord
See :help vimrc and :help vimrc-intro for more information.
Your global vimrc is located in /etc/vim you can just create a .vimrc in your home directory. This question however should be asked on http://unix.stackexchange.com or http://askubuntu.com.
You may edit it from anywhere with this command:
:e $MYVIMRC
If the file doesn't exist, just create it in ~/.vimrc