将ranger的默认编辑器配置成neovim

  • 打开~/.config/ranger/rifle.conf, 找到以下代码段:
    #-------------------------------------------
    # Misc
    #-------------------------------------------
    # Define the "editor" for text files as first action
    mime ^text,  label editor = $EDITOR -- "$@"
    mime ^text,  label pager  = "$PAGER" -- "$@"
    !mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
    !mime ^text, label pager,  ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
    
    
    将上面两个$EDITOR修改成nvim, 如下:
    #-------------------------------------------
    # Misc
    #-------------------------------------------
    # Define the "editor" for text files as first action
    mime ^text,  label editor = nvim -- "$@"
    mime ^text,  label pager  = "$PAGER" -- "$@"
    !mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = nvim -- "$@"
    !mime ^text, label pager,  ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
    
    下次再用ranger打开文件时, 默认编辑器就变成neovim

你可能感兴趣的:(linux,neovim,vim)