update nvim stuff

This commit is contained in:
LordMZTE 2023-01-17 15:07:16 +01:00
parent 9cf5e92628
commit e4b92a679d
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
6 changed files with 61 additions and 48 deletions

View file

@ -40,6 +40,8 @@ jdtls.start_or_attach {
on_attach = function(client, _)
-- formatting is handled by clang-format
client.server_capabilities.documentFormattingProvider = false
-- java lsp has shit highlights
client.server_capabilities.semanticTokensProvider = false
require("jdtls.setup").add_commands()
jdtls.setup_dap {
hotcodereplace = "auto",

View file

@ -5,7 +5,7 @@ lline.setup {
theme = "dracula",
},
sections = {
lualine_b = { "branch", "diff", "lsp_progress" },
lualine_b = { "branch", "diff" },
lualine_c = { "filename", "diagnostics" },
},
}

View file

@ -0,0 +1,7 @@
local fidget = require "fidget"
fidget.setup {
text = {
spinner = "zip",
},
}

View file

@ -29,11 +29,6 @@ local function cmp_plugins(use)
},
}
use {
"simrat39/rust-tools.nvim",
config = pconf "rust_tools",
}
use {
"Saecki/crates.nvim",
config = function()
@ -184,6 +179,11 @@ require("packer").startup(function(use)
config = pconf "nvim_recorder",
}
use {
"j-hui/fidget.nvim",
config = pconf "nvim_fidget",
}
cmp_plugins(use)
end)

View file

@ -3,7 +3,9 @@ const c = @import("ffi.zig").c;
const log = std.log.scoped(.compiler);
pub const log_level = .debug;
pub const std_options = struct {
pub const log_level = .debug;
};
pub fn main() !void {
if (std.os.argv.len != 2) {

View file

@ -14,52 +14,54 @@ const modules = struct {
var lua_state: ?*c.lua_State = null;
pub fn log(
comptime level: std.log.Level,
comptime scope: @TypeOf(.EnumLiteral),
comptime format: []const u8,
args: anytype,
) void {
// if there's no lua state, we can't invoke nvim notifications.
const l = lua_state orelse return;
pub const std_options = struct {
pub fn logFn(
comptime level: std.log.Level,
comptime scope: @TypeOf(.EnumLiteral),
comptime format: []const u8,
args: anytype,
) void {
// if there's no lua state, we can't invoke nvim notifications.
const l = lua_state orelse return;
const stacktop = c.lua_gettop(l);
defer c.lua_settop(l, stacktop);
const stacktop = c.lua_gettop(l);
defer c.lua_settop(l, stacktop);
var fmtbuf: [2048]u8 = undefined;
var fmtbuf: [2048]u8 = undefined;
c.lua_getglobal(l, "vim");
c.lua_getfield(l, -1, "log");
c.lua_getfield(l, -1, "levels");
switch (level) {
.err => c.lua_getfield(l, -1, "ERROR"),
.warn => c.lua_getfield(l, -1, "WARN"),
.info => c.lua_getfield(l, -1, "INFO"),
.debug => c.lua_getfield(l, -1, "DEBUG"),
c.lua_getglobal(l, "vim");
c.lua_getfield(l, -1, "log");
c.lua_getfield(l, -1, "levels");
switch (level) {
.err => c.lua_getfield(l, -1, "ERROR"),
.warn => c.lua_getfield(l, -1, "WARN"),
.info => c.lua_getfield(l, -1, "INFO"),
.debug => c.lua_getfield(l, -1, "DEBUG"),
}
const vim_lvl = c.lua_tointeger(l, -1);
c.lua_pop(l, 3);
c.lua_getfield(l, -1, "notify");
const msg = std.fmt.bufPrintZ(&fmtbuf, format, args) catch return;
c.lua_pushstring(l, msg.ptr);
c.lua_pushinteger(l, vim_lvl);
const title = std.fmt.bufPrintZ(
&fmtbuf,
"MZTE-NV ({s})",
.{@tagName(scope)},
) catch return;
ser.luaPushAny(l, .{
.title = title,
});
c.lua_call(l, 3, 0);
}
const vim_lvl = c.lua_tointeger(l, -1);
c.lua_pop(l, 3);
c.lua_getfield(l, -1, "notify");
const msg = std.fmt.bufPrintZ(&fmtbuf, format, args) catch return;
c.lua_pushstring(l, msg.ptr);
c.lua_pushinteger(l, vim_lvl);
const title = std.fmt.bufPrintZ(
&fmtbuf,
"MZTE-NV ({s})",
.{@tagName(scope)},
) catch return;
ser.luaPushAny(l, .{
.title = title,
});
c.lua_call(l, 3, 0);
}
pub const log_level = .debug;
pub const log_level = .debug;
};
export fn luaopen_mzte_nv(l_: ?*c.lua_State) c_int {
lua_state = l_;