欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-05-19 21:09:52
...
  • 打开~/.config/ranger/rifle.conf, 找到以下代码段:
    #-------------------------------------------
    # Misc
    #-------------------------------------------
    # Define the "editor" for text files as first action
    mime ^text,  label editor = $EDITOR -- "[email protected]"
    mime ^text,  label pager  = "$PAGER" -- "[email protected]"
    !mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "[email protected]"
    !mime ^text, label pager,  ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "[email protected]"
    
    
    将上面两个$EDITOR修改成nvim, 如下:
    #-------------------------------------------
    # Misc
    #-------------------------------------------
    # Define the "editor" for text files as first action
    mime ^text,  label editor = nvim -- "[email protected]"
    mime ^text,  label pager  = "$PAGER" -- "[email protected]"
    !mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = nvim -- "[email protected]"
    !mime ^text, label pager,  ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "[email protected]"
    
    下次再用ranger打开文件时, 默认编辑器就变成neovim
相关标签: linux neovim vim