mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-11 12:25:59 +03:00
When searching for a vimrc path, first look for ~/.vscodevimrc (#8118)
This commit is contained in:
parent
d447a27c24
commit
2d7657e36f
@ -964,7 +964,7 @@
|
||||
},
|
||||
"vim.vimrc.path": {
|
||||
"type": "string",
|
||||
"markdownDescription": "Path to a Vim configuration file. If unset, it will check for `$HOME/.vimrc`, `$HOME/_vimrc`, and `$HOME/.config/nvim/init.vim`, in that order."
|
||||
"markdownDescription": "Path to a Vim configuration file. If unset, it will check for `$HOME/.vscodevimrc`, `$HOME/.vimrc`, `$HOME/_vimrc`, and `$HOME/.config/nvim/init.vim`, in that order."
|
||||
},
|
||||
"vim.substituteGlobalFlag": {
|
||||
"type": "boolean",
|
||||
|
@ -1,12 +1,13 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as fs from 'platform/fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'platform/fs';
|
||||
import * as vscode from 'vscode';
|
||||
import { IConfiguration, IVimrcKeyRemapping } from './iconfiguration';
|
||||
import { vimrcKeyRemappingBuilder } from './vimrcKeyRemappingBuilder';
|
||||
import { window } from 'vscode';
|
||||
import { Logger } from '../util/logger';
|
||||
import { configuration } from './configuration';
|
||||
import { IConfiguration, IVimrcKeyRemapping } from './iconfiguration';
|
||||
import { vimrcKeyRemappingBuilder } from './vimrcKeyRemappingBuilder';
|
||||
|
||||
export class VimrcImpl {
|
||||
private _vimrcPath?: string;
|
||||
@ -435,6 +436,11 @@ export class VimrcImpl {
|
||||
}
|
||||
|
||||
private static async findDefaultVimrc(): Promise<string | undefined> {
|
||||
const vscodeVimrcPath = path.join(os.homedir(), '.vscodevimrc');
|
||||
if (await fs.existsAsync(vscodeVimrcPath)) {
|
||||
return vscodeVimrcPath;
|
||||
}
|
||||
|
||||
let vimrcPath = path.join(os.homedir(), '.vimrc');
|
||||
if (await fs.existsAsync(vimrcPath)) {
|
||||
return vimrcPath;
|
||||
|
Loading…
Reference in New Issue
Block a user