A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

This is intended to be a vim turd file reference (please improve!)



 
 
Thread Tools Display Modes
  #1  
Old June 1st 17, 02:58 PM posted to alt.comp.os.windows-10,microsoft.public.windowsxp.general,alt.os.linux
Roy Tremblay
external usenet poster
 
Posts: 169
Default This is intended to be a vim turd file reference (please improve!)

Please add information so that this serves as a vim turd file reference.

Moving my vim setup over from Windows XP to Windows 10, I ran a few
experiments today trying to figure out how best to set up vim on Windows 10
so that the turd files it leaves (a) don't jump around, and (b) don't
clutter up the current directory.

0. https://s12.postimg.org/nezeiaxi5/00_gvim_setup.jpg
1. https://s13.postimg.org/heacohyfr/01_gvim_setup.jpg
2. https://s1.postimg.org/etb4r7nbj/02_gvim_setup.jpg
3. https://s24.postimg.org/4ubjqqo91/03_gvim_setup.jpg
4. https://s2.postimg.org/mxku3cuy1/04_gvim_setup.jpg
5. https://s18.postimg.org/6a1wh5t55/05_gvim_setup.jpg
6. https://s18.postimg.org/j11l1p4x5/06_gvim_setup.jpg
7. https://s29.postimg.org/auknub1uf/07_gvim_setup.jpg

0. Here are my _vimrc turd-file settings (also included below).
C:\apps\editor\txt\gvim\_vimrc
set directory=C:\\tmp\vim\directory//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
set backupdir=C:\\tmp\vim\backupdir//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
set undodir=C:\\tmp\vim\undodir//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
https://s12.postimg.org/nezeiaxi5/00_gvim_setup.jpg

1. The file simply exists (there are no turd files)
FILE = C:\data\test\foo.txt
swap turd = C:\tmp\vim\directory\{empty}
backup turd = C:\tmp\vim\backupdir\{empty}
undo turd = C:\tmp\vim\undodir\{empty}
https://s13.postimg.org/heacohyfr/01_gvim_setup.jpg

2. The file is opened for edit
A swap file is created in "directory", named C:%%data%test%foo.txt.swp
FILE = C:\data\test\foo.txt
swap turd = C:\tmp\vim\directory\C:%%data%test%foo.txt.swp
backup turd = C:\tmp\vim\backupdir\{empty}
undo turd = C:\tmp\vim\undodir\{empty}
https://s1.postimg.org/etb4r7nbj/02_gvim_setup.jpg

3. The swap file is a lock turd that contains crash-recovery information:
https://s24.postimg.org/4ubjqqo91/03_gvim_setup.jpg

4. The file is saved
A backup file is created in "backupdir", named foo.txt~
FILE = C:\data\test\foo.txt
swap turd = C:\tmp\vim\directory\C:%%data%test%foo.txt.swp
backup turd = C:\tmp\vim\backupdir\foo.txt~
undo turd = C:\tmp\vim\undodir\{empty}
https://s2.postimg.org/mxku3cuy1/04_gvim_setup.jpg

5. This backup is just a copy of the original file before any edits
https://s18.postimg.org/6a1wh5t55/05_gvim_setup.jpg

6. An edit is introduced
This creates an undo file in "undodir", named C%%data%test%foo.txt
FILE = C:\data\test\foo.txt
swap turd = C:\tmp\vim\directory\C:%%data%test%foo.txt.swp
backup turd = C:\tmp\vim\backupdir\foo.txt~
undo turd = C:\tmp\vim\undodir\C%%data%test%foo.txt
https://s18.postimg.org/j11l1p4x5/06_gvim_setup.jpg

7. The undo file contains undo changes
https://s29.postimg.org/auknub1uf/07_gvim_setup.jpg

