Skip to content

Instantly share code, notes, and snippets.

@raheelrjunaid
Last active June 15, 2023 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raheelrjunaid/7c72aa4a2b7ff264abee086bef81fd34 to your computer and use it in GitHub Desktop.
Save raheelrjunaid/7c72aa4a2b7ff264abee086bef81fd34 to your computer and use it in GitHub Desktop.
My LunarVim Config (2023)
local opts = {}
lvim.log.level = "warn"
lvim.leader = "space"
lvim.colorscheme = "no-clown-fiesta"
lvim.builtin.cmp.experimental.ghost_text = false
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
lvim.builtin.alpha.active = true
lvim.builtin.alpha.mode = "dashboard"
lvim.builtin.terminal.active = true
lvim.builtin.nvimtree.setup.view.side = "left"
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
lvim.format_on_save = true
lvim.lsp.null_ls.setup.debug = true
-- WhichKey
lvim.builtin.which_key.mappings["u"] = {
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["S"] = {
"<cmd>:SymbolsOutline<cr>", "Symbols Outline"
}
-- LSP
require("lvim.lsp.null-ls.formatters").setup({
{
name = "prettierd",
filetypes = {
"svelte", "typescript", "typescriptreact", "javascript", "tsx",
"javascriptreact", "html", "json"
}
}, {name = "prismaFmt"}, {name = "lua_format"}
})
require("lvim.lsp.null-ls.linters").setup {
{
name = "eslint_d",
filetypes = {
"svelte", "typescript", "typescriptreact", "javascript",
"javascriptreact"
}
}
}
-- Formatter/lint overrides
require("lvim.lsp.manager").setup("tailwindcss", opts)
require("lvim.lsp.manager").setup("golangci_lint_ls", opts)
require("lvim.lsp.manager").setup("eslint_d", opts)
-- Vim overrides
vim.opt.relativenumber = true -- set relative numbered lines
vim.g.copilot_no_tab_map = true
vim.g.copilot_assume_mapped = true
vim.api.nvim_set_keymap("i", "<C-l>", 'copilot#Accept("")',
{expr = true, silent = true})
vim.keymap.set("i", "jk", "<Esc>")
vim.opt.timeoutlen = 500
-- Treesitter
lvim.builtin.treesitter.ensure_installed = {
"bash", "c", "javascript", "json", "lua", "python", "typescript", "tsx",
"css", "rust", "java", "yaml", "go", "svelte"
}
lvim.builtin.treesitter.ignore_install = {"haskell"}
lvim.builtin.treesitter.highlight.enabled = true
-- Additional Plugins
lvim.plugins = {
{'github/copilot.vim'}, {"tpope/vim-repeat"},
{'ray-x/go.nvim', config = require('go').setup()}, {'ray-x/guihua.lua'}, {
"ggandor/leap.nvim",
event = "BufRead",
config = require('leap').add_default_mappings()
}, {
"simrat39/symbols-outline.nvim",
config = function() require('symbols-outline').setup() end
}, {
"folke/todo-comments.nvim",
event = "BufRead",
config = function() require("todo-comments").setup() end
}, {"tpope/vim-surround"}, {
"windwp/nvim-ts-autotag",
config = function() require("nvim-ts-autotag").setup() end
}, {"p00f/nvim-ts-rainbow"}, {'fatih/vim-go'}, {
"olimorris/onedarkpro.nvim",
config = require("onedarkpro").setup {
colors = {onedark = {bg = "#1e2127"}},
options = {
italic = true, -- Use the themes opinionated italic styles?
underline = true, -- Use the themes opinionated underline styles?
undercurl = true, -- Use the themes opinionated undercurl styles?
cursorline = true -- Use cursorline highlighting?
}
}
}, {"Lokaltog/vim-monotone"}, {"aktersnurra/no-clown-fiesta.nvim"}, {
"folke/persistence.nvim",
event = "BufReadPre",
lazy = true,
-- module = "persistence",
config = function()
require("persistence").setup {
dir = vim.fn.expand(vim.fn.stdpath "config" .. "/session/"),
options = {"buffers", "curdir", "tabpages", "winsize"}
}
end
}, {"wakatime/vim-wakatime"}, {"hashivim/vim-terraform"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment