summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorAmandus SΓΈve Thorsrud <[email protected]>2021-05-26 01:08:15 +0200
committerGitHub <[email protected]>2021-05-25 19:08:15 -0400
commit74ffae99d44ef8ed27df63ae0bf39c0dfe71ef99 (patch)
tree2d562a46849d6d683f5d3f9597a213005183b4a8 /lua
parent046d3e79a9dc8689175c0ecbd565ca423dde7b04 (diff)
Support different config paths (#426)
This makes the configuration files work if neovim's config path is different from `~/.config/nvim`.
Diffstat (limited to 'lua')
-rw-r--r--lua/lsp/java-ls.lua2
-rw-r--r--lua/lsp/ruby-ls.lua2
-rw-r--r--lua/lv-autocommands/init.lua2
-rw-r--r--lua/lv-dashboard/init.lua4
-rw-r--r--lua/lv-globals.lua7
5 files changed, 9 insertions, 8 deletions
diff --git a/lua/lsp/java-ls.lua b/lua/lsp/java-ls.lua
index fd603cbb..88f12498 100644
--- a/lua/lsp/java-ls.lua
+++ b/lua/lsp/java-ls.lua
@@ -15,7 +15,7 @@ end
local bundles = {
vim.fn.glob(
- "~/.config/nvim/.debuggers/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar")
+ CONFIG_PATH.."/.debuggers/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar")
};
local on_attach = function(client, bufr)
diff --git a/lua/lsp/ruby-ls.lua b/lua/lsp/ruby-ls.lua
index 41726743..fd314e8e 100644
--- a/lua/lsp/ruby-ls.lua
+++ b/lua/lsp/ruby-ls.lua
@@ -1,6 +1,6 @@
-- If you are using rvm, make sure to change below configuration
require'lspconfig'.solargraph.setup {
- cmd = { DATA_PATH .. "~/.rbenv/shims/solargraph", "--stdio" },
+ cmd = { DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "--stdio" },
on_attach = require'lsp'.common_on_attach,
handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
diff --git a/lua/lv-autocommands/init.lua b/lua/lv-autocommands/init.lua
index a7574f66..595e6768 100644
--- a/lua/lv-autocommands/init.lua
+++ b/lua/lv-autocommands/init.lua
@@ -40,7 +40,7 @@ utils.define_augroups({
-- {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'},
},
_java = {
- {'FileType', 'java', 'luafile ~/.config/nvim/lua/lsp/java-ls.lua'},
+ {'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'},
{'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'}
},
_go = {
diff --git a/lua/lv-dashboard/init.lua b/lua/lv-dashboard/init.lua
index 4bd706f3..6a57efe8 100644
--- a/lua/lv-dashboard/init.lua
+++ b/lua/lv-dashboard/init.lua
@@ -26,7 +26,7 @@ vim.g.dashboard_custom_section = {
b = {description = {'οƒ… Recently Used Files'}, command = 'Telescope oldfiles'},
c = {description = {'ο‘€ Load Last Session '}, command = 'SessionLoad'},
d = {description = {'οžƒ Find Word '}, command = 'Telescope live_grep'},
- e = {description = {'ξ˜• Settings '}, command = ':e ~/.config/nvim/lv-settings.lua'}
+ e = {description = {'ξ˜• Settings '}, command = ':e '..CONFIG_PATH..'/lv-settings.lua'}
-- e = {description = {'ο‚— Marks '}, command = 'Telescope marks'}
}
@@ -41,5 +41,5 @@ vim.g.dashboard_custom_section = {
-- }
-- find_history = 'SPC f h',
--- vim.g.dashboard_session_directory = '~/.cache/nvim/session'
+-- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
vim.g.dashboard_custom_footer = O.dashboard.footer
diff --git a/lua/lv-globals.lua b/lua/lv-globals.lua
index bed92a45..d8065b27 100644
--- a/lua/lv-globals.lua
+++ b/lua/lv-globals.lua
@@ -1,3 +1,7 @@
+CONFIG_PATH = vim.fn.stdpath('config')
+DATA_PATH = vim.fn.stdpath('data')
+CACHE_PATH = vim.fn.stdpath('cache')
+
O = {
auto_close_tree = 0,
auto_complete = true,
@@ -81,6 +85,3 @@ O = {
}
}
-DATA_PATH = vim.fn.stdpath('data')
-CACHE_PATH = vim.fn.stdpath('cache')
-