You are not logged in.
Hi to all men....i've a matter that i cannot resolve....i'd like to know ho to copy text from vim and past it to another application such as pidgin or firefox etc....i've tried to use clipboard manager such as parcellite and xclip but they don't work...i use openbox and the terminale is urxvt-256colors .... Could you help me to resolve the problem? Thanks
Last edited by TheImmortalPhoenix (2011-08-20 02:28:50)
Offline
I select (highlight) text in vim with the mouse and press the middle (i.e. third) mouse button to paste in Firefox.
It works the other way round too.
Offline
Depending on your system (and sometimes the phase of the moon, I think), if you highlight in visual mode and then hit either "+y or "*y it should copy that text so you can paste it to another X program using shift-insert.
Good luck!
Scott
Offline
Don't work......i've also installed urxvt-clipboard and insert "URxvt*perl-ext-common: default,matcher,clipboard" in my .Xdefaults but it didn't work.....
Offline
It's the default mode in X, I don't have any clipboard, xclip etc. stuff and it works for me.
Shift-Insert does the same as Middle-Mouse-Button.
BTW, where did you get urxvt-256colors from?
rxvt-unicode from the repos is built w/ 256 colors enabled http://projects.archlinux.org/svntogit/ … k/PKGBUILD
Last edited by karol (2011-08-19 14:58:53)
Offline
Depending on your system (and sometimes the phase of the moon, I think), if you highlight in visual mode and then hit either "+y or "*y it should copy that text so you can paste it to another X program using shift-insert.
Good luck!
Scott
Shift-Insert doesn't always work - for instance, you need to use mouse middle-click (button 2) to paste X PRIMARY selection to firefox.
I've tested with `vim -u NONE --noplugin`, and it works for me:
I just need to select text in visual mode or with mouse (and nothing else), and the text is in my X PRIMARY selection. I confirm this by pasting the text to urxvt using Shift-Insert (and yes, here it is the same with button 2), or `xsel -op`, or `xclip -o --selection primary`.
The VIM help on "clipboard", "x11-selection" and "x11-cut-buffer" are fairly helpful, if it somehow doesn't work for you by default...
Last edited by lolilolicon (2011-08-19 15:07:10)
This silver ladybug at line 28...
Offline
I select (highlight) text in vim with the mouse and press the middle (i.e. third) mouse button to paste in Firefox.
It works the other way round too.
I'm having the same issue here, but highlighting text in vim with the mouse only seems to work without having it enabled in vim:
"set mouse=a
With this option enabled the mouse does only select the text in visual mode, and does not copy it to a clipboard. I'm not sure here.
Offline
BTW, where did you get urxvt-256colors from?
rxvt-unicode from the repos is built w/ 256 colors enabled http://projects.archlinux.org/svntogit/ … k/PKGBUILD
My mistake, i ment rxvt-unicode...
Shift-Insert doesn't always work - for instance, you need to use mouse middle-click (button 2) to paste X PRIMARY selection to firefox.
I've tested with `vim -u NONE --noplugin`, and it works for me:
I just need to select text in visual mode or with mouse (and nothing else), and the text is in my X PRIMARY selection. I confirm this by pasting the text to urxvt using Shift-Insert (and yes, here it is the same with button 2), or `xsel -op`, or `xclip -o --selection primary`.The VIM help on "clipboard", "x11-selection" and "x11-cut-buffer" are fairly helpful, if it somehow doesn't work for you by default...
If i use 'vim -u NONE --noplugin' it works....but i can't use vim without plugins...it's not suitable for me....
Offline
Depending on your system (and sometimes the phase of the moon, I think), if you highlight in visual mode and then hit either "+y or "*y it should copy that text so you can paste it to another X program using shift-insert.
You need to have the gvim package installed for that, the standard vim doesn't come with X-buffers compiled.
ᶘ ᵒᴥᵒᶅ
Offline
If i use 'vim -u NONE --noplugin' it works....but i can't use vim without plugins...it's not suitable for me....
Well, me neither. I did that just to make sure the default works. So maybe it's your .vimrc? Try `vim -u NONE`.
@litemotiv Yeah, that's what I thought...
This silver ladybug at line 28...
Offline
This is my .vimrc:
" Basics
syntax on " enable syntax highlighting
set showmatch " show matching brackets (),{},[]
set number
set nocompatible
set background=dark
set encoding=utf-8
set termencoding=utf-8
set shell=/bin/zsh
set mouse=a
set noswapfile
filetype on
set complete=k " global autocompletion
set completeopt+=longest
" Indenting, Folding..
set tabstop=4 " numbers of spaces of tab character
set shiftwidth=4 " numbers of spaces to (auto)indent
set softtabstop=4 " counts n spaces when DELETE or BCKSPCE is used
set expandtab " insert spaces instead of tab chars
set autoindent " always set autoindenting on
set nosmartindent " intelligent indenting -- DEPRECATED by cindent
set nocindent " set C style indenting off
set foldenable
set foldmethod=marker
" searching
set hlsearch " highlight all search results
set incsearch " increment search
set ignorecase " case-insensitive search
set smartcase " upper-case sensitive search
set laststatus=2 " occasions to show status line, 2=always.
" set cmdheight=1 " command line height
set ruler " ruler display in status line
set showmode " show mode at bottom of screen
" set previewheight=5
" Set taglist plugin options
let Tlist_Use_Right_Window = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Compact_Format = 1
let Tlist_File_Fold_Auto_Close = 0
let Tlist_Inc_Winwidth = 1
" Toggle taglist script
map <F7> :Tlist<CR>
" VTreeExplorer
map <F12> :VSTreeExplore <CR>
let g:treeExplVertical=1
let g:treeExplWinSize=35
let g:treeExplDirSort=1
" common save shortcuts
" inoremap <C-s> <esc>:w<cr>a
" nnoremap <C-s> :w<cr>
" Set bracket matching and comment formats
set matchpairs+=<:>
set comments-=s1:/*,mb:*,ex:*/
set comments+=s:/*,mb:**,ex:*/
set comments+=fb:*
set comments+=b:\"
set comments+=n::
" Fix filetype detection
au BufNewFile,BufRead .torsmorc* set filetype=rc
au BufNewFile,BufRead *.inc set filetype=php
au BufNewFile,BufRead *.sys set filetype=php
au BufNewFile,BufRead grub.conf set filetype=grub
au BufNewFile,BufRead *.dentry set filetype=dentry
au BufNewFile,BufRead *.blog set filetype=blog
" C file specific options
au FileType c,cpp set cindent
au FileType c,cpp set formatoptions+=ro
" HTML abbreviations
au FileType html,xhtml,php,eruby imap bbb <br />
au FileType html,xhtml,php,eruby imap aaa <a href=""><left><left>
au FileType html,xhtml,php,eruby imap iii <img src="" /><left><left><left><left>
au FileType html,xhtml,php,eruby imap ddd <div class=""><left><left>
" Session Settings
set sessionoptions=blank,buffers,curdir,folds,help,resize,tabpages,winsize
map <c-q> :mksession! ~/.vim/.session <cr>
map <c-s> :source ~/.vim/.session <cr>
" Set up the status line
fun! <SID>SetStatusLine()
let l:s1="%-3.3n\\ %f\\ %h%m%r%w"
let l:s2="[%{strlen(&filetype)?&filetype:'?'},%{&encoding},%{&fileformat}]"
let l:s3="%=\\ 0x%-8B\\ \\ %-14.(%l,%c%V%)\\ %<%P"
execute "set statusline=" . l:s1 . l:s2 . l:s3
endfun
set laststatus=2
call <SID>SetStatusLine()
" Turn off blinking
"set visualbell
" Turn off beep
"set noerrorbells
set vb " don't beep
set t_vb= " ^
" highlight redundant whitespaces and tabs.
" highlight RedundantSpaces ctermbg=red guibg=red
" match RedundantSpaces /\s\+$\| \+\ze\t\|\t/
if has('gui_running')
let &guicursor = &guicursor . ",a:blinkon0"
colorscheme candycode
set guifont=Monaco\ 9
set guioptions-=T
"set guioptions+=g
"set guioptions-=t
"set guioptions-=m
set guioptions-=L
set guioptions-=l
set guioptions-=r
set guioptions-=R
set guitablabel=%t " set label for tab to just file name
set anti " Antialias font
"set transparency=0
elseif (&term =~ 'linux')
set t_Co=16
set termencoding=utf-8
set nocursorline
colorscheme desert
else
set t_Co=256
set mouse=a
colorscheme gigamo
set termencoding=utf-8
endif
Is there something to fix?
Also "vim -u NONE" is not suitable for me...
Last edited by TheImmortalPhoenix (2011-08-19 15:56:20)
Offline
firecat53 wrote:Depending on your system (and sometimes the phase of the moon, I think), if you highlight in visual mode and then hit either "+y or "*y it should copy that text so you can paste it to another X program using shift-insert.
You need to have the gvim package installed for that, the standard vim doesn't come with X-buffers compiled.
Oh yeah! I forgot I had installed that for the python support but I only actually use console vim!
Scott
Offline
This is my .vimrc:
-----8<-----
Is there something to fix?
I don't see any.
Also "vim -u NONE" is not suitable for me...
It's not about about suitable or not... it's about debugging. You said `vim -u NONE --noplugins` worked for you, so it's either your .vimrc OR some plugin that messes it up. You try `vim -u NONE` and `vim --noplugins` to find out which...
This silver ladybug at line 28...
Offline
To copy from an xterm vim, I hold down Shift while I highlight text with the mouse. This stops vim from entering Visual mode. Whatever I highlight becomes the primary selection.
To paste a primary selection in xterm vim, I first make sure vim is in 'Insert' mode. Shift+Insert will then paste the primary selection at the cursor.
Offline
To copy from an xterm vim, I hold down Shift while I highlight text with the mouse. This stops vim from entering Visual mode. Whatever I highlight becomes the primary selection.
To paste a primary selection in xterm vim, I first make sure vim is in 'Insert' mode. Shift+Insert will then paste the primary selection at the cursor.
Great!! This work for me!! Thank you very much!!
But it works only with the mouse....if i'd like to use just keyboard in tiling wms what could i do?
Just another question: in the .vimrc which voice i have to delete in order to eliminate showing line numbers on the left?
Last edited by TheImmortalPhoenix (2011-08-19 18:17:33)
Offline
Just another question: in the .vimrc which voice i have to delete in order to eliminate showing line numbers on the left?
Remove:
set number
or possibly change it to:
set nonumber
Offline
In 'command mode', for toggling line numbers:
:set nonu Turns off line numbering.
:set nu Turns line numbering on.
Getting copy and paste in vim to use the clipboard – what I've learned but haven't tried to change:
The version of vim shipped by Arch is compiled without the 'xterm_clipboard' feature support. You can see this when you type the command, 'vim --version'. Features that are supported have a '+' in front of them and features not supported have a '-' in front of them.
If the 'xterm_clipboard' were enabled, special vim registers would connect to the cut-buffers and X11's selection buffer. You could then copy into a vim register without using the mouse and have the copied text available for pasting into a GUI app. See http://www.jveweb.net/en/archives/2011/ … board.html. This is not possible with the vanilla Arch package.
The best work-around might be recompiling using ABS and modifying the PKGBUILD. See this thread, https://bbs.archlinux.org/viewtopic.php?id=104903, and this bug report / feature request, https://bugs.archlinux.org/task/22612.
Edit: Corrected where I wrote "xterm" but meant "vim".
Last edited by thisoldman (2011-08-20 00:37:06)
Offline
Thanks for clearing my doubts!! I'll recompile vim
Offline
Fyi, You can just install gvim instead of recompiling if you so desire. The console vim installed with gvim comes compiled with that X clipboard support.
Scott
Offline
My suggestion: Install the gvim package and use "* and "+ (eg "*p to paste into vim)
See :h quotestar for more info.
Recompiling the vim package to add +X11 stuff is imo silly compared to just using the gvim package. (as said, it does provide a 'vim' binary with all the nice stuff included)
Last edited by Mr.Elendig (2011-08-20 02:12:10)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
I recompiled i use awesome wm and i mostly use terminal...so i don't want gtk applications...however the problem is solved now! Thanks to all of you have helped me
Offline
As if you were going to miss those 3mb of disk space
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
As if you were going to miss those 3mb of disk space
It's not about space, but appearance
Offline
Maybe too late, but you may consider rebuilding vim with --with-x=yes option.
Read this: https://bbs.archlinux.org/viewtopic.php?id=71619
It solved the same problem at my computer ;]
Offline
Maybe too late, but you may consider rebuilding vim with --with-x=yes option.
Read this: https://bbs.archlinux.org/viewtopic.php?id=71619
It solved the same problem at my computer ;]
That's what i've done
Offline