You are not logged in.
I try to mimic what the mswin script does, but since I don't need all of those options and since I am a bit hesitant of changing more behaviour than I actually need I decided to only use those few lines in my vimrc. All I need is copy and paste to and from the system clipboard. Copying only has to work in visual mode, inserting should work in normal, visual and insert mode. So Ctrl+V gets rebinded and I need a new key combination to start a visual block, for which mswin uses Ctrl-Q. However, with the following lines I cannot start a visual block, copying and pasting works fine. This is my full vimrc:
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start " more powerful backspacing
" Now we set some defaults for the editor
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.png,.jpg
" simple copy/paste with system clipboard
map <C-C> "+y
map <C-V> "+P
cmap <C-V> <C-R>+
imap <C-V> <C-r><C-P>+
noremap <C-Q> <C-V>
" appearance settings
set t_Co=256
" colorscheme desert
" autocmd ColorScheme * highlight LineNr guifg=#AAAAAA
" general options
syntax on
set encoding=utf-8
set fileencoding=utf-8
set guioptions-=T
set wrap
set linebreak
set nolist
set nu!
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttabLast edited by FlowIt (2017-06-19 09:36:25)
Offline
I think this is all you need if you install gvim.
map <leader>p :set paste<CR>o<esc>"*]p:set nopaste<cr>Offline
Adding this line to my vimrc does not allow using Ctrl+Q for visual block.
My question was about console vim, altough I didn't say that explicitly. I just tried gvim, without your suggestion, and there Ctrl+Q works, just not in console vim.
In case it is important: I am using termite as my terminal.
Last edited by FlowIt (2017-06-14 14:15:50)
Offline
It works for me in terminal, for pasting in. I can't remember where I configured the copy in my vimrc. Here's my vimrc. I think it's setting the runtime to archlinux.vim that does it.
Offline
No it's not archlinux.vim that does it. Copying and pasting WORKS, it's the visual block that doesn't. Without my modifications, Ctrl+V will start a visual block, after my modifications Ctrl+V will paste. So I tried to rebind it to Ctrl+Q, but that does nothing. I just updated my vimrc a little bit to match exactly the mappings mswin does:
vnoremap <C-C> "+y
map <C-V> "+gP
cmap <C-V> <C-R>+
"imap <C-V> <C-r><C-P>+
noremap <C-Q> <C-V>Commenting the imap line out does not make a difference, I use it to paste also in insert mode.
Offline
Your configuration is working for me in vim. If it is working for you in gvim, I assume that your terminal emulator is the problem. Which one are you using?
EDIT: I just saw that you are using termite. That is the same that I am using. Are there any other settings in your .vimrc? When I tested it, I had only the few lines that you posted above in my .vimrc.
Are there any weird settings in your termite configuration?
Last edited by stupidus (2017-06-19 08:51:00)
Offline
I just tested it in gvim and there my config works, but not in console vim. I tried both termite, lxterminal and xterm (the latter two both with stock configuration) and it doesn't work in console vim. And yes, the lines I posted above are my only vim configuration.
Edit: The hint to try it in gvim led me to https://stackoverflow.com/questions/218 … -vim-gnome
Adding stty start undef solved it for me.
Offline