Hiding Vim .ext~ files in Windows - windows

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.

Related

Launching Vim with a file as argument does not work, if my .vimrc contains a `:cd` command

If I launch Vim from powershell/cmd with a file (e.g gvim myfile.txt) it will open a empty buffer or if the file exist the wrong one. I tracked it down to the first line of my .vimrc
cd c:\myUsualFolder
If this line is removed everything works fine.
Does anyone has an idea how to keep the change directory part while opening the right file as well?
About my system: windows 10; vim version 8.0.586

Vim inserting _viminfo files after every save

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.

VsVim settings save file

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.

Vim. Troubles with encoding on file saved in windows

I have ��� chars after each time I save file in windows for some folders. And for some other folders - all is fine. I can't find difference between folders where everything is fine and folders where files saving with bad endings. So I have to run dos2unix in my linux virtual machine on modified files every time. Since these files is javascript - it's very annoying!
Help me, where to dig? How to avoid appearing of ��� chars at the end of file?
:set fileencoding=utf-8 does not help.
Usually vim has for dos files - [dos] label at the bottom of buffer window - in my case all is fine, and no [dos] label there.
This looks more like a file format problem than encoding. I recommend adding this to your ~/_vimrc:
set fileformat=unix
set fileformats=unix,dos
set nobinary
You can find more details in :help fileformat

Vim opens a new folder instead of an existing file with `set enc=utf-8` enabled

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

Resources