Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
fix: Replace hardcoded paths with utils.doom_root (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaw authored Aug 25, 2021
1 parent f97df94 commit 3bbb780
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 1 addition & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ async = vim.loop.new_async(vim.schedule_wrap(function()

-- If the dashboard plugin is already installed and the packer_compiled.lua
-- file exists so we can make sure that the dashboard have been loaded
local compiled_plugins_path = vim.fn.expand(
'$HOME/.config/doom-nvim/plugin/packer_compiled.lua'
)
local compiled_plugins_path = vim.fn.stdpath('config') .. '/plugin/packer_compiled.lua'
if vim.fn.filereadable(compiled_plugins_path) > 0 then
-- If the current buffer name is empty and dashboard-nvim is installed
-- then trigger Dashboard
Expand Down
8 changes: 6 additions & 2 deletions lua/doom/core/functions/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ M.quit_doom = function(write, force)
.. config.doom.colorscheme
.. "'/'"
.. target_colorscheme
.. '\'/" $HOME/.config/doom-nvim/doom_config.lua'
.. '\'/" '
.. utils.doom_root
.. '/doom_config.lua'
)
log.info(
'Colorscheme successfully changed to ' .. target_colorscheme
Expand All @@ -105,7 +107,9 @@ M.quit_doom = function(write, force)
.. config.doom.colorscheme_bg
.. "'/'"
.. target_background
.. '\'/" $HOME/.config/doom-nvim/doom_config.lua'
.. '\'/" '
.. utils.doom_root
.. '/doom_config.lua'
)
log.info('Background successfully changed to ' .. target_background)
end
Expand Down
2 changes: 1 addition & 1 deletion lua/doom/core/keybindings/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ utils.map('n', '<leader>bf', '<cmd>FormatWrite<CR>', opts)
utils.map(
'n',
'<leader>dc',
'<cmd>e ~/.config/doom-nvim/doom_config.lua<CR>',
'<cmd>e ' .. utils.doom_root .. '/doom_config.lua<CR>',
opts
)
utils.map('n', '<leader>dd', '<cmd>help doom_nvim<CR>', opts)
Expand Down
2 changes: 1 addition & 1 deletion lua/doom/modules/config/doom-dashboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ return function()
},
f = {
description = { ' Open Private Configuration SPC d c' },
command = ':e ~/.config/doom-nvim/doomrc',
command = ':e ' .. require('doom.utils').doom_root .. '/doomrc',
},
g = {
description = { ' Open Documentation SPC d d' },
Expand Down
2 changes: 1 addition & 1 deletion lua/doom/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local M = {}
M.doom_version = '3.0.12'

-- Local files
M.doom_root = vim.fn.expand('$HOME/.config/doom-nvim')
M.doom_root = vim.fn.stdpath('config')
M.doom_logs = vim.fn.stdpath('data') .. '/doom.log'
M.doom_report = vim.fn.stdpath('data') .. '/doom_report.md'

Expand Down

0 comments on commit 3bbb780

Please sign in to comment.