How to update Vim under Cygwin - vim

Vim behaves weirdly under Cygwin. I follow this instruction and realize that in my /bin there's only vi.exe, no vim.exe! So I put the .vimrc example from Vim Wiki into a .virc in home directory. When I run vi, I get the following error:
Error detected while processing /home/USER/.virc:
line 21:
E319: Sorry, the command is not available in this version: filetype indent plugin on
line 24:
E319: Sorry, the command is not available in this version: syntax on
line 113:
E538: No mouse support: mouse=a
My question is:
How do I update vi to avoid the above errors?
Is it necessary to install a vim.exe? If it is, how can I do that (under Cygwin) ?
Thanks

Go back and run the CygWin setup.exe again and ensure you install absolutely everything (a) rather than just the defaults.
Disk space is cheap, time spent trying to figure out which package various things are in (b) is not :-)
(a) You do this by clicking on the "tail chasing arrows" at the top level until it says "Install" (see below image (b) for an example of the arrows, though those particular ones aren't at the top level).
(b) Vim is in Editors by the way, and it defaults to skip:

Related

What should g:slimv_swank_cmd be to run SLIMV for SBCL on Windows 10?

I'm trying to use Steel Bank Common Lisp with GVim.
I installed Steel Bank Common Lisp (AMD64) into 'C:\Program Files\Steel Bank Common Lisp'.
I unzipped SLIMV into 'C:\vimfiles'
I installed Python3 and put it in Windows PATH.
I installed Python 2.7 and put it in Windows PATH.
I installed 64-bit GVim and finally got Python recognized.
I ran ':helptags C:/vimfiles/doc' in Vim to generate help tags for SLIMV
I have a 'Slimv' menu at the top of the Vim window but no Repl menu.
g:slimv_lisp = sbcl
g:slimv_impl = sbcl
g:slimv_preferred not set
g:slimv_lisp not set
g:slimv_swank_cmd not set
Per webpages and manual, I put this in my vimrc file
let g:slimv_swank_cmd = '!start "c:\Program Files\Steel Bank Common Lisp\sbcl.exe" -l "c:\Users\epic\vimfiles\slime\start-swank.lisp"'
I don't know if that's supposed to be 'set' instead of 'let'.
(start_swank) doesn't do anything inside SBCL.
I assume '!start' is a Vim command, the first thing passed is the location of SBCL on my computer, don't know what the '-l' does, and the third parameter is where SLIMV put 'start-swank.lisp'.
At this point, the Vim command ',c' will open a command window running SBCL and wait. Typing '(exit)' in SBCL will take me back to Vim with a red error message saying 'SWANK server is not running, Press ENTER to continue."
Any other documentation I can find is for SLIME, not SLIMV.
How can I get SLIMV running so I can use Vim for SBCL?
EDIT:
Thank you for the help as to what I'm telling to do what, romaini. Thanks for the slimv help, Tamas.
I have removed the g:slimv_swank_cmd entry in .vimrc, as I believe it does the same thing by itself that it would if I had the command right.
Now, I think I'm back to the problem I was trying to fix with that command, and that might be that SBCL is not working for me (?). Without the g:slimv_swank_cmd setting in .vimrc, Vim starts SBCL which then fails because COMPILE-FILE returns NIL when evaluating line 16 of start-swank.lisp. Vim will then report "SWANK server not running" while SBCL is at a debug screen asking whether to RETRY, CONTINUE, ABORT,,,, or EXIT.
Could it be that slimv is working well but SBCL is not working? I'm still trying in Vim to either compile a program (* 3.0 4.0), evaluate the line, or just connect-server ',C'.
EDIT2:
Trying to install a newer version of slimv from GitHub, I'm afraid we've hit the end of my capabilities. The Readme says to install the zip, reading the whole thing says see internal docs for more, and the internal docs say unzip the zip file in the vimfiles directory. There are lots of files on Github but I don't see a zip.
EDIT3:
With slimv-master.zip from github extracted to .vimfiles, I get the same error that "COMPILE-FILE returned NIL" while evaluating line 16 of ./slime/start-swank.lisp.
EDIT4:
Apparently, the SBCL download went from v2.2.0 to V2.2.1 since 01-26-22. I'm on a 64-bit Windows 10 machine and my SBCL download is automatic from SourceForge after clicking Windows-AMD64 here. I have the same issue, ./slime/swank/sbcl.lisp returns NIL from line 16 where COMPILE-FILE returns NIL. It is starting SBCL v2.2.1 now.
EDIT5:
Both my versions of slimv were extracted to ./vimfiles/. My ./vimfiles/slime/slime.el is Version 2.19. Did the newer slimv version not overwrite files when extracting to ./vimfiles/? Is there an uninstall when we're just extracting zips to ./vimfiles/?
EDIT6:
I don't have a check mark next to comments to mark the last of Tamas Kovacs' responses as the answer (as was the rest of his help through the comments). I now have a REPL window in Vim and Tamas solved my issue.
I summarize the results of our investigation (see comments above):
No need to set slimv option g:slimv_swank_cmd, because slimv should autodetect sbcl and build the correct start command for the swank server.
If autodetection fails or you want to make your own start command for any other reason, then you should use the --load switch (instead of -l) for loading a script into sbcl (the switch depends on the lisp implementation). On Windows machines I also suggest adding /MIN to the !start command, that would start the swank server minimized. This is an example start command for starting sbcl on Windows:
'!start /MIN "c:\Program Files\Steel Bank Common Lisp\sbcl.exe" --load "c:\Users\epic\vimfiles\slime\start-swank.lisp"'
Unfortunately vim.org has an outdated version of slimv, and recent changes in sbcl broke compatibility with the swank server contained in that slimv version. Therefore I strongly recommend that you download or checkout slimv directly from the github repository: https://github.com/kovisoft/slimv
When downloading the slimv-master.zip file from github and manually installing it, make sure that you extract the files from the zip to the proper subdirectories of the vimfiles folder of vim. This means that the contents of slimv-master\ftplugin should go into vimfiles\ftplugin, slimv-master\slime should go into vimfiles\slime, etc. In other words the slimv-master directory in the zip represents the vimfiles directory on your system. Of course this also holds when you install slimv by checking it out from github.

Error when loading vimtutor "E484: Can't open file /usr/share/vim/vim80/tutor/tutor.vim"

I'm trying to run vimtutor on openSUSE Leap 15 1 on WSL2. I get the error E484: Can't open file /usr/share/vim/vim80/tutor/tutor.vim
When I run which vim (or which vimtutor) I get /usr/bin/vim (or /usr/bin/vimtutor) -- is the issue that I have multiple versions of vim installed and when I try vimtutor (which I understand to be a script) it can't access the correct one because of the way my PATH is configured? I've seen similar issues about this posted, but none that seem to deal with this specific issue as it applies to vimtutor.
The vim script is part of vim-data package.
If you looked at the spec file linked here,
https://build.opensuse.org/package/view_file/openSUSE:Factory/vim/vim.spec?expand=1
on line 567, the tutor.vim is split into the vim-data package.
It's part of the
%files data
block.

How to recover or reinstall .vim_runtime directory and contents

I downloaded this vim config but decided later I wanted to work using vanilla vim (because i'm still not used to it).
So I followed the instructions at the bottom of the README:
How to uninstall
Just do following:
Remove ~/.vim_runtime
Remove any lines that reference .vim_runtime in
your ~/.vimrc
I deleted the hidden vim_runtime directory located in :home/user/ on Ubuntu 16.04, using
rm -rf ~/.vim_runtime/
then realized this was a mistake. I now can't open vim without getting:
Error detected while processing /home/user/.vimrc:
line 3:
E484: Cannot open file /home/user/.vim_runtime/vimrcs/basic.vim
line 4:
E484: Cannot open file /home/user/.vim_runtime/vimrcs/filetypes.vim
line 5:
E484: Cannot open file /home/user/.vim_runtime/vimrcs/plugins_config.vim
line 6:
E484: Cannot open file /home/user/.vim_runtime/vimrcs/extended.vim
Press ENTER or type command to continue
I don't know what to do from here, It would be great if I could just purge it all and have vim as it was when you first install the OS, I've tried:
sudo apt-get purge vim && sudo apt-get install vim
but still get the same error detection when opening vim after the command has completed.
If you had no personal configuration other than that Vim distribution, just rm /home/user/.vimrc and start anew. You can also remove /home/user/.vim/ if it exists. That gives you a clean slate. There's no need to reinstall Vim; that distribution presumably was just user configuration (i.e. you didn't need sudo to install it), whereas Vim is installed system-wide (via apt). If there's something inside .vimrc that you want to save (and you have no other editor installed), you can launch Vim with vim -N -u NONE.
soapbox
Vim "distributions" like spf-13 and Janus lure you with a quick install and out-of-the-box settings, but you pay the price with increased complexity (you need to understand both Vim's runtime loading scheme and the arbitrary conventions of the distribution) and inflexibility (the distribution may make some things easier, but other things very difficult). Vim is incredibly customizable, using someone else's customization makes no sense.
new config
I would base your personal configuration on the example that ships with Vim. You can install it like this:
$ vim
:edit $VIMRUNTIME/vimrc_example
:saveas $MYVIMRC
:quit
Also see :help defaults.vim.

Why can't this menu item work?

I got this in my vimrc:
:so menu_format.vim
and in menu_format.vim, this:
"... other menu items that work
menu Format.nbsp_space <ESC>:%s# # #gec<CR> //(the 1st blank is 0xa0, the 2nd is 0x20)
"... other menu items that work
On Windows it works (been using it for a while), but on Linux Mint 17 vim gives:
E319: Sorry, the command is not available in this version.
I tried %s# # #gec on command line, it worked, too!
I knew how to fix this: %s#[\xa0]# #gec would do. I just wanted to know why there is such a difference, and it made me doubt the portability of my vim scripts.
BTW, I built vim (7.4.560) on both Linux and Windows with the same configuration, both use the same menu_format.vim.
It looks like you only have the minimal version of Vim named vim-tiny; it only provides a minimal vi-compatible implementation. The E319 implies that the :menu command is not available, the :substitute does look fine and should work.
To get the full Vim (and graphical GVIM), install the following package:
$ sudo apt-get install vim-gnome

vim and latex-box

I installed the vim plugin latex-box but I am having trouble getting it to compile my Latex file. The docs say it uses latexmk to do the compiling, and I have that installed and it works when called by itself.
But when I use the plugin's \ll command to compile I get an error that says 'cannot run latexmk in background without a VIM server'. I cannot find an explanation of why this error would occur in the plugin documentation.
EDIT:
I found a solution to this issue, but ran into others.
To fix this, you need to install the full version of vim (which is different depending on your OS) which will include things like server support. I suggest doing this even if you don't use this plugin because it will fix not been able to copy/paste from/to vim. In (K)ubuntu, install the package vim-gtk.
Start vim like this vim --servername SOMETHING file.tex
After doing this, the servername error went away and the compilation went through but the output from latexmk shows up on top of the file I'm editing. It doesn't overwrite it, it's just displayed on top of the text. When I move the cursor and vim highlights a word or bracket, that appears back on the screen. The only quick way I found to get rid of the compiler output is to scroll the file up and back down, that makes the text appear again.
You can ask vim to redraw the screen like this:
:redraw!
Append that command after running your latex command.

Resources