nix-config/users/tacocat/neovim/default.nix

124 lines
2.7 KiB
Nix
Raw Permalink Normal View History

2024-03-23 15:56:39 +00:00
{pkgs, ...}: {
imports = [
./lsp.nix
./plugins.nix
./cmp.nix
];
2024-02-10 15:23:56 +00:00
programs.nixvim = {
enable = true;
2024-04-06 20:05:34 +00:00
colorschemes.kanagawa.enable = true;
2024-02-10 15:23:56 +00:00
clipboard = {
2024-02-14 01:09:30 +00:00
providers.wl-copy.enable = true;
register = "unnamedplus";
2024-02-10 15:23:56 +00:00
};
extraPackages = with pkgs; [
2024-03-23 15:56:39 +00:00
tectonic
texliveMedium
zathura
];
2024-04-06 20:05:34 +00:00
opts = {
2024-02-10 15:23:56 +00:00
number = true;
relativenumber = true;
tabstop = 2;
shiftwidth = 2;
expandtab = false;
2024-02-14 01:09:30 +00:00
scrolloff = 5;
autoindent = true;
2024-02-23 02:16:38 +00:00
smartindent = true;
2024-02-14 01:09:30 +00:00
copyindent = true;
signcolumn = "yes";
cursorline = true;
showmode = false;
};
2024-04-06 20:05:34 +00:00
extraConfigLuaPre = ''
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = 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
end
'';
2024-02-24 16:55:49 +00:00
files = {
"ftplugin/nix.lua" = {
options = {
expandtab = true;
shiftwidth = 2;
tabstop = 2;
};
};
"ftplugin/markdown.lua" = {
options = {
spell = true;
};
};
"ftplugin/tex.lua" = {
options = {
spell = true;
};
2024-03-30 15:41:38 +00:00
keymaps = [
{
action = "<cmd>TexlabBuild<CR>";
key = "<C-,>";
}
];
};
2024-02-24 16:55:49 +00:00
};
keymaps = [
{
action = "<cmd>nohl<CR>";
key = "<C-q>";
mode = ["n"];
2024-04-06 20:05:34 +00:00
options = {
desc = "Remove search highlighting";
silent = true;
};
}
{
action = "function() require(\"luasnip\").expand() end";
key = "<C-L>";
mode = ["i"];
2024-04-06 20:05:34 +00:00
lua = true;
options = {
desc = "Luasnip expand";
silent = true;
};
}
{
action = "function() require(\"luasnip\").jump(1) end";
key = "<C-J>";
mode = ["i" "s"];
2024-04-06 20:05:34 +00:00
lua = true;
options = {
desc = "Luasnip jump to next";
silent = true;
};
}
{
action = "function() require(\"luasnip\").jump(-1) end";
key = "<C-K>";
mode = ["i" "s"];
2024-04-06 20:05:34 +00:00
lua = true;
options = {
desc = "Luasnip jump to previous";
silent = true;
};
}
{
action = ''
function()
if require("luasnip").choice_active() then
require("luasnip").change_choice(1)
end
end
'';
key = "<C-E>";
mode = ["i" "s"];
2024-04-06 20:05:34 +00:00
lua = true;
options = {
desc = "Luasnip change choice";
silent = true;
};
}
];
2024-02-10 15:23:56 +00:00
};
}