Skip to content

Instantly share code, notes, and snippets.

@zbyju
Last active July 27, 2023 14:12
Show Gist options
  • Save zbyju/c5c2f09eb0a017670fad018b222ed570 to your computer and use it in GitHub Desktop.
Save zbyju/c5c2f09eb0a017670fad018b222ed570 to your computer and use it in GitHub Desktop.
lvim-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
-- Setting
lvim.format_on_save = true
vim.opt.relativenumber = true
vim.opt.wrap = true
-- lvim.keys.normal_mode["ga"] = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "Code actions" }
-- lvim.keys.normal_mode['K'] = "<Cmd>echo Okay!<CR>"
-- Astro typescript error fix
local lspconfig = require("lspconfig")
lspconfig.astro.setup({
init_options = {
typescript = {
tsdk = vim.fs.normalize('~/.local/share/pnpm/global/5/node_modules/typescript/lib')
}
},
})
-- Colorscheme
lvim.colorscheme = "duskfox"
-- Add plugins
lvim.plugins = {
-- Color schemes
{ 'shaunsingh/moonlight.nvim' },
{ "EdenEast/nightfox.nvim" },
{ "shaunsingh/nord.nvim" },
{ "rose-pine/neovim" },
{ "rebelot/kanagawa.nvim" },
{ "nyoom-engineering/oxocarbon.nvim" },
{ "embark-theme/vim" },
{ "bluz71/vim-moonfly-colors" },
{ "Shatur/neovim-ayu" },
{ "catppuccin/nvim" },
-- Plugins
{ 'm4xshen/autoclose.nvim' },
{ 'windwp/nvim-ts-autotag' },
{ "windwp/nvim-autopairs" },
-- LSP
{'scalameta/nvim-metals', dependencies = { "nvim-lua/plenary.nvim" }}
}
local metals_config = require("metals").bare_config()
metals_config.settings = {
showImplicitArguments = true,
excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },
}
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
pattern = { "scala", "sbt", "java" },
callback = function()
require("metals").initialize_or_attach(metals_config)
end,
group = nvim_metals_group,
})
require 'nvim-web-devicons'.setup {
override = {
astro = {
icon = "´üĚ",
color = "#ff7e33",
name = "astro",
}
}
}
require("autoclose").setup({
keys = {
["("] = { escape = false, close = true, pair = "()" },
["["] = { escape = false, close = true, pair = "[]" },
["{"] = { escape = false, close = true, pair = "{}" },
[">"] = { escape = true, close = false, pair = "<>" },
[")"] = { escape = true, close = false, pair = "()" },
["]"] = { escape = true, close = false, pair = "[]" },
["}"] = { escape = true, close = false, pair = "{}" },
['"'] = { escape = true, close = true, pair = '""' },
["'"] = { escape = true, close = true, pair = "''" },
["`"] = { escape = true, close = true, pair = "``" },
},
options = {
disabled_filetypes = { "text" },
disable_when_touch = false,
pair_spaces = true,
auto_indent = true,
},
})
require 'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
}
}
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics,
{
underline = true,
virtual_text = {
spacing = 5,
severity_limit = 'Warning',
},
update_in_insert = true,
}
)
vim.opt.clipboard = "unnamedplus"
if vim.fn.has('wsl') == 1 then
vim.api.nvim_create_autocmd('TextYankPost', {
group = vim.api.nvim_create_augroup('Yank', { clear = true }),
callback = function()
vim.fn.system('clip.exe', vim.fn.getreg('"'))
end,
})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment