updated readme and added config

master
Penguin 1 year ago
parent e93e15cda3
commit 1b04c00ee1

@ -1,21 +1,22 @@
* Getting Started with Neovim/Lunarvim
** Background Information
*THIS README IS A WORK IN PROGRESS AND IS NOT COMPLETE!*
This guide will go over very surface-level stuff for lunarvim. It will covering installing neovim and then lunarvim. It will also cover very basic configuration options.
** What is Neovim? Lunarvim?
Neovim is a "forked, more feature-rich version of [vim]". It utilizes lua to do its configuration, but vimscript also works just fine in it. In text editors like neovim and emacs, there aren't /settings/ like how a normal IDE or text editor might handle configuration. This is a good thing and a bad thing. On one hand, it means that literally every part of the text editor is yours to configure. Once you are done with it, the text editor is /your/ text editor. Rather than settings, you will make your changes to the editor with *code*. The bad thing about this is that it is more work, but that doesn't /have/ to be a bad thing. It's only a bad thing if you let it become a bad thing. More on this later.
These configurations you make via code are called... configs. Think of LunarVim is a well put-together config, with a lot of features set up out of the box. It essentially moves a lot of the initial configuration away from you and into the hands of the lunarvim devs. That being said, it is still neovim and is still 100% configurable.
These configurations you make via code are called... configs. Think of LunarVim as a well put-together config, with a lot of features set up out of the box. It essentially moves a lot of the initial configuration away from you and into the hands of the lunarvim devs. That being said, it is still neovim and is still 100% configurable.
** Why use a text editor like lunarvim?
Lunarvim is a great starter text editor because it sets you up to configure things the way you want with lots of documentation without having to focus on primitive features most text-editors already have like a file explorer or window tabs. Think about it like this: Have you ever wanted some really niche feature that most people wouldn't want? In something like VSCode, this is a hard sell. If the extension doesn't exist, you're welcome to try developing it yourself, but that's (in my opinion) an entire project all on its own. In something like neovim or emacs, your tiny feature has probably already been implemented by someone on the internet, and even if it hasn't, it's probably only a small snippet of code to make it happen.
I also have to throw in the low hanging fruits of perks: speed, power, and portability.
I also have to throw in the low hanging fruits of (neo/lunar)vim perks: speed, power, and portability.
** Installing Neovim on ubuntu
#+begin_src
sudo snap install nvim
#+end_src
One downside of ubuntu is snaps. They are a bait. They generally suck. They are slow. The security features are basically security theater. However, it is the easiest way to install a somewhat up-to-date version of neovim.
One downside of ubuntu is snaps. They are a bait. They generally suck. They are slow. The security features are basically security theater. However, it is the easiest way to install a somewhat up-to-date version of neovim on ubuntu without compiling it from source. I, personally, just compile neovim from source because I hate snaps.
That's really it. I'm not sure why I made this a whole section.
** Installing LunarVim
@ -41,3 +42,29 @@ If any dependencies are missing, it should tell you what you're missing.
If you want to know specifically what we just did, open the install.sh file and inspect it! I will give a general overview if you don't want to do that:
The install script is really well put together. It verifies that your neovim will work with lunarvim and then it installs lunarvim to ~/.config/lvim. It also installs dependencies (like ripgrep) through cargo, pip, and npm, though I opt not to use npm and say no to that during the install.
Inside of your ~/.config/lvim folder, you'll find a config.lua file. That's your config!
*** Using my config
Prerequisites:
#+begin_src
sudo apt install clangd g++-12 global
cargo install tree-sitter-cli
#+end_src
This repo contains a config.lua. It is just the basic lunarvim config with a few of my additions (one being the custom clangd hook so we can set our compiler.) Just copy it into your ~/.config/lvim folder and it will overwrite the default config. Then open your lunarvim and type
#+begin_src
:PackerSync
:PackerUpdate
#+end_src
and then you should be good to go!
*** Fonts (Nerd Fonts)
(Nerd) Fonts are an important part of using lunarvim. Nerd fonts are just regular fonts that have been "patched" with glyphs. There's actually a website purely for looking up glyph codes so you can patch your own fonts: https://www.nerdfonts.com/cheat-sheet. The glyphs in nerd fonts are used as icons for a bunch of things like git, tabs, folders, etc. I use jet brains mono: https://www.jetbrains.com/lp/mono/ (free and open source font), but you can use whatever font you'd like. Here's a list of (pretty much) confirmed working fonts: https://www.nerdfonts.com/font-downloads
** TODO Jumping into lunarvim
*** TODO Documentation
*** TODO Keybindings and the "Leader" Key
Show all keybindings: <Spc L k>
*** TODO Window Management vs Buffer Management
** TODO Configuring Lunarvim
This section will include snippets from my config to explain what it is doing and why I am doing it.
*** TODO Setting Keybinds
*** TODO Setting up language support
*** TODO Setting up LSP servers (extends language support)
This section will mainly include setting up C/C++ clangd support. Other stuff may or may not show up because it is less important to me.

