I have VsVim and when I load my solution file, I always need to :set ignorecase and :set smartcase each time. I'd like to save these settings, but I can't find where VsVim stores its settings or how to save its settings.
This has recently changed:
https://github.com/jaredpar/VsVim/wiki/faq
How can I verify my .vimrc is loading?
There are 2 non-standard vim settings that can be used to diagnose potential .vimrc load issues
vimrc – This setting will display the full path of the file which was loaded for the .vimrc
vimrcpaths – This setting will display the files and paths searched for .vimrc
By default VsVim will look for a file named .vsvimrc, _vsvimrc, .vimrc or _vimrc file in the paths HOME, VIM and USERPROFILE
As of now the commands supported in the .vimrc file are limited to those supported in command mode.
Related
For the VimR OSX app, I want to change the default vim settings (like default colorscheme, or always having :set number), and read online that there's a vimrc file that should be changed, but for some reason I just can't find it on my computer.
Do you guys know where the vimrc (or whatever the vim config file is called) for VimR is?
Thanks!
VimR, (now?) tracking NeoVim, not Vim, isn't using ~/.vimrc by default any more:
User: I reinstalled VimR recently, and settings from my .vimrc are no longer loaded. Should I create some new dotfile and source .vimrc in it?
Author: NeoVim changed that: https://neovim.io/doc/user/nvim.html#nvim-from-vim
and to quote from the linked NeoVim docs:
Transitioning from Vim *nvim-from-vim*
To start the transition, create ~/.config/nvim/init.vim with these contents:
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config`
in the code above. Nvim follows the XDG |base-directories| convention.
I just did a clean (re)install of Vim (Downloaded from vim.org/download.php, used the gvim73_46.exe installer. Version is 7.3 (patches 1-46)
The only changes to my _vimrc are to set line numbers, lines, columns, and enable syntax.
Everytime I edit a file with vim, save it and close it (:wq), a new _viminfo file is created in that files directory.
Also, the backup *.*~ files and .swp files persist, and arn't cleared upon saving. Running Windows 7 enterprise.
This really clutters everything - and is a pain trying to open a file for which a .swp file exists..
Help?
disable viminfo file:
set viminfo="NONE"
disable swap file:
set noswf
disable backup :
set nobk
set nowb
more details:
:h 'swf'
:h 'bk'
:h 'wb'
:h 'viminfo'
That's strange; the viminfo file should be written in your home directory, nowhere else:
The default name of the viminfo file is "$HOME/.viminfo" for Unix and OS/2,
"s:.viminfo" for Amiga, "$HOME_viminfo" for MS-DOS and Win32. For the last
two, when $HOME is not set, "$VIM_viminfo" is used. When $VIM is also not
set, "c:_viminfo" is used. For OS/2 "$VIM/.viminfo" is used when $HOME is
not set and $VIM is set.
It appears as if your %HOME% variable (or the %HOMEDRIVE%%HOMEPATH%) isn't properly set.
When i use vim on windows, i realize that vim saves the file
and closing the vim window deletes a .ext.swp file amd a .ext~ file
How do i disable or delete these files as the duplicates are causing my problems
as i work on my host.
Turn off the vim swap files and backup files to disable the creation of these files:
:set noswapfile and :set nobackup.
See this question for more information.
When I open a file with vim or gvim from console on windows that is located in a sub directory (e.g. gvim subdir/file), it creates a new file at subdir\subdir\file saying "subdir\file" [New DIRECTORY] instead of simply opening the existing file at subdir\file.
This happens since I added the following line to my vimrc:
set enc=utf-8
Is there a possibility to open and create files in UTF-8 mode on Windows without this issue?
You may also look at my vimrc file.
Thank you for any help.
Change the order of the autochdir and encoding options in your vimrc. First set the encoding then autochdir
set enc=utf-8
set autochdir
An explanation can be found here
When I start GVim and start writing my little program I'd like to save the file to the Desktop but it seems that Vim is starting the command line in:
C:\Windows\System32
How would I go about changing that to:
C:\Users\Casey
so then I could just:
:w Desktop\my_program.py
Assuming you're starting gvim from an icon/shortcut in Windows (from the kind of paths you supply), you can change the starting directory (completely independent from the fact that it IS gvim: it would be the same from any other app!) by editing the "starting directory" property of that Windows icon/shortcut.
Within vim, you can change the current directory with the :cd command:
:cd c:\users\casey
I found this way to be better:
Open gVim
:cd $vim
:e _gvimrc
Add the following line:
:cd c:\users\user\desktop\
I found that :Ex is slow on large directories like c:\windows\system32\ (where gVim usually starts).
Also, here is my full _gvimrc in case anyone is interested. I prefer Consolas for coding. The tabstop setting helps when coding especially in Python, and Ctrl+Tab/Ctrl+Shift+Tab is great for switching between buffers:
set guifont=Consolas:h12:cANSI
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
map <C-Tab> :bnext<cr>
map <C-S-Tab> :bprevious<cr>
:cd c:\users\user\desktop\
How about changing your starting position?
vim icon -> right click -> property -> shortcut -> Start in -> your path you want to change.
but it works perfectly.
I think :cd yourpath also works. but it will change when you don't want to change.
Use :cd c:\users\casey,
after that save into session (in gVim there is button up and down in red, click on it and save as mySessionProject.vim). Next time you need to go to that directory, open that session (you can also use :source mySessionProject.vim)
for command line:
:mksession! yourdir/yourVimConfName.vim
to load
:source yourDir/yourVimConfName.vim
I found the following to be very useful. I am on Windows 7 and vim 7.3.46, and am using gVim.
I edited startup settings, which wound up altering the _vimrc in c:\Users\me\.
I also tried using :version and editing the _vimrc files I found at $VIM, as well as the _vimrc I found at c:\windows\system32.
Editing those files to include :cd c:\Users\me did not result in my default startup directory changing after starting vim. I wanted my default directory to be c:\Users\me\, and editing c:\Users\me\_vimrc achieved that. That is I entered
:e $MYVIMRC
and added
cd c:\Users\cnorton.Arlington1\
to that file.
Just to to put this up incase anyone needs it:
vimrc accepts enironmental parameters. you can put cd $USERPROFILE in your vimrc
Use this mapping in your .vimrc file
:cd $USERPROFILE\Desktop<cr>
or the same shorter
cd ~\Desktop<cr>
A mapping that also displays afterwards the path instead of the command
nmap <leader>d :cd ~\Desktop<cr>:pwd<cr>
Inside init.vim, I use:
lcd $HOME/Projects