Skip to content

Instantly share code, notes, and snippets.

@zthxxx
Last active November 26, 2023 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zthxxx/8e759ebfe860a596f65ed0e29e9ffdcf to your computer and use it in GitHub Desktop.
Save zthxxx/8e759ebfe860a596f65ed0e29e9ffdcf to your computer and use it in GitHub Desktop.
installation for LunarVim
# https://www.lunarvim.org/
# https://www.lunarvim.org/docs/installation
brew install neovim rust
brew install --cask homebrew/cask-fonts/font-hack-nerd-font
# on linux without homebrew, install with AppImage
# apt install -y libfuse2
curl -fsSL https://github.com/neovim/neovim/releases/download/stable/nvim.appimage -o /usr/local/bin/nvim
chmod +x /usr/local/bin/nvim
# Or install with snap
# sudo apt install -y snapd
# sudo snap install --classic nvim
# export PATH=/snap/bin:$PATH
npm i -g neovim tree-sitter-cli
python3 -m pip install pynvim
# install lunarvim
## https://www.lunarvim.org/docs/installation
##
## install without asking confirm plugins (asking default in official)
LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh)
# curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh | LV_BRANCH='release-1.3/neovim-0.9' bash /dev/stdin --yes
# Download this configuration
# curl -sL https://gist.githubusercontent.com/zthxxx/8e759ebfe860a596f65ed0e29e9ffdcf/raw/config.lua -o ~/.config/lvim/config.lua
## or
mkdir -p ~/Project/Shell
# git clone git@gist.github.com:8e759ebfe860a596f65ed0e29e9ffdcf.git ~/Project/Shell/lunarvim-config
git clone https://gist.github.com/8e759ebfe860a596f65ed0e29e9ffdcf.git ~/Project/Shell/lunarvim-config
ln -fs ~/Project/Shell/lunarvim-config/config.lua ~/.config/lvim/config.lua
# I dont use `lvim` (add `lvim` to `$PATH`) or `~/.local/bin/lvim`,
# so make nvim start with lunarvim
echo '
export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"${HOME}/.local/share/lunarvim"}"
export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"${HOME}/.config/lvim"}"
export LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"${HOME}/.cache/lvim"}"
export EDITOR=nvim
' >> ~/.zshrc
ln -fs ~/.local/share/lunarvim/lvim ~/.config/nvim
# maybe need run `:LvimSyncCorePlugins` in nvim
# configs in `~/.config/lvim/config.lua`
# keys binding could see in https://github.com/LunarVim/LunarVim/blob/master/lua/lvim/core/which-key.lua
-- link this config file into `~/.config/lvim/config.lua`
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
-- Defaults in
-- - https://github.com/LunarVim/LunarVim/blob/1.3.0/lua/lvim/config/defaults.lua
-- - https://github.com/LunarVim/LunarVim/blob/1.3.0/lua/lvim/config/settings.lua
-- - https://github.com/LunarVim/LunarVim/tree/1.3.0/lua/lvim/core
---------- Custom settings ----------
-- Use which-key to add extra bindings with the leader-key prefix, default shortcuts:
-- https://github.com/LunarVim/LunarVim/blob/master/lua/lvim/core/which-key.lua
lvim.builtin.which_key.mappings["x"] = { "<cmd>x<CR>", "Save and quit" }
lvim.builtin.which_key.mappings["t"] = {
name = "+Terminal",
f = { "<cmd>ToggleTerm<cr>", "Floating terminal" },
v = { "<cmd>2ToggleTerm size=30 direction=vertical<cr>", "Split vertical" },
h = { "<cmd>2ToggleTerm size=30 direction=horizontal<cr>", "Split horizontal" },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment