My favorite VIM based IDE !!

ichigo-gyuunyuu 0064b446a0 [Feature] Allow for custom path to a language server binary (#1043) 4 年之前
.github 2827ed76ab enables testing again (#1039) 4 年之前
colors e780972b30 spacegray now in lua 4 年之前
ftdetect fe69c43d66 [Feature]: Add language server support for Julia (#423) (#918) 4 年之前
ftplugin e82fc442d0 move julia stuff to core/lang (#1023) 4 年之前
lua 0064b446a0 [Feature] Allow for custom path to a language server binary (#1043) 4 年之前
utils 2827ed76ab enables testing again (#1039) 4 年之前
.gitignore 47ede1e2c2 add temporal and backup files to gitignore. (#983) 4 年之前
.luacheckrc dd5de4217d configure luacheck to better undersant LV code (#998) 4 年之前
CONTRIBUTING.md 1f5fd93f80 [Refactor] nvimtree to be configurable (#970) 4 年之前
LICENSE d3e94f3086 update license 4 年之前
README.md 9e640fa4d9 Update README (#1051) 4 年之前
init.lua d02265175f Decoupling config from nvim (#1038) 4 年之前

README.md

LunarVim Demo

Install In One Command!

Make sure you have the newest version of Neovim (0.5).

bash <(curl -s https://raw.githubusercontent.com/ChristianChiarulli/lunarvim/master/utils/installer/install.sh)

Installing

The following command installs LunarVim. Change LVBRANCH to the branch you'd like to install. master for the stable branch and rolling for the latest changes.

LVBRANCH=rolling bash <(curl -s https://raw.githubusercontent.com/ChristianChiarulli/lunarvim/rolling/utils/installer/install.sh)

BREAKING CHANGE on the rolling branch

  • The latest changes to LunarVim require you to remove it completely before upgrading
  • Going forward LunarVim will no longer reside in the nvim configuration folder. LunarVim has been moved to ~/.local/share/lunarvim.
  • To launch Lunarvim use the new lvim command. nvim will only launch standard neovim.
  • Your personal configuration file (lv-config.lua) can now be found in ~/.config/lvim. You can initialize this folder as a git repository to track changes to your configuration files.
  • If you want to keep launching LunarVim with the nvim command, add an alias entry to your shell's config file: alias nvim=lvim. To temporarily revert to the default nvim prefix it with a backslash \nvim.

Fixing installation problems

If your installation is stuck on Ok to remove? [y/N], it means there are some leftovers, \ you can run the script with --overwrite but be warned this will remove the following folders:

  • ~/.cache/nvim
  • ~/.config/nvim #Removed only on Master Branch
  • ~/.local/share/nvim/site/pack/packer #Removed only on Master Branch
  • ~/.local/share/lunarvim #Removed only on Rolling Branch
  • ~/.config/lvim #Removed only on Rolling Branch

    curl -s https://raw.githubusercontent.com/ChristianChiarulli/lunarvim/rolling/utils/installer/install.sh | LVBRANCH=rolling bash -s -- --overwrite
    

    then run nvim and wait for treesitter to finish the installation

    Installing LSP for your language

    Just enter :LspInstall followed by <TAB> to see your options

    NOTE I recommend installing lua for autocomplete in lv-config.lua

    For the julia language server look here

    Configuration file

    To activate other plugins and language features use the lv-config.lua file provided in the nvim folder (~/.config/nvim/lv-config.lua) in the master branch or (~/.config/lvim/lv-config.lua) on rolling

    Example:

    -- O is the global options object
    
    -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
    -- general
    -- O.format_on_save = false -- to disbale formatting on save
    -- O.lint_on_save = false -- to disable formatting on save
    O.completion.autocomplete = true
    O.default_options.relativenumber = true
    O.colorscheme = 'spacegray'
    O.default_options.timeoutlen = 100
    
    -- keymappings 
    O.keys.leader_key = "space"
    -- overwrite the key-mappings provided by LunarVim for any mode, or leave it empty to keep them
    O.keys.normal_mode = {
    -- Page down/up
    {'[d', '<PageUp>'},
    {']d', '<PageDown>'},
    }
    -- if you just want to augment the existing ones then use the utility function
    require("lv-utils").add_keymap_insert_mode({ silent = true }, {
    { "<C-s>", ":w<cr>" },
    { "<C-c>", "<ESC>" }
    })
    
    -- you can also use the native vim way directly
    vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", { noremap = true, silent = true, expr = true })
    
    -- After changing plugin config it is recommended to run :PackerCompile
    O.plugin.dashboard.active = true
    O.plugin.terminal.active = true
    O.plugin.zen.active = true
    
    -- if you don't want all the parsers change this to a table of the ones you want
    O.treesitter.ensure_installed = "all"
    O.treesitter.ignore_install = {"haskell"}
    O.treesitter.highlight.enabled = true
    
    -- lua
    O.lang.lua.autoformat = false
    O.lang.lua.formatter = 'lua-format'
    
    -- javascript
    O.lang.tsserver.formatter = 'prettier'
    O.lang.tsserver.linter = nil
    O.lang.tsserver.autoformat = true
    
    -- python
    O.lang.python.diagnostics.virtual_text = true
    O.lang.python.analysis.use_library_code_types = true
    -- to change default formatter from yapf to black
    -- O.lang.python.formatter.exe = "black"
    -- O.lang.python.formatter.args = {"-"}
    -- To change enabled linters
    -- https://github.com/mfussenegger/nvim-lint#available-linters
    -- O.lang.python.linters = { "flake8", "pylint", "mypy", ... }
    
    -- go
    -- to change default formatter from gofmt to goimports
    -- O.lang.formatter.go.exe = "goimports"
    
    -- Additional Plugins
    -- O.user_plugins = {
    --   {"folke/tokyonight.nvim"},
    --   {
    --     "ray-x/lsp_signature.nvim",
    --     config = function()
    --       require"lsp_signature".on_attach()
    --     end,
    --     event = "InsertEnter"
    --   },
    -- }
    
    -- }
    
    -- Autocommands (https://neovim.io/doc/user/autocmd.html)
    -- O.user_autocommands = {{ "BufWinEnter", "*", "echo \"hi again\""}}
    
    -- Additional Leader bindings for WhichKey
    -- O.user_which_key = {
    --   A = {
    --     name = "+Custom Leader Keys",
    --     a = { "<cmd>echo 'first custom command'<cr>", "Description for a" },
    --     b = { "<cmd>echo 'second custom command'<cr>", "Description for b" },
    --   },
    -- }
    
    -- To link your init.vim (until you find Lua replacements)
    -- vim.cmd('source ' .. CONFIG_PATH .. '/lua/lv-user/init.vim')
    

In case you want to see all the settings inside LunarVim, run the following:

cd /tmp
lvim --headless +'lua require("lv-utils").generate_settings()' +qa && sort -o lv-settings.lua{,}

and then inspect /tmp/lv-settings.lua file

Updating LunarVim

In order to update you should be aware of three things Plugins, LunarVim and Neovim

To update plugins:

:PackerUpdate

To update LunarVim:

# Master Branch
cd ~/.config/nvim && git pull
:PackerSync  

# Rolling Branch
cd ~/.local/share/lunarvim && git pull
:PackerSync

To update Neovim use your package manager or compile from source

Project Goals

  1. Provide basic functionalities required from an IDE
    • LSP
    • Formatting/Linting
    • Debugging
    • Treesitter
    • Colorschemes
  2. Be as fast and lean as possible
    • Lazy loading
    • Not a single extra plugin
    • User configurable lang/feature enable/disable
  3. Provide a simple and easy way for users to share their own configuration or use others.
  4. Hot reload of configurations
    • Hot install of lsp/treesitter/formatter required upon openning a filetype for the first time
  5. Provide a stable & maintainable error free configuration layer over neovim
    • With the help of the community behind it
    • Github workflow testing
    • Freezing plugin versions
  6. Provide detailed documentation
    • Video series on how to configure LunarVim as an IDE for each lang
  7. Valhalla

Resources

Testimonials

"I have the processing power of a potato with 4 gb of ram and LunarVim runs perfectly."

"My minimal config with a good amount less code than LunarVim loads 40ms slower. Time to switch."

  • @mvllow, Potential LunarVim user.
[![Lua](https://img.shields.io/badge/Made%20with%20Lua-blue.svg?style=for-the-badge&logo=lua)](#madewithlua)