Skip to content

Instantly share code, notes, and snippets.

@jglien
Last active August 2, 2024 17:46
Show Gist options
  • Save jglien/6b223afeaab9228f3d69fbc945e70636 to your computer and use it in GitHub Desktop.
Save jglien/6b223afeaab9228f3d69fbc945e70636 to your computer and use it in GitHub Desktop.
My LunarVim Config
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
lvim.plugins = {
-- Appearance
{ "lourenci/github-colors" },
{ "nvim-tree/nvim-web-devicons" },
-- Editing
{
"Pocco81/auto-save.nvim",
config = function()
require("auto-save").setup()
end,
},
-- Git
-- inline git blame
{ "f-person/git-blame.nvim" },
{
-- see docs page at the below github. all commands start with :Octo
"pwntester/octo.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
},
config = function()
require "octo".setup()
end
},
-- <leader>gy to copy github share link
{
"ruifm/gitlinker.nvim",
dependencies = "nvim-lua/plenary.nvim",
config = function()
require("gitlinker").setup()
end
},
-- git log + git show w/ side-by-side diffs
{ "sindrets/diffview.nvim" },
-- Copilot
{
"zbirenbaum/copilot-cmp",
event = "InsertEnter",
dependencies = { "zbirenbaum/copilot.lua" },
config = function()
vim.defer_fn(function()
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
require("copilot_cmp").setup()
end, 100)
end,
},
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
config = function()
require("persistence").setup {
dir = vim.fn.expand(vim.fn.stdpath "config" .. "/session/"),
options = { "buffers", "curdir", "tabpages", "winsize" },
}
end,
},
{
"pappasam/nvim-repl",
init = function()
vim.g["repl_filetype_commands"] = {
javascript = "node",
python = "ipython --no-autoindent"
}
end,
keys = {
{ "<leader>rt", "<cmd>ReplToggle<cr>", desc = "Toggle nvim-repl" },
{ "<leader>rc", "<cmd>ReplRunCell<cr>", desc = "nvim-repl run cell" },
},
},
-- {
-- "ray-x/lsp_signature.nvim",
-- event = "VeryLazy",
-- opts = {},
-- config = function(_, opts) require'lsp_signature'.setup(opts) end
-- },
{
"folke/trouble.nvim",
cmd = "TroubleToggle",
},
{ "stevanmilic/nvim-lspimport" },
}
lvim.colorscheme = "github-colors"
-- Seems to be causing issues with ability to undo with auto save
-- lvim.format_on_save.enabled = true
lvim.builtin.which_key.mappings["S"]= {
name = "Session",
c = { "<cmd>lua require('persistence').load()<cr>", "Restore last session for current dir" },
l = { "<cmd>lua require('persistence').load({ last = true })<cr>", "Restore last session" },
Q = { "<cmd>lua require('persistence').stop()<cr>", "Quit without saving session" },
}
lvim.builtin.which_key.mappings["t"] = {
name = "Diagnostics",
t = { "<cmd>TroubleToggle<cr>", "trouble" },
w = { "<cmd>TroubleToggle workspace_diagnostics<cr>", "workspace" },
d = { "<cmd>TroubleToggle document_diagnostics<cr>", "document" },
q = { "<cmd>TroubleToggle quickfix<cr>", "quickfix" },
l = { "<cmd>TroubleToggle loclist<cr>", "loclist" },
r = { "<cmd>TroubleToggle lsp_references<cr>", "references" },
}
lvim.builtin.which_key.mappings["lx"] = { "<cmd>lua require('lspimport').import()<cr>", "Fix import" }
lvim.builtin.nvimtree.setup.filters.custom["3"] = "\\.sst"
vim.opt.wrap = true
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldenable = false -- if this option is true and fold method option is other than normal, every time a document is opened everything will be folded.
@jglien
Copy link
Author

jglien commented Jan 9, 2024

Could overwrite with this by

 wget "{{ raw link }}" -O ~/.config/lvim/config.lua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment