Support different config paths (#426)

This makes the configuration files work if neovim's config path is different from `~/.config/nvim`.
This commit is contained in:
Amandus Søve Thorsrud 2021-05-26 01:08:15 +02:00 committed by GitHub
parent 046d3e79a9
commit 74ffae99d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 11 deletions

View file

@ -1,5 +1,5 @@
require('lv-globals')
vim.cmd('luafile ~/.config/nvim/lv-settings.lua')
vim.cmd('luafile '..CONFIG_PATH..'/lv-settings.lua')
require('settings')
require('plugins')
require('lv-utils')
@ -20,7 +20,7 @@ require('lv-rnvimr')
require('lv-which-key')
-- TODO is there a way to do this without vimscript
vim.cmd('source ~/.config/nvim/vimscript/functions.vim')
vim.cmd('source '..CONFIG_PATH..'/vimscript/functions.vim')
-- LSP
require('lsp')

View file

@ -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)

View file

@ -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, {

View file

@ -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 = {

View file

@ -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

View file

@ -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')

View file

@ -1,6 +1,6 @@
" packadd quickscope
luafile ~/.config/nvim/lua/settings.lua
execute 'luafile ' . stdpath('config') . '/lua/settings.lua'
function! s:manageEditorSize(...)
let count = a:1