nix on kil
Some checks failed
/ lint (push) Failing after 32s

This commit is contained in:
Jana Dönszelmann 2026-01-19 19:08:00 +01:00
parent b84f878dbd
commit acd7def6ed
No known key found for this signature in database
28 changed files with 5069 additions and 143 deletions

248
programs/nvim/config.lua Normal file
View file

@ -0,0 +1,248 @@
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
vim.filetype.add({
extension = {
mdx = "markdown",
}
})
-- key mapping
local keymap = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
local builtin = require('telescope.builtin')
-- comment
local esc = vim.api.nvim_replace_termcodes(
'<ESC>', true, false, true
)
local api = require('Comment.api')
vim.keymap.set("n", "<C-_>", ":lua require('Comment.api').toggle.linewise.current()<CR> j", { remap = true })
vim.keymap.set("i", "<C-_>", "<c-o>:lua require('Comment.api').toggle.linewise.current()<CR>", { remap = true })
vim.keymap.set("x", "<C-_>", function()
vim.api.nvim_feedkeys(esc, 'nx', false)
api.toggle.linewise(vim.fn.visualmode())
end, { remap = true })
vim.keymap.set('n', 'gr', (function() builtin.lsp_references({jump_type="vsplit"}) end), {})
vim.keymap.set('n', 'gd', (function() builtin.lsp_definitions({jump_type="vsplit"}) end), {})
vim.keymap.set('n', 'gt', (function() builtin.lsp_type_definitions({jump_type="vsplit"}) end), {})
local barbar_state = require("barbar.state")
function find_windows_with_buffer(bufnum)
windows = {}
local window_list = vim.api.nvim_list_wins()
for _, window in ipairs(window_list) do
local win_info = vim.fn.getwininfo(window)
if win_info ~= nil then
for _, buf in ipairs(win_info) do
if buf.bufnr == bufnum then
table.insert(windows, window)
end
end
end
end
return windows
end
function num_useful_windows()
local window_list = vim.api.nvim_tabpage_list_wins(0)
local num = 0
for _, window in ipairs(window_list) do
local win_info = vim.fn.getwininfo(window)
if win_info ~= nil then
for _, win_info in ipairs(win_info) do
if buf_is_useful(win_info.bufnr) then
num = num + 1
end
end
end
end
return num
end
function buf_is_useful(bufnr)
local bufname = vim.api.nvim_buf_get_name(bufnr)
-- if the window's buffer has no name, it's not useful
if bufname == '' then
return false
end
-- print("bufname: ", bufname)
-- if the window's buffer is read only, it's not useful
local readonly = vim.api.nvim_buf_get_option(bufnr, 'readonly')
if readonly then
-- print("=readonly")
return false
end
-- -- if the buffer is not listed, it's not useful
local listed = vim.api.nvim_buf_get_option(bufnr, 'buflisted')
if not listed then
-- print("=unlisted")
return false
end
local buftype = vim.api.nvim_buf_get_option(bufnr, 'buftype')
if buftype == "quickfix" then
-- print("=readonly")
return false
end
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
if #lines > 1 or (#lines == 1 and #lines[1] > 0) then
return true -- If the buffer has content, return false
else
return false
end
-- the window contains a useful buffer
return true
end
function quit_window(window)
vim.api.nvim_win_call(window, function()
vim.cmd "quit"
end)
end
vim.api.nvim_create_user_command('CloseBuffer', function (opts)
if num_useful_windows() > 1 then
vim.cmd {
cmd = "quit",
bang = opts.bang,
}
else
vim.cmd {
cmd = "BufferDelete",
bang = opts.bang,
}
if not buf_is_useful(vim.api.nvim_get_current_buf()) then
vim.cmd {
cmd = "quit",
bang = opts.bang,
}
end
end
end, { desc = "Close Current Buffer", bang = true, })
local function close_floating()
for _, win in ipairs(vim.api.nvim_list_wins()) do
local config = vim.api.nvim_win_get_config(win)
if config.relative ~= "" then
vim.api.nvim_win_close(win, false)
end
end
end
vim.keymap.set("n", "<Esc>", close_floating, { desc = "Close floats, clear highlights" })
local builtin = require('telescope.builtin')
vim.keymap.set("n", "<leader>x", require("telescope.builtin").resume, {
noremap = true,
silent = true,
desc = "Resume",
})
-- local gitsigns = require('gitsigns')
-- vim.keymap.set('n', '<leader>gr', gitsigns.reset_hunk)
-- vim.keymap.set('n', '<leader>gd', gitsigns.diffthis)
-- vim.keymap.set({'o', 'x'}, 'ig', ':<C-U>Gitsigns select_hunk<CR>')
-- better search
vim.cmd([[
" Better search
set incsearch
set ignorecase
set smartcase
set gdefault
nnoremap <silent> n n:call BlinkNextMatch()<CR>
nnoremap <silent> N N:call BlinkNextMatch()<CR>
function! BlinkNextMatch() abort
highlight JustMatched ctermfg=white ctermbg=magenta cterm=bold
let pat = '\c\%#' . @/
let id = matchadd('JustMatched', pat)
redraw
exec 'sleep 150m'
call matchdelete(id)
redraw
endfunction
nnoremap <silent> <Space> :silent noh<Bar>echo<CR>
nnoremap <silent> <Esc> :silent noh<Bar>echo<CR>
nnoremap <silent> n nzz
nnoremap <silent> N Nzz
nnoremap <silent> * *zz
nnoremap <silent> # #zz
nnoremap <silent> g* g*zz
]])
vim.cmd([[
inoremap <silent> <F1> <CMD>FloatermToggle<CR>
nnoremap <silent> <F1> <CMD>FloatermToggle<CR>
tnoremap <silent> <F1> <C-\><C-n><CMD>FloatermToggle<CR>
]])
vim.cmd([[
let g:suda_smart_edit = 1
filetype plugin indent on
]])
-- multicursor
vim.g.VM_default_mappings = 1
vim.g.VM_reselect_first = 1
vim.g.VM_notify_previously_selected = 1
vim.g.VM_theme = "iceblue"
-- workaround for rust-analyzer server cancelled request
for _, method in ipairs { 'textDocument/diagnostic', 'workspace/diagnostic' } do
local default_diagnostic_handler = vim.lsp.handlers[method]
vim.lsp.handlers[method] = function(err, result, context, config)
if err ~= nil and err.code == -32802 then
return
end
return default_diagnostic_handler(err, result, context, config)
end
end
require("hover").setup {
init = function()
require("hover.providers.lsp")
require('hover.providers.gh')
require('hover.providers.diagnostic')
end,
preview_opts = {
border = 'rounded'
},
-- Whether the contents of a currently open hover window should be moved
-- to a :h preview-window when pressing the hover keymap.
preview_window = false,
title = true,
}
-- Setup keymaps
vim.keymap.set("n", "K", require("hover").hover, {desc = "hover.nvim"})
vim.keymap.set("n", "gK", require("hover").hover_select, {desc = "hover.nvim (select)"})
-- vim.keymap.set("n", "<C-p>", function() require("hover").hover_switch("previous") end, {desc = "hover.nvim (previous source)"})
-- vim.keymap.set("n", "<C-n>", function() require("hover").hover_switch("next") end, {desc = "hover.nvim (next source)"})

99
programs/nvim/default.nix Normal file
View file

@ -0,0 +1,99 @@
{ pkgs, inputs, ... }:
{
home = {
sessionVariables = {
EDITOR = "nvim";
};
};
imports = [
./options.nix
./plugins.nix
./keys.nix
];
programs.nixvim = {
enable = true;
globals.mapleader = " ";
globals.maplocalleader = " ";
viAlias = true;
vimAlias = true;
# Highlight and remove extra white spaces
# same color as cursorline as per
# https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim
highlight.ExtraWhitespace.bg = "#2C323C";
match.ExtraWhitespace = "\\s\\+$";
clipboard.providers.wl-copy.enable = true;
performance = {
byteCompileLua.enable = true;
combinePlugins = {
enable = true;
standalonePlugins = [
# clashes with lualine
"onedark.nvim"
];
};
};
extraLuaPackages = ps: [ ps.magick ];
extraPackages = [ pkgs.imagemagick ];
# package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped;
package = pkgs.neovim-unwrapped;
colorschemes.onedark = {
enable = true;
settings = {
style = "deep";
highlights = {
# bright green doccomments
"@lsp.type.comment".fg = "#77B767";
"@comment.documentation.rust".fg = "#77B767";
"@comment.documentation".fg = "#77B767";
"@comment".fg = "#426639";
# "Visual".bg = "#2a2e36";
# "Cursorline".bg = "#2a2e36";
};
};
};
extraConfigLuaPre = ''
require("neoconf").setup({})
'';
extraConfigLua =
''
require("render-markdown").setup {
latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text',
}
''
# local lspconfig = require 'lspconfig'
# local configs = require 'lspconfig.configs'
# if not configs.foo_lsp then
# configs.noteslsp = {
# default_config = {
# -- cmd = {'${pkgs.custom.noteslsp}/bin/noteslsp'},
# cmd = {'./noteslsp/target/debug/noteslsp'},
# filetypes = {'markdown'},
# root_dir = function(fname)
# return lspconfig.util.find_git_ancestor(fname)
# end,
# settings = {}
# ,
# },
# }
# end
#
# lspconfig.noteslsp.setup{}
# ''
+ (builtins.readFile ./config.lua);
};
}

103
programs/nvim/keys.nix Normal file
View file

@ -0,0 +1,103 @@
_:
let
map = mode: key: action: {
inherit mode key action;
};
luamap =
mode: key: action:
map mode key "<cmd>lua ${action}<cr>";
telescope = "require('telescope.builtin')";
in
{
programs.nixvim.keymaps = [
(map "" "<f2>" "<cmd>Lspsaga rename<cr>")
(map "" "<leader>o" "<cmd>Lspsaga outline<cr>")
(map "" "<leader>." "<cmd>Lspsaga code_action<cr>")
# splitting
(map "n" "<leader>s" "<cmd>vertical sb<cr>")
# closing
(map "n" "<leader>w" "<cmd>BufferClose<cr>") # single buffer
(map "n" "<leader>cb" "<cmd>BufferClose<cr>") # single buffer
(map "n" "<leader>ct" "<cmd>CloseBuffer<cr>") # buffer or extra tab
(map "n" "<leader>q" "<cmd>CloseBuffer<cr>") # buffer or extra tab
(map "n" "<leader>co" "<cmd>silent! BufferCloseAllButVisible<cr>") # other buffers
(map "n" "<leader>cl" "<cmd>silent! BufferCloseBuffersLeft<cr>") # other buffers (left)
(map "n" "<leader>cr" "<cmd>silent! BufferCloseBuffersRight<cr>") # other buffers (right)
# moving
(map "n" "mL" "<cmd>BufferMovePrevious<cr>") # left
(map "n" "mr" "<cmd>BufferMoveNext<cr>") # right
(map "n" "m0" "<cmd>BufferMoveStart<cr>") # start
(map "n" "m$" "<cmd>BufferMoveEnd<cr>") # end
(map "n" "<leader>jb" "<cmd>BufferPick<cr>") # jump to tab
# jumplist
# (map "n" "<leader><Tab>" "<C-o>")
# (map "n" "<leader><S-Tab>" "<C-i>")
(luamap "n" "<leader>r" "${telescope}.jumplist()")
# pickers
(luamap "n" "<leader><leader>" "${telescope}.find_files()")
(luamap "n" "<leader>f" "${telescope}.live_grep()")
(luamap "n" "<leader>t" "${telescope}.lsp_document_symbols()")
(luamap "n" "<leader>T" "${telescope}.lsp_dynamic_workspace_symbols()")
# last used pickers/searches
(luamap "n" "<leader>h" "${telescope}.pickers()")
# open buffers
(luamap "n" "<leader>b" "${telescope}.buffers({sort_mru = true})")
# diagnostics
(map "n" "<leader>d" "<cmd>Trouble diagnostics toggle filter.buf=0<cr>")
(map "n" "<leader>ad" "<cmd>Trouble diagnostics toggle<cr>")
(luamap "n" "]d"
"vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR, wrap=true })"
)
(luamap "n" "[d"
"vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR, wrap=true })"
)
(luamap "n" "]w" "vim.diagnostic.goto_next({ wrap=true })")
(luamap "n" "[w" "vim.diagnostic.goto_prev({ wrap=true })")
# docs with control-d just like in autocomplete
(map "n" "<C-d>" "K")
# expand macro
(map "n" "<leader>em" "<cmd>RustLsp expandMacro<cr>")
# easier quitting etc
(map "ca" "W" "w")
(map "ca" "X" "x")
(map "ca" "Q" "CloseBuffer")
(map "ca" "q" "CloseBuffer")
# navigation
(map "" "<leader><Left>" "<C-w><Left>")
(map "" "<leader><Right>" "<C-w><Right>")
(map "" "<leader><Up>" "<C-w><Up>")
(map "" "<leader><Down>" "<C-w><Down>")
(map "" "<leader><Down>" "<C-w><Down>")
# {
# key = "/";
# action = "<cmd>lua require('spectre').open_file_search({select_word=true})<CR>";
# }
(map "n" "t" "<cmd>Neotree toggle<cr>")
# tab for indent/dedent
(map "n" "<tab>" ">>_")
(map "n" "<S-tab>" "<<_")
(map "i" "<S-tab>" "<c-d>")
(map "v" "<tab>" ">gv")
(map "v" "<S-tab>" "<gv")
# to avoid many typos
(map "n" ";" ":")
];
}

88
programs/nvim/options.nix Normal file
View file

@ -0,0 +1,88 @@
_: {
programs.nixvim.diagnostics = {
# virtual_lines.enable = false;
# # virtual_lines = {
# # current_line = true;
# # format = ''
# # function(d)
# # if d.severity == vim.diagnostic.severity.ERROR then
# # return d
# # else
# # return ""
# # end
# # end
# # '';
# # };
# virtual_text = false;
update_in_insert = false; # annoying with virtual_lines which keep updating
severity_sort = true;
float = {
border = "rounded";
};
};
programs.nixvim.opts = {
# lazyredraw = true;
startofline = true;
showmatch = true;
belloff = "all";
showcmd = true;
mouse = "a";
modeline = true;
wrap = false;
spell = false;
# don't change the directory when a file is opened
# to work more like an IDE
autochdir = false;
autoindent = true;
smartindent = true;
smarttab = true;
backspace = [
"indent"
"eol"
"start"
];
list = true;
swapfile = false;
backup = false;
autoread = true;
undofile = true;
undodir = "/home/jana/.vimdid";
tabstop = 4;
softtabstop = 4;
shiftwidth = 4;
expandtab = true;
# relative line numbers except the current line
number = true;
# relativenumber = true;
# show (usually) hidden characters
listchars = {
nbsp = "¬";
extends = "»";
precedes = "«";
trail = "·";
tab = ">-";
};
# highlight current line
cursorline = true;
# clipboard == system clipboard
clipboard = "unnamedplus";
completeopt = [
"menuone"
"noselect"
"noinsert"
];
};
}

752
programs/nvim/plugins.nix Normal file
View file

@ -0,0 +1,752 @@
{ pkgs, ... }:
let
render-markdown = pkgs.vimUtils.buildVimPlugin {
name = "render-markdown";
src = pkgs.fetchFromGitHub {
owner = "MeanderingProgrammer";
repo = "markdown.nvim";
rev = "78ef39530266b3a0736c48b46c3f5d1ab022c7db";
hash = "sha256-mddnBvIrekHh60Ix6qIYAnv10Mu40LamGI47EXk9wSo=";
};
};
in
# fzy-lua-native = pkgs.vimUtils.buildVimPlugin {
# name = "fzy-lua-native";
# src = pkgs.fetchFromGitHub {
# owner = "romgrk";
# repo = "fzy-lua-native";
# rev = "9d720745d5c2fb563c0d86c17d77612a3519c506";
# hash = "sha256-pBV5iGa1+5gtM9BcDk8I5SKoQ9sydOJHsmyoBcxAct0=";
# };
# };
{
programs.nixvim = {
plugins = {
treesitter-textobjects = {
enable = false;
lspInterop.enable = true;
select = {
enable = true;
keymaps = {
"ai" = {
query = "@impl.outer";
};
"ii" = {
query = "@impl.inner";
};
"af" = {
query = "@function.outer";
};
"if" = {
query = "@function.inner";
};
"ac" = {
query = "@conditional.outer";
};
"ic" = {
query = "@conditional.inner";
};
"al" = {
query = "@loop.outer";
};
"il" = {
query = "@loop.inner";
};
};
};
move = {
enable = true;
setJumps = true;
gotoNextStart = {
"]f" = {
query = "@function.outer";
};
"]c" = {
query = "@conditional.outer";
};
"]l" = {
query = "@loop.outer";
};
"]i" = {
query = "@impl.outer";
};
};
gotoNextEnd = {
"]F" = {
query = "@function.outer";
};
"]C" = {
query = "@conditional.outer";
};
"]L" = {
query = "@loop.outer";
};
"]I" = {
query = "@impl.outer";
};
};
gotoPreviousStart = {
"[f" = {
query = "@function.outer";
};
"[c" = {
query = "@conditional.outer";
};
"[l" = {
query = "@loop.outer";
};
"[i" = {
query = "@impl.outer";
};
};
gotoPreviousEnd = {
"[F" = {
query = "@function.outer";
};
"[C" = {
query = "@conditional.outer";
};
"[L" = {
query = "@loop.outer";
};
"[I" = {
query = "@impl.outer";
};
};
};
};
treesitter-context = {
enable = true;
settings = {
multiwindow = true;
separator = "";
max_lines = 4;
trim_scopes = "outer";
};
};
treesitter = {
enable = true;
nixGrammars = false;
nixvimInjections = false;
settings = {
indent.enable = true;
ensure_installed = "all";
ignore_install = [
"wing"
"brightscript"
];
highlight.enable = true;
incremental_selection = {
enable = true;
keymaps = {
scope_incremental = "s";
node_incremental = "+";
node_decremental = "-";
};
};
};
};
rainbow-delimiters.enable = true;
vim-surround.enable = true;
lsp-format.enable = true;
fugitive.enable = true;
lspkind.enable = true;
crates.enable = true;
fidget.enable = true;
nvim-autopairs.enable = true;
# nvim-highlight-colors.enable = true;
cmp = {
enable = true;
autoEnableSources = true;
settings = {
completion.completeopt = "noselect";
preselect = "None";
sources =
let
s = name: { inherit name; };
in
[
{
name = "nvim_lsp";
priority = 8;
}
# (s "nvim_lsp_signature_help")
# (s "treesitter")
(s "path")
(s "luasnip")
# (s "crates")
# (s "git")
# (s "calc")
# (s "buffer")
];
mapping =
let
next = ''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end
'';
prev = ''
function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end
'';
in
{
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<C-d>" = ''
function()
if cmp.visible_docs() then
cmp.close_docs()
else
cmp.open_docs()
end
end
'';
"<Tab>" = next;
"<S-Tab>" = prev;
"<Down>" = next;
"<Up>" = prev;
};
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
sorting.comparators = [
"offset"
"exact"
"score"
"recently_used"
"locality"
"kind"
"length"
"order"
];
window =
let
common_border = {
border = "rounded";
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None";
};
in
{
completion = common_border;
documentation = common_border;
};
};
};
image = {
enable = true;
};
# dial.nvim
which-key = {
enable = true;
};
auto-session = {
enable = true;
settings = {
auto_save_enabled = true;
auto_restore_enabled = true;
pre_save_cmds = [ "Neotree close" ];
post_restore_cmds = [ "Neotree filesystem show" ];
};
};
comment = {
enable = true;
settings = {
sticky = true;
};
};
neo-tree = {
enable = true;
closeIfLastWindow = true;
enableGitStatus = false;
window = {
position = "right";
width = 30;
# mappings = {
# "<bs>" = "navigate_up";
# "." = "set_root";
# "/" = "fuzzy_finder";
# "f" = "filter_on_submit";
# "h" = "show_help";
# };
};
filesystem = {
followCurrentFile.enabled = true;
filteredItems = {
hideHidden = false;
hideDotfiles = false;
forceVisibleInEmptyFolder = true;
hideGitignored = false;
};
};
};
nvim-lightbulb = {
enable = true;
settings = {
autocmd = {
enabled = true;
updatetime = 200;
};
line = {
enabled = true;
};
number = {
enabled = true;
hl = "LightBulbNumber";
};
float = {
enabled = false;
text = "💡";
};
sign = {
enabled = true;
text = "💡";
};
status_text = {
enabled = false;
text = "💡";
};
};
};
git-conflict = {
enable = true;
settings = {
default_mappings = {
both = "<leader>cb";
none = "<leader>c0";
ours = "<leader>co";
prev = "]x";
next = "[x";
theirs = "<leader>ct";
};
disable_diagnostics = false;
highlights = {
current = "DiffText";
incoming = "DiffAdd";
};
list_opener = "conflicts";
};
};
gitsigns = {
enable = true;
settings = {
current_line_blame = true;
current_line_blame_opts = {
virt_text = true;
virt_text_pos = "eol";
};
};
};
lspsaga = {
enable = true;
lightbulb.enable = false;
codeAction.keys = {
quit = "<Esc>";
};
symbolInWinbar.enable = false;
};
typst-vim = {
enable = true;
settings = {
cmd = "${pkgs.typst}/bin/typst";
conceal_math = 1;
auto_close_toc = 1;
};
};
lualine = {
enable = true;
settings.options.theme = "onedark";
};
rustaceanvim = {
enable = true;
settings = {
rustAnalyzerPackage = null;
auto_attach = true;
server = {
standalone = false;
default_settings = {
rust-analyzer = {
inlayHints = {
lifetimeElisionHints.enable = "always";
# expressionAdjustmentHints = {
# enable = "always";
# mode = "prefer_postfix";
# };
discriminantHints.enable = "always";
};
# check = {
# command = "+nightly clippy";
# };
cachePriming.enable = true;
diagnostic = {
refreshSupport = true;
};
};
# cargo = {
# buildScripts.enable = true;
# features = "all";
# runBuildScripts = true;
# loadOutDirsFromCheck = true;
# };
# checkOnSave = true;
# check = {
# allFeatures = true;
# command = "clippy";
# extraArgs = [ "--no-deps" ];
# };
# procMacro = { enable = true; };
# imports = {
# granularity = { group = "module"; };
# prefix = "self";
# };
# files = {
# excludeDirs =
# [ ".cargo" ".direnv" ".git" "node_modules" "target" ];
# };
#
# inlayHints = {
# bindingModeHints.enable = true;
# closureStyle = "rust_analyzer";
# closureReturnTypeHints.enable = "always";
# discriminantHints.enable = "always";
# expressionAdjustmentHints.enable = "always";
# implicitDrops.enable = true;
# lifetimeElisionHints.enable = "always";
# rangeExclusiveHints.enable = true;
# reborrowHints.enable = "mutable";
# };
#
# rustc.source = "discover";
#
options.diagnostics = {
enable = true;
styleLints.enable = true;
};
};
};
};
};
lsp = {
enable = true;
servers = {
astro.enable = true;
cssls.enable = true;
nil_ls = {
enable = true;
settings = {
formatting.command = [ "${(pkgs.lib.getExe pkgs.nixfmt-rfc-style)}" ];
};
extraOptions = {
nix = {
maxMemoryMB = 0;
flake = {
autoArchive = true;
autoEvalInputs = true;
nixpkgsInputName = "nixpkgs";
};
};
};
};
clangd = {
enable = true;
filetypes = [
"c"
"cpp"
"objc"
"objcpp"
];
};
eslint = {
enable = true;
filetypes = [
"javascript"
"javascriptreact"
"typescript"
"typescriptreact"
];
};
html = {
enable = true;
filetypes = [ "html" ];
};
jsonls = {
enable = true;
filetypes = [
"json"
"jsonc"
];
};
pyright = {
enable = true;
filetypes = [ "python" ];
};
bashls = {
enable = true;
filetypes = [
"sh"
"bash"
];
};
# ts_ls = {
# enable = true;
# filetypes =
# [ "javascript" "javascriptreact" "typescript" "typescriptreact" ];
# };
# marksman.enable = true;
yamlls = {
enable = true;
filetypes = [ "yaml" ];
};
};
inlayHints = true;
keymaps = {
lspBuf = {
"<leader>;" = "format";
"gh" = "hover";
};
};
};
# leap = {
# enable = true;
# };
wilder = {
enable = true;
modes = [
"/"
":"
"?"
];
enableCmdlineEnter = true;
beforeCursor = true;
useCmdlinechanged = true;
nextKey = "<Tab>";
prevKey = "<S-Tab>";
acceptKey = "<Down>";
rejectKey = "<Up>";
pipeline = [
''
wilder.branch(
wilder.cmdline_pipeline({
language = 'python',
fuzzy = 2,
}),
wilder.python_search_pipeline({
pattern = wilder.python_fuzzy_pattern(),
sorter = wilder.python_difflib_sorter(),
engine = 're',
}),
wilder.substitute_pipeline({
pipeline = wilder.python_search_pipeline({
skip_cmdtype_check = 1,
pattern = wilder.python_fuzzy_pattern({
start_at_boundary = 0,
}),
}),
}),
{
wilder.check(function(ctx, x) return x == "" end),
wilder.history(),
},
wilder.python_file_finder_pipeline({
file_command = {'${pkgs.ripgrep}/bin/rg', '--files'},
dir_command = {'${pkgs.fd}/bin/fd', '-td'},
filters = {'cpsm_filter'},
})
)
''
];
renderer = ''
(function()
local highlighters = {
wilder.pcre2_highlighter(),
-- wilder.lua_fzy_highlighter(),
}
local popupmenu_renderer = wilder.popupmenu_renderer(
wilder.popupmenu_border_theme({
border = 'rounded',
empty_message = wilder.popupmenu_empty_message_with_spinner(),
highlighter = highlighters,
highlights = {
accent = wilder.make_hl('WilderAccent', 'Pmenu', {{a = 1}, {a = 1}, {foreground = '#f4468f'}}),
},
left = {
' ',
wilder.popupmenu_devicons(),
wilder.popupmenu_buffer_flags({
flags = ' a + ',
icons = {['+'] = '', a = '', h = ''},
}),
},
right = {
' ',
wilder.popupmenu_scrollbar(),
},
})
)
local wildmenu_renderer = wilder.wildmenu_renderer({
highlights = {
accent = wilder.make_hl('WilderAccent', 'Pmenu', {{a = 1}, {a = 1}, {foreground = '#f4468f'}}),
},
highlighter = highlighters,
separator = ' · ',
left = {' ', wilder.wildmenu_spinner(), ' '},
right = {' ', wilder.wildmenu_index()},
})
return wilder.renderer_mux({
[':'] = popupmenu_renderer,
['/'] = wildmenu_renderer,
substitute = wildmenu_renderer,
})
end)()
'';
};
floaterm = {
enable = true;
settings = {
opener = "edit";
width = 0.8;
height = 0.8;
};
};
telescope = {
enable = true;
extensions = {
ui-select.enable = true;
fzf-native.enable = true;
frecency.enable = true;
};
settings = {
file_ignore_patterns = [
"^.git/"
"^.jj/"
"^.vscode/"
"^.idea/"
"^build/"
"^target/"
];
defaults = {
path_display = [ "smart" ];
layout_strategy = "horizontal";
layout_config = {
width = 0.99;
height = 0.99;
};
};
};
};
# diagnostics
trouble = {
enable = true;
};
# tabs
barbar = {
enable = true;
settings = {
options.diagnostics = "nvim_lsp";
focus_on_close = "previous";
};
};
# for lsp/cmp inside markdown code blocks
otter = {
enable = true;
};
none-ls = {
enable = true;
sources = {
formatting.nixpkgs_fmt.enable = true;
code_actions.statix.enable = true;
diagnostics = {
statix.enable = true;
deadnix.enable = true;
};
};
};
nix.enable = true;
web-devicons.enable = true;
};
extraPlugins = with pkgs.vimPlugins; [
telescope-ui-select-nvim
telescope-fzf-native-nvim
vim-suda
render-markdown
vim-astro
nvim-web-devicons
vim-visual-multi
vim-gh-line
neoconf-nvim
vim-autoswap
targets-vim
# fzy-lua-native
cpsm
# jj
vim-jjdescription
hover-nvim
];
};
}