Do not use as is, use it as a source of inspiration.
I've customized my ZSH/Tmux/Alacritty too much, so it might not work properly π
Table of Contents (π Click to expand/collapse)
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 (π Click to expand/collapse)
- I'm on this PR of LunarVim and i'm using
neovim 0.8 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 itlvim.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 itlvim.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
lvim.builtin.test_runner = { active = false }
- 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 lightspeed as your favorite motion provider
lvim.builtin.motion_provider = "hop"
- choose between filename->incline and treesitter->winbar 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.async_tasks = { 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
Prerequisites (π Click to expand/collapse)
- Neovim >= v0.6.0
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
# 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
Please run the following to have a better debugging and testing support for java
mkdir -p ~/workspace
git clone git@github.com:microsoft/java-debug.git ~/.config/lvim/.java-debug
cd ~/.config/lvim/.java-debug/
./mvnw clean install
git clone 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
- 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)
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.
cd ~/.config/lvim
git pull
lvim # run :PackerSync
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
The default is to serve localhost only, on port 8080. For a more advanced (remote server) overview see Deploy a server
: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
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
Screenshots (π Click to expand/collapse)
![Screen Shot 2021-10-20 at 1 09 24 PM](https://user-images.githubusercontent.com/10992695/138069108-4fd1b129-0b20-4bfe-bf55-81614410ea58.png)
![Screen Shot 2021-10-18 at 5 44 20 PM](https://user-images.githubusercontent.com/10992695/137748538-33c59697-6783-43e5-bbd7-d920f91965bf.png)
![Screen Shot 2021-10-18 at 5 45 16 PM](https://user-images.githubusercontent.com/10992695/137748708-ce6a91e1-aec4-46ea-b119-2086897c1d0e.png)
![Screen Shot 2021-10-18 at 5 40 16 PM](https://user-images.githubusercontent.com/10992695/137747972-825b31a8-ce43-483e-b766-8d26f9d77d3f.png)
![Screen Shot 2021-10-18 at 5 51 50 PM](https://user-images.githubusercontent.com/10992695/137749839-6b53ee28-5cc2-4ed0-999d-14905a68c645.png)
![lsp_signature_2](https://user-images.githubusercontent.com/10992695/138069979-13a43683-3ba0-46b3-ae53-0904fbab66bc.png)
![lsp_signature](https://user-images.githubusercontent.com/10992695/138069986-897e29bd-f23d-4cec-a410-a8b7fcb0d465.png)
![tabnine](https://user-images.githubusercontent.com/10992695/138070107-c6aecc6d-6423-4f21-bc58-d0ee24142e3f.png)
code_lens
and inlay_hints
when supported by lang server
peek using gp
![Screen Shot 2021-10-18 at 6 33 06 PM](https://user-images.githubusercontent.com/10992695/137757505-d742558a-56c7-4c1d-b037-14bfab200901.png)
rename using <leader>lr
![Screen Shot 2021-11-04 at 3 54 15 PM](https://user-images.githubusercontent.com/10992695/140312997-77a30d8e-3c1a-413a-920e-971474c6f92e.png)
![Screen Shot 2021-10-18 at 6 07 13 PM](https://user-images.githubusercontent.com/10992695/137752572-87a5792f-87a3-4131-8a1b-4ba786b83086.png)
![Screen Shot 2021-10-18 at 6 13 22 PM](https://user-images.githubusercontent.com/10992695/137753736-a4502a50-cff5-4365-bfd7-22dfd08c71ed.png)
k8s help
![Screen Shot 2021-10-18 at 6 23 21 PM](https://user-images.githubusercontent.com/10992695/137755742-d9c2f106-de34-4503-857a-ada7ba1160f3.png)
lazy git integration
![Screen Shot 2021-10-18 at 6 27 45 PM](https://user-images.githubusercontent.com/10992695/137756730-f4ff78c8-dc9a-43bf-9646-916cd467c4c3.png)
zen mode
![Screen Shot 2021-10-18 at 6 30 00 PM](https://user-images.githubusercontent.com/10992695/137757021-b084822c-457b-4a5f-9592-0992977ae218.png)
Cheat.sh integration
![Screen Shot 2021-10-18 at 6 01 34 PM](https://user-images.githubusercontent.com/10992695/137751541-0c6bcb6f-3498-454d-bcf5-7001cf004c1f.png)
Symbols Outline
![Screen Shot 2021-10-18 at 6 03 57 PM](https://user-images.githubusercontent.com/10992695/137751933-291297b4-4233-406a-88bc-68b93733048a.png)
Plugins (π Click to expand/collapse)
- Tokyonight Theme
- Doom One Theme
- Rose Pine Theme
- LSP Signature
- Todo Comments
- Trouble
- symbols-outline.nvim
- Indent Blankline
- 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
- legendary.nvim
- refactoring.nvim
- Hop
- Lightspeed
- 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
Structure (π Click to expand/collapse)
- after/ - Stuff that happens after
- 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
Note that,
- Leader key set as Space
Key-mappings (π Click to expand/collapse)
Modes: π=normal π=visual π=select π=insert π=commandKey | 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 |
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 |
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
f | π | find next character | HopChar1CurrentLineAC or Lightspeed_f |
F | π | find previous character | HopChar1CurrentLineBC or Lightspeed_F |
s | π | find character | HopChar2MW or Lightspeed_s |
S | π | find word | HopWordMW or Lightspeed_S |
Alt+a | π | select all | ggVG |
Alt+a | π | increment number | C-A |
Alt+x | π | decrement number | C-X |
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 |
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 |
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+R | π π | Reset hunk |
Key | Mode | Action |
---|---|---|
Space+g+g | π | Open lazy git UI |
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 |
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 |
Key | Mode | Action |
---|---|---|
Space+n+c | π | Class documentation |
Space+n+f | π | Function documentation |
Space+n+t | π | Type documentation |
Space+n+F | π | File documentation |
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 |
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 |
Key | Mode | Action |
---|---|---|
Space+T+d | π | diagnostics |
Space+T+f | π | definitions |
Space+T+r | π | references |
Space+T+t | π | todo |
Space+T+w | π | workspace diagnostics |
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 |
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 |
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>" |
Key | Mode | Action |
---|---|---|
Space+v | π | Toggle showing lsp_lines |
- Check your neovim version. Are you on the newest nightly version?
- Reset your packer cache, and update lvim.