Please improve so that this thread serves as a vim turd file reference.
(Note: Linux added as their users know vim rather well so they can help!)
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" My user edits are below this line (where doublequote starts a comment)
" The default vimrc is located at: " C:\Program Files (x86)\Vim\_vimrc
" Typing the ":version" command lists rc file locations.
" Vim settings are in _givmrc (which is always sourced)
" GVim settings are in _gvmrc (which is also sourced if the GUI is invoked)
" Using separate _vimrc & _gvimrc files avoids if-then-else clutter:
" if has("win32") || has("win64")
" set directory=$TEMP,. " swap filescurrent dir
" set backupdir=C:\temp,$HOME,. " backup files
" set undodir=C:\temp,$HOME,. " undo files
" endif
" if has("gui_win32") || has("gui_win64")
" syntax on
" colo desert
" set guifont=Consolas:h12
" endif
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" Given a file being edited that is named foo.txt, the defaults a
" .foo.txt.swap is a temporary swap file while editing (& lock/undo file)
" .foo.txt~ is a temporary backup of the original file before editing
" .foo.txt.un~ is a temporary undo file after editing
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" Default Windows temporary directories a
" Start Run %TMP% is C:\Users\usr1\AppData\Local\Temp
" Start Run %TEMP% is C:\Users\usr1\AppData\Local\Temp
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" Double trailing slashes make the otherwise centralized swap files use
" filenames that are based on the full pathname of the edited file
" (this prevents swap file name collisions when editing two files of the
" same name at the same time, e.g., README files)
" EXAMPLE: set directory=c:\\tmp//,c:\\temp//
" Comma-separated values sequence in case directories don't exist
" A dot (.) means the current directory of the file being edited
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" The "backupdir" is for backup files .foo.txt~
" The backup file is the last copy of the file as opened before new edits.
" Default vim behavior upon writing with "backup" turned on, is to "jump":
" a. Write the buffer to a new file name
" b. Delete the original file
" c. Rename the new file to the original file name
" With "nobackup", vim writes the buffer directly to the original file.
" set backup
" set nobackup
" set nowritebackup
set backupdir=C:\\tmp\vim\backupdir//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" The "directory" is for temporary swap files .foo.txt.swp
" Temporary swap files only exist during edits.
" The swap file is a lock file & a crash-recovery file.
" set swapfile
" set noswapfile
" set directory-=. (removes the directory from the sequence list)
set directory=C:\\tmp\vim\directory//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" The "undodir" is for undo files .foo.txt.un~
" set undofile
" set noundofile
set undodir=C:\\tmp\vim\undodir//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
Ads
  #2  
Old June 1st 17, 07:35 PM posted to alt.comp.os.windows-10,microsoft.public.windowsxp.general
J.O. Aho
external usenet poster
 
Posts: 130
Default This is intended to be a vim turd file reference (pleaseimprove!)

On 06/01/17 15:58, Roy Tremblay wrote:
Please add information so that this serves as a vim turd file reference.

Moving my vim setup over from Windows XP to Windows 10, I ran a few
experiments today trying to figure out how best to set up vim on Windows 10
so that the turd files it leaves (a) don't jump around, and (b) don't
clutter up the current directory.


(Note: Linux added as their users know vim rather well so they can help!)


We don't use it on microsoft infected machines, so there is no help we
can offer you, so please keep us out of you migration

  #3  
Old June 1st 17, 09:14 PM posted to alt.comp.os.windows-10,microsoft.public.windowsxp.general,alt.os.linux
Roy Tremblay
external usenet poster
 
Posts: 169
Default This is intended to be a vim turd file reference (please improve!)

Roy Tremblay actually wrote:

Moving my vim setup over from Windows XP to Windows 10, I ran a few
experiments today trying to figure out how best to set up vim on Windows 10
so that the turd files it leaves (a) don't jump around, and (b) don't
clutter up the current directory.


BTW, here is an example of the turd files jumping about by default:
https://s9.postimg.org/70klfzqgf/gvim_turd_files.gif
  #4  
Old June 1st 17, 09:14 PM posted to alt.os.linux,microsoft.public.windowsxp.general,alt.comp.os.windows-10
Roy Tremblay
external usenet poster
 
Posts: 169
Default This is intended to be a vim turd file reference (please improve!)

"J.O. Aho" actually wrote:

We don't use it on microsoft infected machines, so there is no help we
can offer you, so please keep us out of you migration


