Skip to main content
Topic: I wish they would stop breaking vim (Read 1625 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

I wish they would stop breaking vim

Every upgrade to vim no includes a mandatory shake out of manulally removing the visual mode  from the mouse  cut and paste.

FWIW, the latest version of vim from arch seems to ignore /etc/vimrc

that is annoying.

You need to edit:

Code: [Select]
" In many terminal emulators the mouse works just fine.  By enabling it you
" can position the cursor, Visually select and scroll with the mouse.
if has('mouse')
  set mouse-=a
endif

from
/usr/share/vim/vim80/defaults.vim

The essentail thing is to add the negitive sign to the mouse option. 
You can't make this stuff up, it is so stupid, that someone intentionally breaks vim on the upstream.

The default is for vim to provide its own cut and paste clipboard, like if you are sitting on a windows box.  It  makes me so angry to fix something like this over and over, something that has been set and working since VIM 5 in the late 1990's

But hopefully this will help someone else who is groping with this problem

Ruben
http://www.nylxs.com
http://www.mrbrklyn.com
http://www.brooklyn-living.com

Re: I wish they would stop breaking vim

Reply #1
Vim parses several configuration paths, you should modify the .vimrc in your homedir with "set mouse=a" (or with -)

Also look into "clipboard=unnamed" or "clipboard=unnamedplus" and installing xsel/xclip for interacting with the system (primary) clipboard. There are also compile time options that you may or may not like.

The usr/share files will get overwritten with each package update, the .vimrc in your homedir won't. Look into those options. Your vim frustration is shared by millions, the NeoVim project addresses some woes with saner defaults and removing ancient cruft.

http://vim.wikia.com/wiki/Accessing_the_system_clipboard
http://vim.wikia.com/wiki/Using_the_mouse_for_Vim_in_an_xterm

Re: I wish they would stop breaking vim

Reply #2
This is too complicated.  I look over the links and they talk gibberish to my eyes.  I don't want vim to use system clipboards at all, other than its internal buffers.  X does this just fine and doesn't need any intrusion.

Accessing the system clipboard is the PROBLEM, not the solution.

The default needs to be:

set mouse =-a and that should be the default setting.  If some wacko doesn't know how to cut and paste with X and needs to integrate with openoffice and eclipse, let THEM pour over very application specific documentation and cryptic notations.  The rest of us are happy with swipe and click.

Re: I wish they would stop breaking vim

Reply #3
Quote

Normally, if you try to copy text out of the xterm that vim is running in, you'll get the text as well as the numbers. The GUI version gets this right: it only selects the text, keeping the line numbers out of the picture. But I don't want the GUI version. So instead, I added this to my vimrc:

:set mouse=a

Much better. You can also selectively enable mouse support for specific modes only by using something other than 'a' (for 'all').


This quote from that webpage, BTW, is just flatout wrong.  Nobody should every do this and this option should be removed from the codebase.

Re: I wish they would stop breaking vim

Reply #4
If you are not satisfied with default options create user configuration file in your home dir (or in place where user configuration is kept) and configure it as you want (as was already explained).

Package files in "/usr/share" like "/usr/share/vim/vim80/defaults.vim" are mostly not backed up before upgrade like configs in /etc, which mean no 'pacnew' or 'pacold' files.

Moreover, package 'vim' is in Arch 'extra' repository.
https://www.archlinux.org/packages/extra/x86_64/vim/
You can file your bug report to them (there is link Bug Reports)
https://bugs.archlinux.org/?project=1&string=vim

There is always another option.
Because vim is not in Artix repositories yet, You can port it to artix and maintain it with best default options.

It is your choice, which way will you choose ?

Re: I wish they would stop breaking vim

Reply #5
IIRC, you can hold down Shift to use the terminal selection mode when selecting/copying, if you don't like vim's. It bypasses it completely on urxvt for example.

But that also copies space into the clipboard beyond the end of the lines, while vim's way doesn't. When pasting, I like having "set paste" enabled. I also often use something to manage the clipboard: clipit, parcellite, etc. but it depends on your use case. If set right, it can sync the default yank buffer with the primary so the X integration is more seamless, but some assembly is required. Gvim might have some more options in this regard.

I found "leafpad" to be great for simple editing, and it behaves like other GUI apps with regard to clipboard and it just works. Not much smarter than "notepad" on Windows, but it gets the job done.

Re: I wish they would stop breaking vim

Reply #6
I
There is always another option.
Because vim is not in Artix repositories yet, You can port it to artix and maintain it with best default options.

That might be a good idea!  It would be a good starting point  learn how artix packaging works.   Is there a howto or faq that covers how to turn source into a package?

Re: I wish they would stop breaking vim

Reply #7
That might be a good idea!  It would be a good starting point  learn how artix packaging works.   Is there a howto or faq that covers how to turn source into a package?

Artix packaging works the same way as in Arch.
https://wiki.archlinux.org/index.php/PKGBUILD

You can always find source files for Arch packages in their web UI and maybe even through pacman.
Example for vim: https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/vim

You can find useful tools for packaging, building iso... in group "artools" just run
Code: [Select]
pacman -S artools
https://github.com/artix-linux/artools

You should not have direct access to Artix repositories, so you should "Fork" Artix repositories and work with your fork and when you are done you should create "Pull Request" or send patch by mail or something.
To work with repository, you should use artool.

So i searched and managed to find few examples on how to use artools for packaging:
https://github.com/artix-linux/pipeline-playground
Some info can also be found in deleted issue:
https://webcache.googleusercontent.com/search?q=cache:WAkHmclq9H4J:https://github.com/artix-linux/system/issues/70#issuecomment-365465140

I am not experienced with these tools nor packaging for Artix.
I will also try to learn it some time in the future.