@ -14,7 +14,7 @@ an executable
-- general
lvim.log.level = "warning"
lvim.format_on_save = false
lvim.colorscheme = "space-vim-dark"
lvim.colorscheme = "tokyonight"
vim.lsp.set_log_level("debug")
local tables = { "clangd" }
@ -22,11 +22,6 @@ vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, tables, 1, #ta
vim.list_extend(lvim.lsp.override, tables, 1, #tables)
local clangd_bin = "clangd"
-- local clangd_flags = {
-- "--query-driver=/usr/bin/arm-none-eabi*",
-- "--background-index", "--pch-storage=memory", "-j=4", "--log=verbose",
-- -- "--path-mappings=/from=/to",
-- }
local clangd_flags = {
"--query-driver=/usr/bin/g++-12",
"--background-index", "--pch-storage=memory", "-j=4", "--log=verbose",
@ -147,16 +142,11 @@ lvim.builtin.nvimtree.setup.view.side = "left"
lvim.builtin.treesitter.ensure_installed = {
"bash",
"c",
"javascript",
"json",
"cpp"
"lua",
"python",
"typescript",
"tsx",
"css",
"rust",
"java",
"yaml",
"yaml"
}
lvim.builtin.treesitter.ignore_install = { "haskell" }
@ -227,78 +217,11 @@ lvim.lsp.diagnostics.virtual_text = false
-- Additional Plugins
lvim.plugins = {
{ "liuchengxu/space-vim-dark" },
{ "p00f/nvim-ts-rainbow" },
{
"folke/trouble.nvim",
cmd = "TroubleToggle",
},
{ "ellisonleao/glow.nvim" },
{
"TimUntersberger/neogit",
requires = "nvim-lua/plenary.nvim",
requires = "sindrets/diffview.nvim",
require('neogit').setup {
disable_signs = false,
disable_hint = false,
disable_context_highlighting = false,
disable_commit_confirmation = false,
auto_refresh = true,
disable_builtin_notifications = false,
use_magit_keybindings = false,
kind = "tab",
console_timeout = 2000,
auto_show_console = true,
commit_popup = {
kind = "split",
},
popup = {
kind = "split",
},
signs = {
-- { CLOSED, OPENED }
section = { ">", "v" },
item = { ">", "v" },
hunk = { "", "" },
},
integrations = {
diffview = true
},
sections = {
untracked = {
folded = false
},
unstaged = {
folded = false
},
staged = {
folded = false
},
stashes = {
folded = true
},
unpulled = {
folded = true
},
unmerged = {
folded = false
},
recent = {
folded = true
},
},
-- override/add mappings
mappings = {
-- modify status buffer mappings
status = {
-- Adds a mapping with "B" as key that does the "BranchPopup" command
["B"] = "BranchPopup",
-- -- Removes the default mapping of "s"
-- ["s"] = "",
}
}
}
},
{
"sindrets/diffview.nvim",
requires = "nvim-lua/plenary.nvim",

Loading…
Cancel
Save