summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua14
-rw-r--r--lua/core/dashboard.lua7
-rw-r--r--lua/core/galaxyline.lua2
-rw-r--r--lua/core/linter.lua2
-rw-r--r--lua/core/which-key.lua2
-rw-r--r--lua/default-config.lua4
-rw-r--r--lua/lang/java.lua3
-rw-r--r--lua/lang/lua.lua3
-rw-r--r--lua/lv-utils/init.lua12
-rw-r--r--lua/plugin-loader.lua9
-rwxr-xr-xutils/bin/jdtls6
-rwxr-xr-xutils/bin/lvim3
-rwxr-xr-xutils/installer/install.sh35
13 files changed, 63 insertions, 39 deletions
diff --git a/init.lua b/init.lua
index 6a09c909..09b2aaf6 100644
--- a/init.lua
+++ b/init.lua
@@ -1,5 +1,17 @@
+vim.cmd [[
+ set packpath-=~/.config/nvim
+ set packpath-=~/.config/nvim/after
+ set packpath-=~/.local/share/nvim/site
+ set packpath^=~/.local/share/lunarvim/site
+ set packpath^=~/.config/lvim
+
+ set runtimepath-=~/.config/nvim
+ set runtimepath-=~/.config/nvim/after
+ set runtimepath^=~/.config/lvim
+]]
+-- vim.opt.rtp:append() instead of vim.cmd ?
require "default-config"
-local status_ok, error = pcall(vim.cmd, "luafile " .. CONFIG_PATH .. "/lv-config.lua")
+local status_ok, error = pcall(vim.cmd, "luafile ~/.config/lvim/lv-config.lua")
if not status_ok then
print "something is wrong with your lv-config"
print(error)
diff --git a/lua/core/dashboard.lua b/lua/core/dashboard.lua
index 73f62c25..a1af5319 100644
--- a/lua/core/dashboard.lua
+++ b/lua/core/dashboard.lua
@@ -43,7 +43,8 @@ M.config = function()
},
d = {
description = { " Settings " },
- command = ":e " .. CONFIG_PATH .. "/lv-config.lua",
+ -- command = ":e " .. CONFIG_PATH .. "/lv-config.lua",
+ command = ":e ~/.config/lvim/lv-config.lua",
},
},
@@ -67,8 +68,8 @@ M.setup = function()
-- command = "Telescope find_files cwd=" .. CONFIG_PATH,
-- },
-- e = {description = {'ï‚— Marks '}, command = 'Telescope marks'}
- vim.cmd "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'"
- vim.cmd "let packages = len(globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1))"
+ vim.cmd 'let g:dashboard_session_directory = "~/.config/lvim/.sessions"'
+ vim.cmd "let packages = len(globpath('~/.local/share/lunarvim/site/pack/packer/start', '*', 0, 1))"
vim.api.nvim_exec(
[[
diff --git a/lua/core/galaxyline.lua b/lua/core/galaxyline.lua
index 2cb175f4..f880e430 100644
--- a/lua/core/galaxyline.lua
+++ b/lua/core/galaxyline.lua
@@ -281,7 +281,7 @@ table.insert(gls.right, {
condition = condition.hide_in_width,
separator = " ",
separator_highlight = { "NONE", colors.alt_bg },
- highlight = { colors.alt_bg, colors.alt_bg },
+ highlight = { colors.grey, colors.alt_bg },
},
})
diff --git a/lua/core/linter.lua b/lua/core/linter.lua
index 676b0cf7..573d6d62 100644
--- a/lua/core/linter.lua
+++ b/lua/core/linter.lua
@@ -3,7 +3,7 @@ local M = {}
M.setup = function()
if O.lint_on_save then
require("lv-utils").define_augroups {
- autolint = {
+ autolint_on_save = {
{
"BufWritePost",
"<buffer>",
diff --git a/lua/core/which-key.lua b/lua/core/which-key.lua
index ec64074b..47661df6 100644
--- a/lua/core/which-key.lua
+++ b/lua/core/which-key.lua
@@ -64,7 +64,7 @@ M.config = function()
["w"] = { "<cmd>w!<CR>", "Save" },
["q"] = { "<cmd>q!<CR>", "Quit" },
["/"] = { "<cmd>CommentToggle<CR>", "Comment" },
- ["c"] = { "<cmd>BufferClose<CR>", "Close Buffer" },
+ ["c"] = { "<cmd>BufferClose!<CR>", "Close Buffer" },
["e"] = { "<cmd>lua require'core.nvimtree'.toggle_tree()<CR>", "Explorer" },
["f"] = { "<cmd>Telescope find_files<CR>", "Find File" },
["h"] = { '<cmd>let @/=""<CR>', "No Highlight" },
diff --git a/lua/default-config.lua b/lua/default-config.lua
index e245fe86..2503aaa2 100644
--- a/lua/default-config.lua
+++ b/lua/default-config.lua
@@ -1,4 +1,4 @@
-CONFIG_PATH = vim.fn.stdpath "config"
+CONFIG_PATH = os.getenv "HOME" .. "/.local/share/lunarvim/lvim"
DATA_PATH = vim.fn.stdpath "data"
CACHE_PATH = vim.fn.stdpath "cache"
TERMINAL = vim.fn.expand "$TERMINAL"
@@ -13,7 +13,7 @@ O = {
transparent_window = false,
format_on_save = true,
lint_on_save = true,
- vsnip_dir = vim.fn.stdpath "config" .. "/snippets",
+ vsnip_dir = os.getenv "HOME" .. "/.config/snippets",
default_options = {
backup = false, -- creates a backup file
diff --git a/lua/lang/java.lua b/lua/lang/java.lua
index 73358317..d84c0000 100644
--- a/lua/lang/java.lua
+++ b/lua/lang/java.lua
@@ -58,7 +58,8 @@ M.lsp = function()
else
print "Unsupported system"
end
- JAVA_LS_EXECUTABLE = CONFIG_PATH .. "/utils/bin/jdtls"
+
+ JAVA_LS_EXECUTABLE = os.getenv "HOME" .. "/.local/share/lunarvim/lvim/utils/bin/jdtls"
require("jdtls").start_or_attach {
on_attach = require("lsp").common_on_attach,
diff --git a/lua/lang/lua.lua b/lua/lang/lua.lua
index 415e0849..02b2decf 100644
--- a/lua/lang/lua.lua
+++ b/lua/lang/lua.lua
@@ -59,11 +59,12 @@ M.lsp = function()
},
diagnostics = {
-- Get the language server to recognize the `vim` global
- globals = { "vim" },
+ globals = { "vim", "O" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = {
+ [vim.fn.expand "~/.local/share/lunarvim/lvim/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
},
diff --git a/lua/lv-utils/init.lua b/lua/lv-utils/init.lua
index 1776a020..3dff8f2e 100644
--- a/lua/lv-utils/init.lua
+++ b/lua/lv-utils/init.lua
@@ -57,11 +57,13 @@ function lv_utils.generate_settings()
end
function lv_utils.reload_lv_config()
- vim.cmd "source ~/.config/nvim/lua/keymappings.lua"
- vim.cmd "source ~/.config/nvim/lv-config.lua"
- vim.cmd "source ~/.config/nvim/lua/plugins.lua"
- vim.cmd "source ~/.config/nvim/lua/settings.lua"
- vim.cmd "source ~/.config/nvim/lua/core/formatter.lua"
+ vim.cmd "source ~/.config/lvim/lv-config.lua"
+ vim.cmd "source ~/.local/share/lunarvim/lvim/lua/plugins.lua"
+ local plugins = require "plugins"
+ local plugin_loader = require("plugin-loader").init()
+ plugin_loader:load { plugins, O.user_plugins }
+ vim.cmd "source ~/.local/share/lunarvim/lvim/lua/settings.lua"
+ vim.cmd "source ~/.local/share/lunarvim/lvim/lua/core/formatter.lua"
vim.cmd ":PackerCompile"
vim.cmd ":PackerInstall"
-- vim.cmd ":PackerClean"
diff --git a/lua/plugin-loader.lua b/lua/plugin-loader.lua
index 25a41111..b7e68a1e 100644
--- a/lua/plugin-loader.lua
+++ b/lua/plugin-loader.lua
@@ -4,7 +4,7 @@ function plugin_loader:init()
local execute = vim.api.nvim_command
local fn = vim.fn
- local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim"
+ local install_path = "~/.local/share/lunarvim/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
execute "packadd packer.nvim"
@@ -15,12 +15,15 @@ function plugin_loader:init()
return
end
+ local util = require "packer.util"
+
packer.init {
- -- package_root = require("packer.util").join_paths(vim.fn.stdpath "data", "lvim", "pack"),
+ package_root = util.join_paths "~/.local/share/lunarvim/site/pack/",
+ compile_path = util.join_paths("~/.config/lvim", "plugin", "packer_compiled.lua"),
git = { clone_timeout = 300 },
display = {
open_fn = function()
- return require("packer.util").float { border = "single" }
+ return util.float { border = "single" }
end,
},
}
diff --git a/utils/bin/jdtls b/utils/bin/jdtls
index f23d85dd..adfd5e20 100755
--- a/utils/bin/jdtls
+++ b/utils/bin/jdtls
@@ -40,16 +40,16 @@ fi
# JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar"
JAR="$HOME/.local/share/nvim/lspinstall/java/plugins/org.eclipse.equinox.launcher_*.jar"
-GRADLE_HOME="$HOME/gradle" "$JAVACMD" \
+GRADLE_HOME=$HOME/gradle "$JAVACMD" \
-Declipse.application=org.eclipse.jdt.ls.core.id1 \
-Dosgi.bundles.defaultStartLevel=4 \
-Declipse.product=org.eclipse.jdt.ls.core.product \
-Dlog.protocol=true \
-Dlog.level=ALL \
- -javaagent:"$HOME/.local/share/nvim/lspinstall/java/lombok.jar" \
+ -javaagent:$HOME/.local/share/nvim/lspinstall/java/lombok.jar \
-Xms1g \
-Xmx2G \
- -jar "$JAR" \
+ -jar $(echo "$JAR") \
-configuration "$CONFIG" \
-data "${1:-$HOME/workspace}" \
--add-modules=ALL-SYSTEM \
diff --git a/utils/bin/lvim b/utils/bin/lvim
new file mode 100755
index 00000000..0ef96a90
--- /dev/null
+++ b/utils/bin/lvim
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" "$@"
diff --git a/utils/installer/install.sh b/utils/installer/install.sh
index c6b57a66..2840f085 100755
--- a/utils/installer/install.sh
+++ b/utils/installer/install.sh
@@ -15,9 +15,9 @@ installnodeubuntu() {
sudo apt install npm
}
-moveoldnvim() {
+moveoldlvim() {
echo "Not installing LunarVim"
- echo "Please move your ~/.config/nvim folder before installing"
+ echo "Please move your ~/.local/share/lunarvim folder before installing"
exit
}
@@ -96,25 +96,27 @@ installpynvim() {
}
installpacker() {
- git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
+ git clone https://github.com/wbthomason/packer.nvim ~/.local/share/lunarvim/site/pack/packer/start/packer.nvim
}
cloneconfig() {
echo "Cloning LunarVim configuration"
- git clone --branch "$LVBRANCH" https://github.com/ChristianChiarulli/lunarvim.git ~/.config/nvim
- cp "$HOME/.config/nvim/utils/installer/lv-config.example-no-ts.lua" "$HOME/.config/nvim/lv-config.lua"
- nvim --headless \
+ git clone --branch "$LVBRANCH" https://github.com/ChristianChiarulli/lunarvim.git ~/.local/share/lunarvim/lvim
+ mkdir -p "$HOME/.config/lvim"
+ sudo cp "$HOME/.local/share/lunarvim/lvim/utils/bin/lvim" "/usr/local/bin"
+ cp "$HOME/.local/share/lunarvim/lvim/utils/installer/lv-config.example-no-ts.lua" "$HOME/.config/lvim/lv-config.lua"
+
+ nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" --headless \
+'autocmd User PackerComplete sleep 100m | qall' \
+PackerInstall
- nvim --headless \
+ nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" --headless \
+'autocmd User PackerComplete sleep 100m | qall' \
+PackerSync
printf "\nCompile Complete\n"
- rm "$HOME/.config/nvim/lv-config.lua"
- cp "$HOME/.config/nvim/utils/installer/lv-config.example.lua" "$HOME/.config/nvim/lv-config.lua"
- # nvim --headless -cq ':silent TSUpdate' -cq ':qall' >/dev/null 2>&1
+ rm "$HOME/.config/lvim/lv-config.lua"
+ cp "$HOME/.local/share/lunarvim/lvim/utils/installer/lv-config.example.lua" "$HOME/.config/lvim/lv-config.lua"
}
asktoinstallnode() {
@@ -176,15 +178,14 @@ echo 'Installing LunarVim'
case "$@" in
*--overwrite*)
- echo '!!Warning!! -> Removing all nvim related config because of the --overwrite flag'
- rm -rf "$HOME/.config/nvim"
+ echo '!!Warning!! -> Removing all lunarvim related config because of the --overwrite flag'
+ rm -rf "$HOME/.local/share/lunarvim"
rm -rf "$HOME/.cache/nvim"
- rm -rf "$HOME/.local/share/nvim/site/pack/packer"
;;
esac
-# move old nvim directory if it exists
-[ -d "$HOME/.config/nvim" ] && moveoldnvim
+# move old lvim directory if it exists
+[ -d "$HOME/.local/share/lunarvim" ] && moveoldlvim
# install pip
(command -v pip3 >/dev/null && echo "pip installed, moving on...") || asktoinstallpip
@@ -195,13 +196,13 @@ esac
# install pynvim
(pip3 list | grep pynvim >/dev/null && echo "pynvim installed, moving on...") || installpynvim
-if [ -e "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then
+if [ -e "$HOME/.local/share/lunarvim/site/pack/packer/start/packer.nvim" ]; then
echo 'packer already installed'
else
installpacker
fi
-if [ -e "$HOME/.config/nvim/init.lua" ]; then
+if [ -e "$HOME/.local/share/lunarvim/lvim/init.lua" ]; then
echo 'LunarVim already installed'
else
# clone config down