Hot answers tagged

29

So, installing vim-enhanced and vim-X11 is enough, but is not at the same time. To enable the system funtcions like +clipboard, you moreover need to use the vimx executable rather than vim or vi (even though they are probably identical, the name changes the behaviour). One way how to do that permanently is by adding aliases in your .bashrc file: alias vi='...


24

Ok. Apparently on native vim in Arch there is no support for X so the +clipboard feature is missing. To fix this, install gvim, which although conflicts with vim, which was my initial problem with it, retains the exact same functionality if you use vim Rather than, gvim You still need to set clipboard=unnamed.


20

As @Doorknob said in his comment, :set mouse=a fixes the problem.


13

TL;DR: This isn't really possible without a clipboard manager (e.g. clipit, diodon, glipper, parcellite). It's an explicit design choice of X to not store the data for the X selections, whether that's the PRIMARY (what Vim calls "*) or CLIPBOARD (what Vim calls "+) selection. When a user performs a copy in an application, the application just tells X Hey, ...


10

There's two reasons why I think this may be happening: The solarized color scheme you are using does not declare ctermfg and ctermbg for any of the features you want to highlight. Try out this color scheme, should look essentially the same both inside your terminal and gvim, if this is the case then you may need to look into using a color scheme that ...


6

A few <expr> mapping should be able to do the job here. The basic structure would be function! ClipboardOrXclip(command, register) if a:register !~ '[+*]' || has('xterm_clipboard') || has('gui_running') " Just return the original command if the clipboard is accessible " or it's not a register that should be handled by xsel ...


5

Great news, everyone. @Tom and @Rich set me on the right path. I found a solution provided here. I set my .vimrc to the simple syntax enable set background=dark set t_Co=16 colorscheme solarized This seems to fix everything. The colors don't seem to be as bright in the font examples, but that could very well just be me. To anyone who wants to use the ...


4

You don't have to uninstall any of the existing packages. The vim-{athena,gtk,gtk3,nox} etc. packages just provide the Vim binary built with different feature sets and linked against different GUI toolkits. Install the vim-gtk (or on newer systems vim-gtk3) package Check whether the vim and gvim alternatives automatically switched to using /usr/bin/vim.gtk ...


4

I guess it is an issue of compatibility of this colorscheme with terminal. The plugin csaprox miraculously solve a bunch of this issues. Synopsis: It's hard to find colorschemes for terminal Vim. Most colorschemes are written to only support GVim, and don't work at all in terminal Vim. This plugin makes GVim-only colorschemes Just Work in ...


4

The solarized terminal-Vim colorscheme can work in one of two different ways. A 16-colour mode: Solarized only contains 16 colours, so in this mode you set your terminal to use the solarized colours as its 16 colours, and the Vim colorscheme just uses these. So for example, the Vim colorscheme will request terminal colour "1", and the terminal displays this ...


4

One solution would be to use a single instance of vim per project, which would prevent this issue unless your multiple projects had overlapping files. I'm going to assume that you are looking for a automated solution, instead of a suggestion on changing your behavior though. There is the possibility of another solution in FocusLost that is more native to ...


3

I know this is a few years late, but you can use nmap <Down> <C-e> nmap <Up> <C-y> This worked for me.


3

Long lost and almost forgotten. Meant to re-factor the code etc. but post is as is. This code is used on a 32-bit system. Not sure how it would behave on 64-bit (or other). Have a hack in C-code somewhere as well, (extracting PID). Leave it as a post for anyone to hack and tweak. My current script as a whole (using pid as option it should work on any GUI ...


3

Seems like you found your answer. I had this same problem and nothing above worked. What worked for me was using altercation's terminalrc, as opposed to sgerrand's. My relevant vimrc is simply: syntax enable set background=dark colorscheme solarized Hope that helps someone!


1

resize is the command which solves the problem. That is not Vim's, but X11's resize. So I just added this to ~/.vimrc silent !resize to get the command automatically issued on Vim start. If you do not want to see the command's output after quitting Vim, silent !resize > /dev/null


1

I found a solution which relies on Vim's +clientserver capability. It just took a small addition to a script I already used. The final result is this vimserver.sh: #!/bin/sh if [ -z "$(vim --serverlist)" ]; then xterm -name vimserver -xrm 'vimserver*vt100.Translations:#override\ Shift <KeyPress> Insert: insert-selection(None,None)' \ ...


1

One option is to use the plugins https://github.com/lyokha/vim-xkbswitch or https://github.com/rlue/vim-barbaric, which switch the input method in vim's input mode using xkbswitch.


1

So this is what works for me (on all terminals I used to use – xterm, konsole, gnome-terminal, iterm2, roxterm – on both Linux and OS X, also with gvim and macvim): " no other configuration than this needed for solarized colorscheme solarized highlight SpecialKey ctermfg=11 ctermbg=8 if &term =~ '256color' " Disable Background Color Erase (BCE) so ...


Only top voted, non community-wiki answers of a minimum length are eligible