mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-06-22 21:28:36 +02:00
update nvim stuff
This commit is contained in:
parent
9cf5e92628
commit
e4b92a679d
|
@ -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",
|
||||
|
|
|
@ -5,7 +5,7 @@ lline.setup {
|
|||
theme = "dracula",
|
||||
},
|
||||
sections = {
|
||||
lualine_b = { "branch", "diff", "lsp_progress" },
|
||||
lualine_b = { "branch", "diff" },
|
||||
lualine_c = { "filename", "diagnostics" },
|
||||
},
|
||||
}
|
||||
|
|
7
mzte-nv/conf/lua/pluginconf/nvim_fidget.lua
Normal file
7
mzte-nv/conf/lua/pluginconf/nvim_fidget.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local fidget = require "fidget"
|
||||
|
||||
fidget.setup {
|
||||
text = {
|
||||
spinner = "zip",
|
||||
},
|
||||
}
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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_;
|
||||
|
|
Loading…
Reference in a new issue