Add neovim (#45)
I am using the "app_dirs" crate to discover `~/.config` on Unix and `%APPDATA%/` on Windows.
This commit is contained in:
committed by
Roey Darwish Dror
parent
35dbab8beb
commit
758d835b7e
23
src/vim.rs
23
src/vim.rs
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user