Skip to content

Instantly share code, notes, and snippets.

@nwisemanII
Created June 4, 2024 15:59
Show Gist options
  • Save nwisemanII/939488fea2567274ea09171870d7f6d2 to your computer and use it in GitHub Desktop.
Save nwisemanII/939488fea2567274ea09171870d7f6d2 to your computer and use it in GitHub Desktop.
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Example configs: https://github.com/LunarVim/starter.lvim
-- 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
-- Enable powershell as your default shell
vim.opt.shell = "pwsh.exe"
vim.opt.shellcmdflag =
"-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
vim.cmd [[
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
set shellquote= shellxquote=
]]
-- Set a compatible clipboard manager
vim.g.clipboard = {
copy = {
["+"] = "win32yank.exe -i --crlf",
["*"] = "win32yank.exe -i --crlf",
},
paste = {
["+"] = "win32yank.exe -o --lf",
["*"] = "win32yank.exe -o --lf",
},
}
lvim.colorscheme = "dracula"
lvim.builtin.treesitter.ensure_installed = {
"lua",
"rust",
"toml",
}
lvim.plugins = {
{ "towolf/vim-helm" },
{ "mofiqul/dracula.nvim" },
{ "machakann/vim-sandwich" },
{ "HiPhish/rainbow-delimiters.nvim" },
{
"mrcjkb/rustaceanvim",
dependencies = {
"nvim-lua/plenary.nvim",
"mfussenegger/nvim-dap",
},
config = function()
-- local status_ok, rust_tools = pcall(require, "rustaceanvim")
-- if not status_ok then
-- print("Status NOT Ok")
-- return
-- end
vim.g.rustaceanvim = function()
-- local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/")
-- local codelldb_path = mason_path .. "bin/codelldb"
-- local liblldb_path = mason_path .. "packages/codelldb/extension/lldb/lib/liblldb"
-- local this_os = vim.loop.os_uname().sysname
-- -- The path in windows is different
-- if this_os:find "Windows" then
-- codelldb_path = mason_path .. "packages\\codelldb\\extension\\adapter\\codelldb.exe"
-- liblldb_path = mason_path .. "packages\\codelldb\\extension\\lldb\\bin\\liblldb.dll"
-- else
-- -- The liblldb extension is .so for linux and .dylib for macOS
-- liblldb_path = liblldb_path .. (this_os == "Linux" and ".so" or ".dylib")
-- end
-- Update this path
local extension_path = vim.env.HOME .. '/.vscode/extensions/vadimcn.vscode-lldb-1.10.0/'
local codelldb_path = extension_path .. 'adapter/codelldb'
local liblldb_path = extension_path .. 'lldb/lib/liblldb'
local this_os = vim.uv.os_uname().sysname;
--
-- The path is different on Windows
if this_os:find "Windows" then
codelldb_path = extension_path .. "adapter\\codelldb.exe"
liblldb_path = extension_path .. "lldb\\bin\\liblldb.dll"
else
-- The liblldb extension is .so for Linux and .dylib for MacOS
liblldb_path = liblldb_path .. (this_os == "Linux" and ".so" or ".dylib")
end
local cfg = require('rustaceanvim.config')
return {
tools = {
-- executor = require("rustaceanvim.config").termopen, -- can be quickfix or termopen
-- executor =
reload_workspace_from_cargo_toml = true,
hover_actions = {
border = {
{ "╭", "FloatBorder" },
{ "─", "FloatBorder" },
{ "╮", "FloatBorder" },
{ "│", "FloatBorder" },
{ "╯", "FloatBorder" },
{ "─", "FloatBorder" },
{ "╰", "FloatBorder" },
{ "│", "FloatBorder" },
},
auto_focus = true,
},
},
server = {
-- on_attach = function(client, bufnr)
-- require("lsp-inlayhints").on_attach(client, bufnr)
-- end,
on_attach = require("lvim.lsp").common_on_attach,
on_init = require("lvim.lsp").common_on_init,
settings = {
["rust-analyzer"] = {
cargo = {
["allFeatures"] = true,
},
checkOnSave = {
command = "clippy"
},
inlayHints = {
auto = true,
only_current_line = false,
show_parameter_hints = true,
parameter_hints_prefix = "<-",
other_hints_prefix = "=>",
max_len_align = false,
max_len_align_padding = 1,
right_align = false,
right_align_padding = 7,
highlight = "Comment",
},
lens = {
enable = true
},
procMacro = {
enable = true,
},
}
},
},
dap = {
adapter = cfg.get_codelldb_adapter(codelldb_path, liblldb_path),
},
}
end
print("Status Ok")
end,
},
{
"saecki/crates.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("crates").setup {
null_ls = {
enabled = true,
name = "crates.nvim",
},
popup = {
border = "rounded",
},
}
end,
},
{
"j-hui/fidget.nvim",
config = function()
require("fidget").setup()
end,
},
}
vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "rust_analyzer" })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment