Error detected while processing /home/ming/.vim/bundle/vim-copycat/plugin/copycat.vim: line23: E319: Sorry, the commandis not available in this version: python << EOF line24: E492: Not an editor command: import sys line25: E492: Not an editor command: import vim line26: E492: Not an editor command: sys.path.append(vim.eval('expand("<sfile>:p:h:h")')) line27: E492: Not an editor command: import copycat_plugin line28: E492: Not an editor command: EOF
Error detected while processing /home/ming/.vim/bundle/vim-copycat/plugin/copycat.vim: line 28: Traceback (most recent call last): File"<string>", line 4, in <module> File"/home/ming/.vim/bundle/vim-copycat/copycat_plugin.py", line 11, in <module> import copycat File"/usr/local/lib/python3.6/dist-packages/copycat.py", line 73 print 'noreg {}'.format(name) ^ SyntaxError: invalid syntax
Error detected while processing function <SNR>36_push_into_clip: line 4: Traceback (most recent call last): File"<string>", line 1, in <module> File"/home/ming/.vim/bundle/vim-copycat/copycat_plugin.py", line 37, indeco result = func(*args, **kwargs) File"/home/ming/.vim/bundle/vim-copycat/copycat_plugin.py", line 53, incopy copycat.copy(name=name, value=value) File"/usr/local/lib/python3.6/dist-packages/copycat.py", line 96, incopy value = smart_str(value) File"/usr/local/lib/python3.6/dist-packages/copycat.py", line 20, in smart_str if not isinstance(s, basestring): NameError: name 'basestring' is not defined
Error detected while processing function <SNR>36_push_into_clip: line 4: Traceback (most recent call last): File"<string>", line 1, in <module> File"/home/ming/.vim/bundle/vim-copycat/copycat_plugin.py", line 37, indeco result = func(*args, **kwargs) File"/home/ming/.vim/bundle/vim-copycat/copycat_plugin.py", line 53, incopy copycat.copy(name=name, value=value) File"/usr/local/lib/python3.6/dist-packages/copycat.py", line 100, incopy clipboard.copy(value) File"/usr/local/lib/python3.6/dist-packages/clipboard.py", line 31, incopy pipe.communicate(text) File"/usr/lib/python3.6/subprocess.py", line 828, in communicate self._stdin_write(input) File"/usr/lib/python3.6/subprocess.py", line 781, in _stdin_write self.stdin.write(input) TypeError: a bytes-like object is required, not 'str'
將 copycat.py 中的 copy 函數改成:
1 2 3 4 5 6 7 8
def copy(value=None, name=None): value = value or not sys.stdin.isatty() and sys.stdin.read()
#value = smart_str(value) with Storage() as storage: storage.save(value, name=name) if not name: clipboard.copy(value.encode('utf-8'))
copy 函數正常後,現在已經可以正常複製,接下來 paste 錯誤訊息:
1 2 3 4 5 6 7 8 9 10 11 12
Error detected while processing function<SNR>36_pop_from_clip: line3: Traceback (most recent calllast): File "<string>", line1, in <module> File "/home/ming/.vim/bundle/vim-copycat/copycat_plugin.py", line39, in deco set_to_vim(result_reg, result) File "/home/ming/.vim/bundle/vim-copycat/copycat_plugin.py", line25, in set_to_vim if not isinstance(name, basestring): NameError: name 'basestring'is not defined line4: E121: Undefined variable: l:result E15: Invalid expression: l:result
將 copycat.py 中的 paste 函數修改為:
1 2 3 4 5 6 7 8 9
def paste(name=None): with Storage() as storage: if not name: data = clipboard.paste() or storage.get() else: data = storage.get(name) #data = smart_str(data) clipboard.copy(data) return data
打開 copycat_plugin.py 將 set_to_vim 函數改成:
1 2 3 4 5 6 7 8 9 10
defset_to_vim(name, value): #if not isinstance(name, basestring): # return False