Add neovim (#45)

I am using the "app_dirs" crate to discover `~/.config` on Unix and `%APPDATA%/` on Windows.
This commit is contained in:
Thomas Versteeg
2018-07-04 09:51:19 +02:00
committed by Roey Darwish Dror
parent 35dbab8beb
commit 758d835b7e
5 changed files with 75 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
use super::home_path;
use std::fs;
use std::path::PathBuf;
use app_dirs::*;
#[derive(Debug, Clone, Copy)]
pub enum PluginFramework {
@@ -50,3 +51,25 @@ pub fn vimrc() -> Option<PathBuf> {
None
}
pub fn nvimrc() -> Option<PathBuf> {
{
let mut nvimrc = get_data_root(AppDataType::UserConfig).unwrap();
nvimrc.push("nvim/init.vim");
if nvimrc.exists() {
return Some(nvimrc);
}
}
{
let mut nvimrc = get_data_root(AppDataType::UserCache).unwrap();
nvimrc.push("nvim/init.vim");
if nvimrc.exists() {
return Some(nvimrc);
}
}
None
}