lvim
lvim copied to clipboard
🧑🚀 Bloated LunarVim 🚀
Bloated LunarVim
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 😅
Table of Contents (🔎 Click to expand/collapse)
- Theme
- Customization
- Install
- Collaborative Editing
- Java
- Recommended Fonts
- Screenshot
- Structure
-
Plugins Included
- Optional Plugins
-
Custom Key-mappings
- Editor UI
- Motions
- LSP
- Plugin: AsyncTasks
- Plugin: Gitsigns
- Plugin: LazyGit
- Plugin: Telescope
- Plugin: Harpoon
- Plugin: Neogen
- Plugin: Persistence
- Plugin: Bufferline
- Plugin: Trouble
- Plugin: Ultest
- Plugin: Neotest
- Plugin: Spectre
- Plugin: Copilot
- Plugin: Lsp_Lines
- Plugin: Overseer
- Plugin: NeoTree
- Troubleshooting
Theme
Themes are automatically changed based on time of the day:
Theme | Time 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 on this PR of LunarVim and i am using
neovim 0.9 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
, setprada=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 normalgitsigns 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
compe-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
orneotest
)-
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 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
andneo-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, remove
lvim.lsp.diagnostics.virtual_text = false
- I'm using
skim
forlatex
stuff, change it tozathura
if you are onlinux
Install
Prerequisites (🔎 Click to expand/collapse)
Prerequisites
- Neovim >= v0.8.0
brew install neovim --nightly
-
Rust
and telescope stuff:
- ripgrep
- fd
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
# install LunarVim
mv ~/.config/lvim ~/.config/lvim_backup
git clone https://github.com/abzcoding/lvim.git ~/.config/lvim
lvim +LvimUpdate +LvimCacheReset +q
lvim # run :PackerSync
Java
Please run the following to have a better debugging and testing support for java
mkdir -p ~/workspace
git clone [email protected]:microsoft/java-debug.git ~/.config/lvim/.java-debug
cd ~/.config/lvim/.java-debug/
./mvnw clean install
git clone [email protected]:microsoft/vscode-java-test.git ~/.config/lvim/.vscode-java-test
cd ~/.config/lvim/.vscode-java-test
npm install
npm run build-plugin
Recommended Fonts
- FiraCode: My preferred nerd font
- Any of the Nerd Fonts
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 :PackerSync
Recommended Linters
You can use mason to install these:
brew install luarocks
luarocks install luacheck # if you want to use luacheck
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
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)

BufferLine

StatusLine

Dashboard


lsp_signature


Tabnine

Lang Server
completion
diagnostics using gl
code_actions using ga
code_lens
and inlay_hints
when supported by lang server
references in qf
treesitter backed folding
peek using gp

rename using <leader>lr

Builtin Terminal

Test

ETC
k8s help

lazy git integration

zen mode

Cheat.sh integration
use <leader>?

Symbols Outline

