Bloated LunarVim

May 1, 2025 ยท View on GitHub

Important

i have fully migrated to lazyvim based configuration


Do not use as is, use it as a source of inspiration.

I've customized my ZSH/Tmux/Wezterm too much, so it might not work properly ๐Ÿ˜…

Screenshot 2024-06-04 at 18 26 59
Table of Contents (๐Ÿ”Ž Click to expand/collapse)

Theme

Themes are automatically changed based on time of the day:

ThemeTime of the day
rose-pine[1am, 9am)
tokyonight[9am, 5pm)
catppuccin[5pm, 9pm)
kanagawa[9pm, 11:59pm), [0am, 1am]

You can change this in plugins.lua and theme.lua or just disable it and install your own theme

lvim.colorscheme = "catppuccin"
lvim.builtin.time_based_themes = false
lvim.plugins = {
  {
    "catppuccin/nvim",
    as = "catppuccin",
    config = function()
      require("catppuccin").setup()
    end,
  }
}

Customization

Customization (๐Ÿ”Ž Click to expand/collapse)
  • I'm using neovim 0.11 head
  • Do not use as is, too much bloated! Also do not use on a potato PC!!
  • i have a auto command to disable syntax,etc when you open files larger than 1MB
  • if you don't want to use harpoon, disable it
    • lvim.builtin.harpoon = { active = false }
  • if you want to try out GitHub copilot, change the following
    • lvim.builtin.sell_your_soul_to_devil = { active = true, prada = false }
    • in case you want to use cmp-copilot, set prada=true after copilot installation
  • I use a custom lualine disable it if you don't like it
    • lvim.builtin.fancy_statusline = { active = false }
  • You can use the diffview plugin instead of normal gitsigns diff
    • lvim.builtin.fancy_diff = { active = true }
  • if you want to use debugging, change the following line to true, also install codelldb:
    • lvim.builtin.dap.active = true
  • sometimes instead of saving you jump trough jumplist ๐Ÿ˜ข just disable nvim-lastplace
    • lvim.builtin.lastplace = { active = false }
  • sometimes cmp-tabnine doesn't play nice, you can disable it :)
    • lvim.builtin.tabnine = { active = false }
  • if you don't need testing, just disable it (use ultest or neotest)
    • lvim.builtin.test_runner = { active = false, runner = "ultest" }
  • if you don't want cheat.sh integration, disable it
    • lvim.builtin.cheat = { active = false }
  • if you don't want the SQL integration, disable it
    • lvim.builtin.sql_integration = { active = false }
  • if you don't like smooth scrolling, disable it
    • lvim.builtin.smooth_scroll= ""
  • if you want an obvious focused window, and you don't get seizures from it
    • lvim.builtin.nonumber_unfocus = true
  • choose between hop and leap or flash as your favorite motion provider
    • lvim.builtin.motion_provider = "hop"
  • choose between filename->incline and treesitter->winbar or navic as your winbar provider
    • lvim.builtin.winbar_provider = "treesitter"
  • if you don't need CSV support, disable it
    • lvim.builtin.csv_support = false
  • if you want to use the cool make and run system, enable it
    • lvim.builtin.task_runner = "async_tasks"
  • you can choose between nvimtree and neo-tree as your file tree viewer
    • lvim.builtin.tree_provider = "neo-tree"
  • you can use noice.nvim if you want
    • lvim.builtin.noice = { active = true }
  • If you wanna see the issues, change default_diagnostic_config.virtual_text inside builtin.lua
  • I'm using skim for latex stuff, change it to zathura if you are on linux

Install

Prerequisites (๐Ÿ”Ž Click to expand/collapse)

Prerequisites

  brew install neovim --nightly
curl --proto '=https' --tlsv1.2 -sSf "https://sh.rustup.rs" | sh
cargo install ripgrep fd-find
  • NodeJS >= v16.13.0 most language servers need this
brew install node
bash <(curl -s "https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh")
mv ~/.config/lvim ~/.config/lvim_backup
git clone https://github.com/abzcoding/lvim.git ~/.config/lvim
lvim +LvimUpdate +LvimCacheReset +q
lvim # run :Lazy sync

Java

Java (๐Ÿ”Ž Click to expand/collapse)

Please run the following to have a better debugging and testing support for java

