make "Edit Config" option work for any path
This commit is contained in:
parent
b3110c9a9b
commit
0f0618a81b
1 changed files with 2 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ function M.configmenu()
|
|||
'a'
|
||||
}
|
||||
if entry.value == "Edit Config" then
|
||||
lines = misc.readf(os.getenv('XDG_CONFIG_HOME')..'/nvim/init.lua')
|
||||
lines = misc.readf(vim.fn.stdpath('config')..'/init.lua')
|
||||
local ft = vim.filetype.match({
|
||||
filename = os.getenv('XDG_CONFIG_HOME')..'/nvim/init.lua' })
|
||||
require("telescope.previewers.utils").highlighter(self.state.bufnr, ft)
|
||||
|
|
@ -58,7 +58,7 @@ function M.configmenu()
|
|||
actions.close(bufnr)
|
||||
local selection = action_state.get_selected_entry()
|
||||
if selection[1] == 'Edit Config' then
|
||||
vim.cmd('e $XDG_CONFIG_HOME/nvim/init.lua')
|
||||
vim.cmd('e '..vim.fn.stdpath('config')..'/init.lua')
|
||||
elseif selection[1] == 'Update Plugins' then
|
||||
require('dep').sync()
|
||||
if package.loaded['nvim-treesitter'] then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue