1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

chore: apply nixvim updates

This commit is contained in:
oddlama 2024-03-11 20:41:28 +01:00
parent 1b0934b565
commit e9fbbb9c7d
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
7 changed files with 316 additions and 232 deletions

View file

@ -31,7 +31,11 @@
{
type = "button";
val = " New file";
on_press.__raw = "function() vim.cmd[[enew]] end";
on_press.__raw =
/*
lua
*/
"function() vim.cmd[[enew]] end";
opts = {
shortcut = "e";
position = "center";
@ -54,7 +58,11 @@
{
type = "button";
val = "󰅙 Quit Neovim";
on_press.__raw = "function() vim.cmd[[qa]] end";
on_press.__raw =
/*
lua
*/
"function() vim.cmd[[qa]] end";
opts = {
shortcut = "q";
position = "center";

View file

@ -20,8 +20,9 @@
cmp-nvim-lsp.enable = true;
cmp-nvim-lsp-document-symbol.enable = true;
cmp-nvim-lsp-signature-help.enable = true;
nvim-cmp = {
cmp = {
enable = true;
settings = {
sources = [
{name = "nvim_lsp_signature_help";}
{name = "nvim_lsp";}
@ -31,21 +32,38 @@
{name = "luasnip";}
{name = "emoji";}
];
mappingPresets = ["insert"];
mapping = {
"<CR>" = ''
"<CR>" =
/*
lua
*/
''
cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
})
'';
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-e>" = "cmp.mapping.abort()";
"<Tab>" = {
modes = ["i" "s"];
action = ''
function(fallback)
"<C-d>" =
/*
lua
*/
"cmp.mapping.scroll_docs(-4)";
"<C-f>" =
/*
lua
*/
"cmp.mapping.scroll_docs(4)";
"<C-e>" =
/*
lua
*/
"cmp.mapping.abort()";
"<Tab>" =
/*
lua
*/
''
cmp.mapping(function(fallback)
local has_words_before = function()
local line, col = table.unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil
@ -62,13 +80,14 @@
else
fallback()
end
end
end, {"i", "s"})
'';
};
"<S-Tab>" = {
modes = ["i" "s"];
action = ''
function(fallback)
"<S-Tab>" =
/*
lua
*/
''
cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
@ -76,12 +95,15 @@
else
fallback()
end
end
end, {"i", "s"})
'';
};
};
formatting.fields = ["abbr" "kind" "menu"];
formatting.format = ''
formatting.format =
/*
lua
*/
''
function(_, vim_item)
local icons = {
Namespace = "󰌗",
@ -129,7 +151,16 @@
return vim_item
end
'';
snippet.expand = "luasnip";
snippet.expand =
/*
lua
*/
''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
};
};
# TODO use "ray-x/lsp_signature.nvim"

View file

@ -51,7 +51,11 @@
{
event = ["BufEnter" "BufWinEnter"];
pattern = ["term://*"];
callback.__raw = ''
callback.__raw =
/*
lua
*/
''
function()
vim.bo.number = false
end
@ -60,7 +64,11 @@
{
event = ["WinEnter"];
pattern = ["*"];
callback.__raw = ''
callback.__raw =
/*
lua
*/
''
function()
pcall(function()
if vim.bo.buftype == "nofile" or vim.bo.buftype == "help" then

View file

@ -6,7 +6,11 @@
programs.nixvim.plugins = {
lsp = {
enable = true;
preConfig = ''
preConfig =
/*
lua
*/
''
local lsp_symbol = function(name, icon)
vim.fn.sign_define(
"DiagnosticSign" .. name,

View file

@ -4,7 +4,11 @@
notify = {
enable = true;
stages = "static";
render.__raw = ''"compact"'';
render.__raw =
/*
lua
*/
''"compact"'';
icons = {
debug = "";
error = "󰅙";
@ -68,14 +72,22 @@
vim-startuptime
];
extraConfigLuaPre = ''
extraConfigLuaPre =
/*
lua
*/
''
vim.g.operator_sandwich_no_default_key_mappings = 1
vim.g.textobj_sandwich_no_default_key_mappings = 1
vim.g.wordmotion_nomap = 1
'';
extraConfigLuaPost = ''
extraConfigLuaPost =
/*
lua
*/
''
require("window-picker").setup {
hint = "floating-big-letter",
filter_rules = {

View file

@ -15,10 +15,26 @@
"t" = "open_tabnew";
"z" = "close_all_nodes";
"Z" = "expand_all_nodes";
"a".__raw = ''{ "add", config = { show_path = "relative" } }'';
"A".__raw = ''{ "add_directory", config = { show_path = "relative" } }'';
"c".__raw = ''{ "copy", config = { show_path = "relative" } }'';
"m".__raw = ''{ "move", config = { show_path = "relative" } }'';
"a".__raw =
/*
lua
*/
''{ "add", config = { show_path = "relative" } }'';
"A".__raw =
/*
lua
*/
''{ "add_directory", config = { show_path = "relative" } }'';
"c".__raw =
/*
lua
*/
''{ "copy", config = { show_path = "relative" } }'';
"m".__raw =
/*
lua
*/
''{ "move", config = { show_path = "relative" } }'';
};
};
defaultComponentConfigs = {

View file

@ -9,7 +9,12 @@
onedark-nvim
];
extraConfigLua = lib.mkBefore ''
extraConfigLua =
lib.mkBefore
/*
lua
*/
''
local onedark = require "onedark"
onedark.setup {
toggle_style_key = "<nop>",