mkdir -p ~/workspace
git clone --branch main --depth 1 https://github.com/microsoft/java-debug ~/.config/lvim/.java-debug
cd ~/.config/lvim/.java-debug/
mvn clean install
git clone --branch main --depth 1 git@github.com:microsoft/vscode-java-test.git ~/.config/lvim/.vscode-java-test
cd ~/.config/lvim/.vscode-java-test
npm install
npm run build-plugin

On macOS with Homebrew, choose one of the Nerd Fonts, for example, here are some popular fonts:

brew tap homebrew/cask-fonts
brew search nerd-font
brew install --cask font-fira-code-nerd-font
brew install --cask font-victor-mono-nerd-font
brew install --cask font-iosevka-nerd-font-mono
brew install --cask font-hack-nerd-font
Other Stuff (๐Ÿ”Ž Click to expand/collapse)

Language-Server Protocol (LSP)

To leverage LSP auto-completions and other functionalities, after you open a file in Neovim, run :MasonInstall <server> to use mason installation feature. Use Tab to list available servers.

Upgrade

cd ~/.config/lvim
git pull
lvim # run :Lazy sync

You can use mason to install these:

cargo install selene  # if you want to use selene instead of luacheck
brew install hadolint  # if you want to lint dockerfiles
pip install vim-vint  # for vim linting
# install llvm and clang_format for clang stuff
npm install -g @fsouza/prettierd # if you want to use prettierd
pip install yapf flake8 black  # for python stuff
# if you want to use the markdown thingy
brew install vale markdownlint-cli
cp -r ~/.config/lvim/.vale ~/.config/vale
# fix the address inside .vale.ini
cp ~/.config/lvim/vale_config.ini ~/.vale.ini
# if you want the latex stuff
# brew install --cask mactex-no-gui # for mac
# or install zathura and chktex on linux

In case you want a better tex support in mac, check this out

if you want the custom gostructhelper, first get the pkg:

cd /tmp
git clone https://github.com/vanhtuan0409/gostructhelper.git
cd gostructhelper/cmds/gostructhelper
go build -o /usr/local/bin/gostructhelper && chmod 0755 /usr/local/bin/gostructhelper

Collaborative Editing

Collaborative Editing (๐Ÿ”Ž Click to expand/collapse)

The default is to serve localhost only, on port 8080. For a more advanced (remote server) overview see Deploy a server

Server side

  • :InstantStartServer [host] [port] : Start the server using
    • :InstantStartSingle [host] [port] : This only shares the current buffer.
    • :InstantStartSession [host] [port] :This shares all opened (and newly opened) buffers with the other clients

Client side

  • let g:instant_username="sth" : Set your preferred username.
    • :InstantJoinSingle [host] [port] : Use this command if another client already initiated a single share.
    • :InstantJoinSession [host] [port] : Use this command if another client already initiated a session share

Screenshot

Screenshots (๐Ÿ”Ž Click to expand/collapse) Screenshot 2024-06-04 at 18 30 21

BufferLine

Screenshot 2024-06-04 at 18 30 53

StatusLine

Screenshot 2024-06-04 at 18 32 55

Dashboard

Screenshot 2024-06-04 at 18 33 48 Screenshot 2024-06-04 at 18 33 56

lsp_signature

lsp_signature_2 lsp_signature

Tabnine

tabnine

Lang Server

completion Screen Shot 2021-10-18 at 5 43 22 PM

diagnostics using gl Screen_Shot_2021-07-31_at_7 54 52_PM

code_actions using ga Screen Shot 2021-10-18 at 6 25 58 PM

code_lens and inlay_hints when supported by lang server Screen Shot 2021-10-18 at 6 26 47 PM

references in qf Screen Shot 2021-10-18 at 6 31 03 PM

treesitter backed folding Screen Shot 2021-10-18 at 6 05 29 PM

peek using gp

Screen Shot 2021-10-18 at 6 33 06 PM

rename using <leader>lr

Screen Shot 2021-11-04 at 3 54 15 PM

Builtin Terminal

Screen Shot 2021-10-18 at 6 07 13 PM

Test

Screen Shot 2021-10-18 at 6 13 22 PM

ETC

k8s help

Screen Shot 2021-10-18 at 6 23 21 PM

lazy git integration

Screen Shot 2021-10-18 at 6 27 45 PM

zen mode

Screen Shot 2021-10-18 at 6 30 00 PM

Cheat.sh integration

use <leader>? Screen Shot 2021-10-18 at 6 02 31 PM