Are you sure vim isn't the "vi" that is included with most linux systems?
And that the dotfile setup is almost exactly the same?

Putting it bluntly, my research implies your statement is factually wrong.
Or am I wrong?

This says the vi on "most UNIX systems" is vim!
http://www.vim.org/

This says the default vi on Ubuntu is vim!
https://askubuntu.com/questions/1110...default#111022

Even if it's not the default Ubuntu editor, it's on Ubuntu for su
https://www.cyberciti.biz/faq/howto-...-ubuntu-linux/

This article says it's the top text editor on Linux:
Top 5 Best Linux Text Editors
http://www.thegeekstuff.com/2009/07/...x-text-editors

This article says vim is just a newer version of vi on Linux:
http://www.hostingadvice.com/blog/5-...editors-linux/

Linux.org also equates vim as a newer version of vi on Linux:
https://www.linux.org/threads/text-editors.4134/

This shows that VIM is on Redhat/Centos/Fedora & Debian/Ubuntu:
http://www.yolinux.com/TUTORIALS/Lin...vanced_vi.html

How can you claim, in the wake of that evidence, that most Linux "vi"
installations aren't just "vim" with an alias to vi?
  #5  
Old June 1st 17, 09:28 PM posted to microsoft.public.windowsxp.general,alt.comp.os.windows-10
Marek Novotny[_2_]
external usenet poster
 
Posts: 76
Default This is intended to be a vim turd file reference (pleaseimprove!)

On 2017-06-01, Roy Tremblay wrote:
"J.O. Aho" actually wrote:

We don't use it on microsoft infected machines, so there is no help we
can offer you, so please keep us out of you migration


Are you sure vim isn't the "vi" that is included with most linux systems?
And that the dotfile setup is almost exactly the same?

Putting it bluntly, my research implies your statement is factually wrong.
Or am I wrong?

This says the vi on "most UNIX systems" is vim!
http://www.vim.org/

This says the default vi on Ubuntu is vim!
https://askubuntu.com/questions/1110...default#111022

Even if it's not the default Ubuntu editor, it's on Ubuntu for su
https://www.cyberciti.biz/faq/howto-...-ubuntu-linux/

This article says it's the top text editor on Linux:
Top 5 Best Linux Text Editors
http://www.thegeekstuff.com/2009/07/...x-text-editors

This article says vim is just a newer version of vi on Linux:
http://www.hostingadvice.com/blog/5-...editors-linux/

Linux.org also equates vim as a newer version of vi on Linux:
https://www.linux.org/threads/text-editors.4134/

This shows that VIM is on Redhat/Centos/Fedora & Debian/Ubuntu:
http://www.yolinux.com/TUTORIALS/Lin...vanced_vi.html

How can you claim, in the wake of that evidence, that most Linux "vi"
installations aren't just "vim" with an alias to vi?


We can absolutely tell you whether vi is an alias to vim or not.

#!/bin/bash

################################################## ######################
#
# script: packinfo
# version: .01
# date: 2017-06-01
# by: Marek Novotny
# purpose: get package info
# : for debian, redhat and arch linux
#
################################################## ######################

app_name=$(basename $0)
prg_name=$1