Plugins Included
Plugins (🔎 Click to expand/collapse)
- Doom One Theme
- Rose Pine Theme
- LSP Signature
- Todo Comments
- Trouble
- symbols-outline.nvim
- Twilight
- nvim-bqf
- vim match-up
- Markdown Preview for (Neo)vim
- Zen Mode
- rust-tools
- nvim-spectre
- colorizer.lua
- Neogen
- Vimtex
- typescript.nvim
- flutter-tools.nvim
- NeoClip
- Telescope live grep args
- fidget
- clangd_extensions.nvim
- crates.nvim
- refactoring.nvim
Optional Plugins
- Hop
- Leap
- remember.nvim
- Tabnine
- Persistence
- Presence
- Orgmode.nvim
- nvim-dap-ui
- LuaDev
- vim-test
- vim-ultest
- nvim-cheat
- vim-dadbod
- vim-dadbod-completion
- vim-dadbod-ui
- Neoscroll
- Cinnamon scroll
- Copilot
- Harpoon
- vim-log-highlighting
- nvim-cursorline
- nvim-hlslens
- csv.vim
- sidebar.nvim
- asynctasks.vim
- asyncrun.vim
- nvim-metals
- instant.nvim
- SnipRun
- Vista
- editorconfig-vim
- dressing.nvim
- incline.nvim
- winbar.nvim
- lsp_lines.nvim
- neotest
- legendary.nvim
- overseer.nvim
- neo-tree.nvim
- noice.nvim
- nvim-dap-vscode-js
- inc-rename
- hlargs.nvim
Structure
Structure (🔎 Click to expand/collapse)
-
after/ - Stuff that happens after
- ftplugin/ - Language specific settings
- syntax/ - Custom syntax for languages
- ftdetect/ - Let neovim identify custom filetypes
- ftplugin/ - Language specific custom settings
- lsp-settings - Custom lang server settings
-
lua/ - Lua plugin configurations
- telescope/ - Telescope extensions
-
user/ - User specific settings
- null_ls - list of configured linters/formatters
- autocommands.lua - user defined autocommands
- builtin.lua - change internal lunarvim settings
- keybindings.lua - user defined keybindings
- plugins.lua - list of installed plugins
- lsp_kind.lua - all the icons and lsp ui goodies are here
- theme.lua - customized themes
- config.lua - Main customization point for settings
- snippets/ - Personal code snippets
Custom Key-mappings
Note that,
- Leader key set as Space
Key-mappings (🔎 Click to expand/collapse)
UI
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
Space+e | 𝐍 | Open file tree | NvimTree |
Space+o | 𝐍 | Open symbols | Symbols-outline |
Space+f | 𝐍 | Open file finder | Telescope |
Space+h | 𝐍 | Remove highlight | nohlsearch< |
Space+/ | 𝐍 | Toggle comment | Comment.nvim |
Space+? | 𝐍 | Open cheats | cheat.sh |
Space+' | 𝐍 | Open marks | which-key marks |
Space+z | 𝐍 | Zen mode | zen-mode.nvim |
Space+P | 𝐍 | Projects | project.nvim |
Ctrl+</kbd> | 𝐈 𝐍 | Open terminal | toggleterm.nvim |
Alt+0 | 𝐈 𝐍 | Vertical terminal | toggleterm.nvim |
Ctrl+s | 𝐈 | Show signature help | vim.lsp.buf.signature_help() |
Alt+s | 𝐈 | Snippet selection | Telescope luasnip extension |
Space+C or Ctrl+P | 𝐍 | Command Palette | legendary.nvim |
Motion
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
f | 𝐍 | find next character | HopChar1CurrentLineAC or leap_f |
F | 𝐍 | find previous character | HopChar1CurrentLineBC or leap_F |
s | 𝐍 | find character | HopChar2MW or leap_s |
S | 𝐍 | find word | HopWordMW or leap_S |
Alt+a | 𝐈 | select all | ggVG |
Alt+a | 𝐍 | increment number | C-A |
Alt+x | 𝐍 | decrement number | C-X |
LSP
Key | Mode | Action |
---|---|---|
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
Key | Mode | Action |
---|---|---|
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+p | 𝐍 | Run Project |
Plugin: Gitsigns
Key | Mode | Action |
---|---|---|
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
Key | Mode | Action |
---|---|---|
Space+g+g | 𝐍 | Open lazy git UI |
Plugin: Telescope
Key | Mode | Action |
---|---|---|
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
Key | Mode | Action |
---|---|---|
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
Key | Mode | Action |
---|---|---|
Space+n+c | 𝐍 | Class documentation |
Space+n+f | 𝐍 | Function documentation |
Space+n+t | 𝐍 | Type documentation |
Space+n+F | 𝐍 | File documentation |
Plugin: Persistence
Key | Mode | Action |
---|---|---|
Space+q+d | 𝐍 | Quit without saving session |
Space+q+l | 𝐍 | Restore last session |
Space+q+s | 𝐍 | Restore last session from current dir |
Plugin: Bufferline
Key | Mode | Action |
---|---|---|
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
Key | Mode | Action |
---|---|---|
Space+T+d | 𝐍 | Diagnostics |
Space+T+f | 𝐍 | Definitions |
Space+T+r | 𝐍 | References |
Space+T+t | 𝐍 | Todo |
Space+T+w | 𝐍 | Workspace diagnostics |
Plugin: Ultest
Key | Mode | Action |
---|---|---|
Space+t+f | 𝐍 | Run all tests in a file |
Space+t+n | 𝐍 | Only run nearest test |
Space+t+s | 𝐍 | Open test summary |
Plugin: Neotest
Key | Mode | Action |
---|---|---|
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
Key | Mode | Action |
---|---|---|
Space+R+p | 𝐍 | Replace word in project |
Space+R+w | 𝐍 | Replace visually selected word |
Space+R+f | 𝐍 | Replace word in current buffer |
Plugin: Copilot
Key | Mode | Action |
---|---|---|
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
Key | Mode | Action |
---|---|---|
Space+v | 𝐍 | Toggle showing lsp_lines |
Plugin: Overseer
Key | Mode | Action |
---|---|---|
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
Key | Mode | Action |
---|---|---|
Space+e | 𝐍 | Toggle tree |
> and < | 𝐍 | Next and prev source inside tree |
𝐍 | 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 |
Troubleshooting
- Check your neovim version. Are you on the newest nightly version?
- Reset your packer cache, and update lvim.