Screen Shot 2021-10-18 at 6 01 34 PM

Symbols Outline

Screen Shot 2021-10-18 at 6 03 57 PM

Plugins Included

Plugins (๐Ÿ”Ž Click to expand/collapse)

Optional Plugins

Structure

Structure (๐Ÿ”Ž Click to expand/collapse)

Custom Key-mappings

Note that,

  • Leader key set as Space
Key-mappings (๐Ÿ”Ž Click to expand/collapse)
Modes: ๐=normal ๐•=visual ๐’=select ๐ˆ=insert ๐‚=command

UI

KeyModeActionPlugin or Mapping
Space+e๐Open file treeNvimTree
Space+o๐Open symbolsSymbols-outline
Space+f๐Open file finderTelescope
Space+h๐Remove highlightnohlsearch<
Space+/๐Toggle commentComment.nvim
Space+?๐Open cheatscheat.sh
Space+I๐Inlay Hintsrequire('vim.lsp._inlay_hint').refresh()
Space+'๐Open markswhich-key marks
Space+z๐Zen modezen-mode.nvim
Space+P๐Projectsproject.nvim
Ctrl+</kbd>๐ˆ ๐Open terminaltoggleterm.nvim
Alt+0๐ˆ ๐Vertical terminaltoggleterm.nvim
Ctrl+s๐ˆShow signature helpvim.lsp.buf.signature_help()
Alt+s๐ˆSnippet selectionTelescope luasnip extension
Space+C or Ctrl+P๐Command Palettelegendary.nvim

Motion

KeyModeActionPlugin or Mapping
f๐find next characterHopChar1CurrentLineAC or leap_f or Flash.CharActions
F๐find previous characterHopChar1CurrentLineBC or leap_F or Flash.CharActions
s๐find characterHopChar2MW or leap_s or require("flash").jump()
S๐find wordHopWordMW or leap_S or 2char jump
Alt+a๐ˆselect allggVG
Alt+a๐increment numberC-A
Alt+x๐decrement numberC-X

LSP

KeyModeAction
Tab / Shift-Tab๐ˆNavigate completion-menu
Enter๐ˆSelect completion or expand snippet
Upor Down๐ˆMovement in completion pop-up
]+d๐Next diagnostic
[+d๐Previous diagnostic
Space+l+j or Space+l+k๐Next/previous LSP diagnostic
Space+l+r๐replace current word in project
Ctrl+e๐ˆClose pop-up
Tab / Shift-Tab๐ˆ ๐’Navigate snippet placeholders
Space+l๐keybindings for lsp
g+a๐code actions
g+A๐codelens actions
g+d๐goto definition
g+t๐goto type definition
g+D๐goto declaration
g+I๐goto implementation
g+p๐peek implementation
g+r๐goto references
g+s๐show signature help

Plugin: AsyncTasks

KeyModeAction
Space+m+f๐Build File
Space+m+p๐Build Project
Space+m+e๐Edit Tasks
Space+m+l๐List Tasks
Space+r+f๐Run File
Space+r+l๐Run Last
Space+r+p๐Run Project

Plugin: Gitsigns

KeyModeAction
Space+g+j or Space+g+k๐Next/previous Git hunk
Space+g+p๐Preview hunk
Space+g+l๐Blame line
Space+g+s๐ ๐•Stage hunk
Space+g+u๐Undo stage hunk
Space+g+d๐Diff to head
Space+g+h๐Buffer git history
Space+g+R๐ ๐•Reset hunk

Plugin: LazyGit

KeyModeAction
Space+g+g๐Open lazy git UI

Plugin: Telescope

KeyModeAction
Space+f๐File search
Space+P๐Project search
Space+s+s๐Grep search
Space+s+f๐Telescope find_files
Space+s+e๐Telescope file_browser
Space+F+l๐Reopen last search
Space+b+f๐Buffers
Space+s+c๐Colorschemes
Space+s+C๐Command history
Space+s+h๐Find help
Space+s+k๐Keymap search
Space+s+M๐Man Pages search
Space+s+r๐Register search
Space+s+t๐•Grep string under cursor
Space+s+t๐Grep raw
Space+F+b๐Builtin search
Space+F+f๐Current buffer search
Space+F+g๐Git files search
Space+F+i๐Installed plugins
Space+F+p๐Project search
Space+F+i๐Installed plugins
in Telescope window
CR๐ˆ ๐Multi/Single Open
Ctrl+c๐ˆ ๐Exit telescope
Ctrl+v๐ˆ ๐Open in a vertical split
Ctrl+s๐ˆ ๐Open in a split
Ctrl+t๐ˆ ๐Open in a tab
Ctrl+b๐ˆGo back in Command Palette
Tab๐ˆ ๐Toggle Selection + Next
Shift+Tab๐ˆ ๐Toggle Selection + Prev

Plugin: Harpoon

KeyModeAction
Space+Space๐Show harpoon shortlist
Space+a๐Add file to shortlist
Space+1๐Jump to first file on shortlist
Space+2๐Jump to second file on shortlist
Space+3๐Jump to third file on shortlist
Space+4๐Jump to forth file on shortlist

Plugin: Neogen

KeyModeAction
Space+n+c๐Class documentation
Space+n+f๐Function documentation
Space+n+t๐Type documentation
Space+n+F๐File documentation

Plugin: Persistence

KeyModeAction
Space+q+d๐Delete Session
Space+q+l๐Load Session
Space+q+s๐Save Session

Plugin: Bufferline

KeyModeAction
Shift+x๐Close buffer
Space+b+f๐Find buffer
Space+b+b๐Toggle buffer groups
Space+b+p๐Toggle pin
Space+b+s๐Pick buffer
Space+b+1๐Goto buffer 1
Space+b+h๐Close all to left
Space+b+l๐Close all to right
Space+b+D๐Sort by directory
Space+b+L๐Sort by language

Plugin: Trouble

KeyModeAction
Space+T+d๐Diagnostics
Space+T+f๐Definitions
Space+T+r๐References
Space+T+t๐Todo
Space+T+w๐Workspace diagnostics

Plugin: Ultest

KeyModeAction
Space+t+f๐Run all tests in a file
Space+t+n๐Only run nearest test
Space+t+s๐Open test summary

Plugin: Neotest

KeyModeAction
Space+t+a๐Run all tests
Space+t+f๐Run tests in a file
Space+t+r๐Only run nearest test
Space+t+s๐Open test summary
Space+t+o๐Open test output
Space+t+w๐Watch test
Space+t+x๐Stop test
Space+t+n๐Jump to next failed test
Space+t+p๐Jump to previous failed test
Space+t+c๐Cancel test

Plugin: Spectre

KeyModeAction
Space+R+p๐Replace word in project
Space+R+w๐Replace visually selected word
Space+R+f๐Replace word in current buffer

Plugin: SSR

KeyModeAction
Space+r๐•Structural replace confirm using <leader><cr>
Space+R+s๐Structural replace confirm using <leader><cr>

Plugin: Copilot

KeyModeAction
Ctrl+h๐ˆcopilot#Accept("<CR>")
Ctrl+e๐ˆClose cmp menu
Ctrl+]๐ˆ<Plug>(copilot-dismiss)
Alt+]๐ˆ<Plug>(copilot-next)
Alt+[๐ˆ<Plug>(copilot-previous)
Alt+</kbd>๐ˆ"<Cmd>vertical Copilot panel<CR>"

Plugin: Lsp_Lines

KeyModeAction
Space+v๐Toggle showing lsp_lines

Plugin: Overseer

KeyModeAction
Space+r+f๐Run
Space+r+p๐Run with cmd
Space+r+t๐Toggle output
Space+m+n๐New Task
Space+m+l๐Load Task Bundle
Space+m+s๐Save Task Bundle
Space+m+q๐Quick Action
Space+m+f๐Task Action

Plugin: NeoTree

KeyModeAction
Space+e๐Toggle tree
> and <๐Next and prev source inside tree
Enter๐Open
s๐Open in vertical split
S๐Open in horizontal spit
H๐Toggle hidden files
a๐Add files/dirs
A๐Add new dir
r๐Rename
h๐Go Updir
l๐Open
P๐Toggle preview
/๐Fuzzy finder

Plugin: Mind

KeyModeAction
Space+M+M๐Open Main Tree
Space+M+m๐Open Local Tree
Enter๐open data
Tab๐toggle node
Shift+Tab๐toggle parent
/๐select path
$๐change icons menu
c๐create new node
q๐quit

Troubleshooting

  1. Check your neovim version. Are you on the newest nightly version?
  2. make sure to run :Lazy sync
  3. Reset your Lunarvim cache using :LvimCacheReset