SolvedSpaceVim Copy and paste in the system clipboard

Hello,

I have tried several solutions to be able to perform copy / paste operations in the system clipboard by default, like "*yy and "*p do, unsuccessfully. Visual copy / paste operations work as expected but I'm trying to figure out (I did read the FAQ and the documentation of course) how I can use the system clipboard by default, in order to be able to paste contents in another vim process, a terminal, or another application.

I have tried to:

  • Use more layers provided by SpaceVim ;
  • Use set clipboard=unnamed (as well as unnamedplus or the combination of both values) ;
  • Use set guioptions+=a ;
  • Remap <Leader> to see if the behaviour keeps being the same.

I saw that some people sometimes remap C-c / C-v keys but I guess that there is a better way to achieve this.

I have put some details in the Reproduce ways section, but I would like to also mention that:

  • When using <Leader>, it seems that I have to wait for about one second (when the menu is displayed) before pressing \ y. Am I right or is there a way to do this more quickly?

  • I was previously using the mouse to copy to the X11 clipboard (vim, terminal, or in another places), and then a middle-button click to paste the content, but it also pastes lines numbers, columns characters, that's why I'm looking for another method now.

Thanks a lot.

PS: I have found a lot of posts on this topic, sorry for opening another issue.

Environment Information

  • OS: linux
  • vim version: 8.0.1453
  • neovim version: -
  • SpaceVim version: 0.9.0-dev
  • SpaceVim status:
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

The reproduce ways from Vim starting (Required!)

At the moment:

  1. If I use C-c / C-v, the content can be pasted in the current vim process only ;
  2. If I use <Leader> \ y, the content is yanked. Though, using \ p in another terminal with not allow to paste the same content.
  3. If I use "*yy and "*p, it works as expected but I believe that SpaceVim provides shortcuts ; am I right ?

Output of the :SPDebugInfo!

SpaceVim debug information

