1

I was trying to map ctrl+c to copy, ctrl+v to paste in vim, but it's not working properly.I've tried https://stackoverflow.com/questions/61177658/mapping-select-all-copy-paste-in-vim and https://superuser.com/questions/61226/configure-vim-for-copy-and-paste-keyboard-shortcuts-from-system-buffer-in-ubuntu. I've mapped Ctrl+c to vnoremap "+y and Ctrl+v to vnoremap "+p. What am I doing wrong? my .vimrc

set nocompatible
filetype off
filetype off
set rtp+=~/.vim/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'preservim/nerdtree'
Plugin 'ackyshake/VimCompletesMe' 
Plugin 'vim-airline/vim-airline' 
Plugin 'jiangmiao/auto-pairs'
call vundle#end()
filetype plugin indent on
"set line number
set number
"set syntax highlight
syntax on
"set highlight search
set hlsearch
"turns on detection,plugin and indent at once of a given file
filetype plugin indent on
" 80 characters line
"set colorcolumn=81
"set terminal color to 256 colors
set t_Co=256
"set tabulations of 8 white spaces
set shiftwidth=8
"set visual bell
set visualbell
"background color: dark
set background=dark
"set indentation reacts to the syntax of the code
set smartindent
"automatically indent new lines
set autoindent
"autoindent lines
nmap <C-s> :w<CR>
"map Ctrl+s to save in normal mode
imap <C-s> <Esc>:w<CR>l
"map Ctrl+s to save in insert mode
nmap <C-d> :ClangFormat<CR>
"map Ctrl+d to format code
imap <C-d> <Esc>:ClangFormat<CR>a
"map Ctrl+q to force quit
nmap <C-q> :q!<CR>
"map Ctrl+q to force quit
nmap<C-o> :NERDTree<CR>
vnoremap <C-c> "+y
vnoremap <C-v> "+p
  • solved by putting set clipboard=unnamedplus – victor 0x3E7 Aug 07 '21 at 02:24
  • 2
    Please post an answer with what worked to solve the problem for you! – filbranden Aug 07 '21 at 04:03
  • Welcome to [vi.se]! Please consider spending some time with the [tour] or [help]. As filbranden says, answers belong in the answer box, not comments—even self-answers! You might also want to take a look at How to debug my vimrc to slim down the vimrc and identify what's actually relevant to your post; you can [edit] to include only relevant details and even use Markdown formatting. – D. Ben Knoble Aug 07 '21 at 21:37

1 Answers1

0

solved by putting on my .bashrc

stty -ixon