if [ $# -ne 1 ]
then
echo "usage: $app_name {program name}"
exit 1
fi

report ()
{
printf "%${mtab}s %s \n" "Program name:" "$prg_name"
printf "%${mtab}s %s \n" "Location:" "$prg_path"
printf "%${mtab}s %s \n\n" "Package:" "${package:=none}"

for x in ${packinfo[@]} ; do
printf "$x \n"
done
}

get_package_info ()
{
# debian systems
dpkg -S $prg_path & /dev/null
if [ $? -eq 0 ] ; then
package="$(dpkg -S $prg_path | cut -d':' -f1)"

IFS=$'\n'
packinfo=($(dpkg -p $package))
let mtab=13
report
fi

# redhat systems
rpm -qf $prg_path & /dev/null
if [ $? -eq 0 ] ; then
package="$(rpm -qf $prg_path)"

IFS=$'\n'
packinfo=($(rpm -qi $package))
let mtab=13
report
fi

# arch systems
pacman -Qo $prg_path & /dev/null
if [ $? -eq 0 ] ; then
set -- $(pacman -Qo $prg_path)
while [ $1 != "by" ] ; do
shift
package="$2"
done

IFS=$'\n'
packinfo=($(pacman -Qi $package))
let mtab=17
report
fi
}

prg_path=$(which $prg_name 2 /dev/null)
if [ $? -eq 0 ] ; then
get_package_info
else
echo "not found..."
fi

## end ##

Now you can check for yourself if you're so inclined. We'd all
appreciate it if you'd keep your Windows bull**** off the linux group.
If you have a *linux* question feel free to ask in the *linux* group.
Otherwise, we're not interested.

--
Marek Novotny
https://github.com/marek-novotny

  #6  
Old June 1st 17, 09:41 PM posted to alt.os.linux,microsoft.public.windowsxp.general,alt.comp.os.windows-10
Roy Tremblay
external usenet poster
 
Posts: 169
Default This is intended to be a vim turd file reference (please improve!)

Marek Novotny actually wrote:

Now you can check for yourself if you're so inclined. We'd all
appreciate it if you'd keep your Windows bull**** off the linux group.
If you have a *linux* question feel free to ask in the *linux* group.
Otherwise, we're not interested.


I researched and lurked BEFORE I had asked the question and written the
tutorial to help others, like you often do.

So, respectfully, I have to say that the evidence shows that VIM is on
Linux in a very common way.

BTW, I respect you Marek, from lurking on a.o.l where I know your opinion
and code-writing help is always respected (I hope the warfarin is working
well as you had everyone scared for a few weeks a while ago when you
disappeared for a few months).

Respectfully, I note that you addressed "a" question, but not the key
question.

However, you didn't address the key question, which I very respectfully
repeat which is whether vim is on Linux, where you and J.O. Aho imply it's
not, but that's like denying that the sky is blue.

It seems overwhelimingly so that Vim is on Linux and, in fact, it's the
default vi editor on some Linux variants.

Is that not a true statement overall?

NOTE: I will set the followup to exclude a.o.l and I will NOT reply to
a.o.l again on this subject, so if you want to answer the basic question,
then it will have to be on the windows ng as you suggested we do.
  #7  
Old June 1st 17, 11:55 PM posted to alt.comp.os.windows-10,microsoft.public.windowsxp.general
Paul[_32_]
external usenet poster
 
Posts: 11,873
Default This is intended to be a vim turd file reference (please improve!)

Roy Tremblay wrote:
Roy Tremblay actually wrote:

Moving my vim setup over from Windows XP to Windows 10, I ran a few
experiments today trying to figure out how best to set up vim on Windows 10
so that the turd files it leaves (a) don't jump around, and (b) don't
clutter up the current directory.


BTW, here is an example of the turd files jumping about by default:
https://s9.postimg.org/70klfzqgf/gvim_turd_files.gif


Linux is available as a subsystem in Windows 10.

It's called the Bash shell, because it lacks Xorg on purpose.

You should be able to run vim from there if you want.

People have even run some version of Xorg from Windows 10
anyway (to give it a display subsystem), then installed
Linux Firefox and run Firefox from the Linux subsystem.

Since VIM looks like an ncurses program, you should
have no trouble running it in the Bash shell.

All your Windows drive letters are mounted in Bash,
so perhaps /mnt/C/foldername in Bash shell, is the same thing
as C:\foldername in Command Prompt. That was one detail that
wasn't apparent the first time I used it.

https://www.howtogeek.com/249966/how...on-windows-10/

If VIM isn't in the Bash shell in Windows 10, you
could do the usual sort of stuff. The Bash shell has
some sort of package manager, and the Ubuntu repository
is represented.

apt install vim

While you can "see" /mnt/C , you cannot use physical level
utilities. dd if=/dev/sda would not work, if C: was in
sda. That level of physicality is missing. Just the
virtual mounts are visible.

HTH,
Paul
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 04:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.