SpaceVim options :

  auto_disable_touchpad = 1
  autocomplete_method = 'ycm'
  autocomplete_parens = 1
  background = 'dark'
  bootstrap_after = 'myspacevim#after'
  bootstrap_before = 'myspacevim#before'
  buffer_index_type = 4
  checkinstall = 1
  colorscheme = 'gruvbox'
  colorscheme_bg = 'dark'
  colorscheme_default = 'desert'
  custom_color_palette = []
  custom_plugins = [['crazy-canux/icinga2.vim', {'name': 'crazy-canux/icinga2.vim', 'merged': 0}], ['saltstack/salt-vim', {'name': 'saltstack/salt-vim', 'merged': 0}]]
  debug_level = 1
  default_indent = 2
  disabled_plugins = []
  enable_ale = 0
  enable_cursorcolumn = 0
  enable_cursorline = 1
  enable_debug = 0
  enable_googlesuggest = 0
  enable_guicolors = 1
  enable_insert_leader = 1
  enable_javacomplete2_py = 0
  enable_key_frequency = 0
  enable_language_specific_leader = 1
  enable_neocomplcache = 0
  enable_neomake = 1
  enable_os_fileformat_icon = 0
  enable_powerline_fonts = 1
  enable_statusline_display_mode = 0
  enable_statusline_mode = 0
  enable_tabline_filetype_icon = 1
  enable_vimfiler_filetypeicon = 0
  enable_vimfiler_gitstatus = 0
  enable_vimfiler_welcome = 1
  enable_ycm = 1
  error_symbol = ''
  expand_tab = 1
  filemanager = 'vimfiler'
  filetype_icons = {}
  force_global_config = 0
  gitcommit_issue_icon = ''
  gitcommit_pr_icon = ''
  github_username = ''
  guifont = ''
  hiddenfileinfo = 1
  hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
  info_symbol = ''
  keep_server_alive = 1
  language = ''
  leader_guide_default_group_name = ''
  leader_guide_flatten = 1
  leader_guide_hspace = 5
  leader_guide_max_size = 0
  leader_guide_position = 'botright'
  leader_guide_run_map_on_popup = 1
  leader_guide_sort_horizontal = 0
  leader_guide_submode_mappings = {'<C-C>': 'win_close'}
  leader_guide_vertical = 0
  lint_on_save = 1
  lint_on_the_fly = 0
  max_column = 120
  plugin_bundle_dir = '/home/aanriot/.cache/vimfiles/'
  plugin_manager = 'dein'
  plugin_manager_processes = 16
  plugin_name = 'vimshell.vim'
  project_rooter_automatically = 1
  project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/']
  realtime_leader_guide = 1
  relativenumber = 0
  search_tools = ['rg', 'ag', 'pt', 'ack', 'grep']
  sidebar_direction = ''
  sidebar_width = 30
  simple_mode = 0
  smartcloseignoreft = ['tagbar', 'vimfiler', 'SpaceVimRunner', 'SpaceVimREPL', 'SpaceVimQuickFix', 'HelpDescribe', 'VebuggerShell', 'VebuggerTerminal', 'SpaceVimTabsManager']
  smartcloseignorewin = ['__Tagbar__', 'vimfiler:default']
  snippet_engine = 'ultisnips'
  src_root = 'E:\sources\'
  statusline_inactive_separator = 'arrow'
  statusline_left_sections = ['winnr', 'filename', 'major mode', 'syntax checking', 'minor mode lighters']
  statusline_right_sections = ['fileformat', 'cursorpos', 'percentage']
  statusline_separator = 'arrow'
  statusline_unicode_symbols = 1
  terminal_cursor_shape = 2
  version = '0.9.0-dev'
  vim_help_language = 'en'
  vimcompatible = 0
  warning_symbol = ''
  wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,*.ttf,*.TTF,*.png,*/target/*,.git,.svn,.hg,.DS_Store,*.svg'
  windows_index_type = 0
  windows_leader = 's'
  windows_smartclose = 'q'

SpaceVim layers :

[[layers]]
  name="autocomplete"
  auto-completion-return-key-behavior='complete'
  auto-completion-tab-key-behavior='cycle'
[[layers]]
  name="checkers"
[[layers]]
  name="format"
[[layers]]
  name="edit"
[[layers]]
  name="ui"
[[layers]]
  name="core"
[[layers]]
  name="core#banner"
[[layers]]
  name="core#statusline"
[[layers]]
  name="core#tabline"
[[layers]]
  name="default"
[[layers]]
  name="git"
[[layers]]
  name="lang#python"
[[layers]]
  name="lang#markdown"
[[layers]]
  name="lang#latex"
[[layers]]
  name="shell"
  default_position='top'
  default_height=30
[[layers]]
  name="-l"

SpaceVim Health checking :

SpaceVim clipboard support check report:
Checking +clipboard:
Failed : to support +clipboard, you need recompile your vim with +clipboard support.
SpaceVim environment check report:
Current progpath: vi(/usr/bin/vim.basic)
version: 800
OS: linux
[shell, shellcmdflag, shellslash]: ['/bin/bash', '-c', 0]
SpaceVim lua support check report:
Checking +lua:
Failed : to support +lua, you need recompile your vim with +lua support.
SpaceVim python support check report:
Checking +python3:
SUCCEED!
Checking +python:
Failed : to support +python, Please install vim-gik, or build from sources.

SpaceVim runtime log :

[ SpaceVim ] : logger file  does not exists, only log for current process will be shown!
[ SpaceVim ] [09:23:02] [ Info ] SpaceVim startup status is: [1, '/home/aanriot/repos/fraudbuster/saltstates']
[ SpaceVim ] [09:23:02] [ Info ] Can not find project local config, start to loadding global config
[ SpaceVim ] [09:23:02] [ Info ] YCM only support ultisnips, change g:spacevim_snippet_engine to ultisnips
[ SpaceVim ] [09:23:03] [ Info ] Find project root('.git/',''):/home/aanriot/repos/fraudbuster/saltstates/.git/
[ SpaceVim ] [09:23:03] [ Info ] change to root:/home/aanriot/repos/fraudbuster/saltstates
[ SpaceVim ] [09:23:03] [ Info ] try to open SpaceVim welcome page
[ SpaceVim ] [09:23:03] [ Info ] change to root:/home/aanriot/repos/fraudbuster/saltstates
[ SpaceVim ] [09:23:04] [ Info ] Find project root('.git/',''):/home/aanriot/repos/fraudbuster/saltstates/.git/
[ SpaceVim ] [09:23:04] [ Info ] change to root:/home/aanriot/repos/fraudbuster/saltstates
[ SpaceVim ] [09:23:06] [ Info ] Find project root('.git/','/home/aanriot/repos/fraudbuster/saltstates/SpaceVimLayers'):/home/aanriot/repos/fraudbuster/saltstates/.git/
[ SpaceVim ] [09:23:06] [ Info ] change to root:/home/aanriot/repos/fraudbuster/saltstates
[ SpaceVim ] [09:24:47] [ Info ] change to root:/home/aanriot/repos/fraudbuster/saltstates
17 Answers

✔️Accepted Answer

How about providing instructions in english?

To copy, make sure you're not in edit mode, so first hit esc

The default leader key is \

so copy & paste should be:

  • copy: \y
  • paste: \p

Other Answers:

you need to recompile your vim with +clipboard support

Great, thanks @wsdjeg . On Ubuntu, I have installed vim-gtk to get the +clipboard support.

More Issues: