Tagged: vim Toggle Comment Threads | Keyboard Shortcuts

  • ThomasPowell 3:46 pm on February 16, 2022 Permalink | Reply
    Tags: , fugitive, vim   

    Error detected while processing /Users/tpowell/.vim/plugins/vim-fugitive/plugin/fugitive.vim:
    line 471: E1208: -complete used without allowing argumentsline 472: E1208: -complete used without allowing argumentsline 476: E1208: -complete used without allowing argumentsline 479: E1208: -complete used without allowing argumentsPress ENTER or type command to continue

    Fixed by changing -nargs=0 instances in fugitive.vim to -nargs=?

    Found via https://github.com/mhinz/vim-sayonara/pull/19/commits/7e774f58c5865d9c10d40396850b35ab95af17c5

     
  • ThomasPowell 11:45 am on October 3, 2014 Permalink
    Tags: vim, vimscript   

    Using a vimscript to run through a list of substitutions with dictionary pairs 

    I wanted to modify a test suite to call a method using ruby 2’s keyword arguments. There were several calls to the same initialization function that followed a pattern that made it a good candidate for a series of `%s` calls using key-value pairs in a dictionary.

    Interesting how vimscript uses a leading slash as line continuation instead of a trailing slash at the end of the continued line.

    Also, it took me a while to figure out that interpolating a variable in an Ex command required “execute” and string concatenation with periods.

    let fields = { 'public_key' : 'public_pem_key',
                  \'private_key' : 'private_pem_key',
                  \'username' : 'username',
                  \'password' : 'password',
                  \'url' : 'url',
                  \'ssl_verify_host' : 'ssl_verify_host'
                \}
    
    for key in keys(fields)
      execute '%s/\([ \t]*\)\(.*TestCommon::' . fields[key] . '\)/\1' . key . ': \2/'
    endfor
    
     
  • ThomasPowell 8:26 pm on September 3, 2014 Permalink
    Tags: vim   

    powerline vim, NameError, invalid expression error on the latest update. 

    I have vim with pathogen and on the latest update of the powerline.vim, everything broke.

    It turns out that my old default config files are incompatible with the new version of powerline. See GitHub issue.

    When I ran vim with --cmd 'let g:powerline_config_overrides={"common":{"log_file":"/tmp/powerline.log"}}' as suggested, a bunch of config mapping errors showed up:

    2014-09-03 15:36:33,992:ERROR:vim:matcher_generator:Failed to import attr ctrlp from module powerline.matchers.plugin.ctrlp: No module named plugin.ctrlp
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/__init__.py", line 311, in get_module_attr
        return getattr(__import__(module, fromlist=(attr,)), attr)
    ImportError: No module named plugin.ctrlp
    2014-09-03 15:36:33,993:ERROR:vim:matcher_generator:Failed to import attr gundo_preview from module powerline.matchers.plugin.gundo: No module named plugin.gundo
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/__init__.py", line 311, in get_module_attr
        return getattr(__import__(module, fromlist=(attr,)), attr)
    ImportError: No module named plugin.gundo
    2014-09-03 15:36:33,995:ERROR:vim:matcher_generator:Failed to import attr nerdtree from module powerline.matchers.plugin.nerdtree: No module named plugin.nerdtree
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/__init__.py", line 311, in get_module_attr
        return getattr(__import__(module, fromlist=(attr,)), attr)
    ImportError: No module named plugin.nerdtree
    2014-09-03 15:36:33,998:ERROR:vim:matcher_generator:Failed to import attr gundo from module powerline.matchers.plugin.gundo: No module named plugin.gundo
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/__init__.py", line 311, in get_module_attr
        return getattr(__import__(module, fromlist=(attr,)), attr)
    ImportError: No module named plugin.gundo
    2014-09-03 15:36:34,010:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'mode', u'exclude_modes': [u'nc']}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,010:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 10, u'name': u'visual_range', u'exclude_modes': [u'nc']}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 10, u'name': u'paste_indicator', u'exclude_modes': [u'nc']}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 30, u'name': u'branch', u'exclude_modes': [u'nc']}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'after': u' ', u'name': u'readonly_indicator', u'draw_soft_divider': False}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 40, u'name': u'file_directory', u'draw_soft_divider': False}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'file_name', u'draw_soft_divider': False}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'file_vcs_status', u'draw_soft_divider': False, u'before': u' '}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'modified_indicator', u'before': u' '}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 50, u'module': u'powerline.segments.plugin.syntastic', u'exclude_modes': [u'nc'], u'name': u'syntastic'}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,011:ERROR:vim:segment_generator:Failed to generate segment from {u'draw_soft_divider': False, u'priority': 50, u'module': u'powerline.segments.plugin.tagbar', u'exclude_modes': [u'nc'], u'name': u'current_tag'}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 60, u'name': u'file_format', u'draw_soft_divider': False, u'exclude_modes': [u'nc']}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 60, u'name': u'file_encoding', u'exclude_modes': [u'nc']}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 60, u'name': u'file_type', u'exclude_modes': [u'nc']}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'priority': 50, u'width': 4, u'align': u'r', u'name': u'line_percent'}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'width': 3, u'align': u'r', u'name': u'line_current', u'draw_soft_divider': False}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    2014-09-03 15:36:34,012:ERROR:vim:segment_generator:Failed to generate segment from {u'name': u'virtcol_current', u'align': u'l', u'priority': 20, u'width': 3, u'draw_soft_divider': False, u'before': u':'}: u'function'
    Traceback (most recent call last):
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 240, in get
        contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
      File "/Users/tpowell/.vim/bundle/powerline/powerline/segment.py", line 62, in get_function
        function_name = segment['function']
    KeyError: u'function'
    

    The quickest solution is to take the new default config files and dump them in your ~/.config/powerline directory.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
%d bloggers like this: