added stuff
This commit is contained in:
parent
937f28770d
commit
236b8c2a6b
907 changed files with 70990 additions and 0 deletions
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) filter map toString elem;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
inherit (lib.strings) hasSuffix;
|
||||
inherit (lib.lists) concatLists;
|
||||
|
||||
mkNeovimModule = {
|
||||
path,
|
||||
ignoredPaths ? [./plugins/sources/default.nix],
|
||||
}:
|
||||
filter (hasSuffix ".nix") (
|
||||
map toString (
|
||||
filter (path: path != ./default.nix && !elem path ignoredPaths) (listFilesRecursive path)
|
||||
)
|
||||
);
|
||||
|
||||
nvf = inputs.neovim-flake;
|
||||
in {
|
||||
imports = concatLists [
|
||||
# neovim-flake home-manager module
|
||||
[nvf.homeManagerModules.default]
|
||||
|
||||
# construct this entire directory as a module
|
||||
# which means all default.nix files will be imported automatically
|
||||
(mkNeovimModule {path = ./.;})
|
||||
];
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
-- alias for vim.api.nvim_create_autocmd
|
||||
local create_autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- taken from https://github.com/sitiom/nvim-numbertoggle
|
||||
-- I would much rather avoid fetching yet another plugin for something
|
||||
-- that should be done locally - and not as a plugin
|
||||
local augroup = vim.api.nvim_create_augroup("numbertoggle", {})
|
||||
|
||||
create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "CmdlineLeave", "WinEnter" }, {
|
||||
pattern = "*",
|
||||
group = augroup,
|
||||
callback = function()
|
||||
if vim.o.nu and vim.api.nvim_get_mode().mode ~= "i" then
|
||||
vim.opt.relativenumber = true
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "CmdlineEnter", "WinLeave" }, {
|
||||
pattern = "*",
|
||||
group = augroup,
|
||||
callback = function()
|
||||
if vim.o.nu then
|
||||
vim.opt.relativenumber = false
|
||||
vim.cmd "redraw"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- enable spell checking & line wrapping
|
||||
-- for git commit messages
|
||||
create_autocmd({ "FileType" }, {
|
||||
pattern = { "gitcommit" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Highlight yank after yanking
|
||||
create_autocmd({ "TextYankPost" }, {
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Close terminal window if process exists with code 0
|
||||
create_autocmd("TermClose", {
|
||||
callback = function()
|
||||
if not vim.b.no_auto_quit then
|
||||
vim.defer_fn(function()
|
||||
if vim.api.nvim_get_current_line() == "[Process exited 0]" then
|
||||
vim.api.nvim_buf_delete(0, { force = true })
|
||||
end
|
||||
end, 50)
|
||||
end
|
||||
end,
|
||||
})
|
|
@ -0,0 +1,25 @@
|
|||
local options = {
|
||||
-- disable the -- STATUS -- line
|
||||
showmode = false,
|
||||
|
||||
-- spellchecking
|
||||
spell = true,
|
||||
|
||||
-- spell langs
|
||||
spelllang = { "en" },
|
||||
}
|
||||
|
||||
|
||||
-- iterate over the options table and set the options
|
||||
-- for each key = value pair
|
||||
for key, value in pairs(options) do
|
||||
vim.opt[key] = value
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = { "toggleterm" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = false
|
||||
vim.opt_local.spell = false
|
||||
end,
|
||||
})
|
|
@ -0,0 +1,37 @@
|
|||
local float_options = {
|
||||
border = 'single',
|
||||
max_width = math.ceil(vim.api.nvim_win_get_width(0) * 0.6),
|
||||
max_height = math.ceil(vim.api.nvim_win_get_height(0) * 0.8),
|
||||
}
|
||||
|
||||
vim.lsp.handlers['textDocument/publishDiagnostics'] =
|
||||
vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = true,
|
||||
signs = false,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
vim.lsp.handlers['textDocument/show_line_diagnostics'] =
|
||||
vim.lsp.with(vim.lsp.handlers.hover, float_options)
|
||||
|
||||
-- Prevent show notification
|
||||
-- <https://github.com/neovim/neovim/issues/20457#issuecomment-1266782345>
|
||||
vim.lsp.handlers['textDocument/hover'] = function(_, result, ctx, config)
|
||||
config = config or float_options
|
||||
config.focus_id = ctx.method
|
||||
if not result then
|
||||
return
|
||||
end
|
||||
local markdown_lines =
|
||||
vim.lsp.util.convert_input_to_markdown_lines(result.contents)
|
||||
markdown_lines = vim.lsp.util.trim_empty_lines(markdown_lines)
|
||||
if vim.tbl_isempty(markdown_lines) then
|
||||
return
|
||||
end
|
||||
return vim.lsp.util.open_floating_preview(markdown_lines, 'markdown', config)
|
||||
end
|
||||
|
||||
vim.lsp.handlers['textDocument/signatureHelp'] =
|
||||
vim.lsp.with(vim.lsp.handlers.signature_help, float_options)
|
|
@ -0,0 +1,4 @@
|
|||
-- disables "how to disable mouse" message
|
||||
-- in right click popups
|
||||
vim.cmd.aunmenu [[PopUp.How-to\ disable\ mouse]]
|
||||
vim.cmd.aunmenu [[PopUp.-1-]]
|
|
@ -0,0 +1,5 @@
|
|||
if vim.g.neovide then
|
||||
vim.o.guifont = "Iosevka Nerd Font:h14" -- text below applies for VimScript
|
||||
vim.g.neovide_theme = 'auto'
|
||||
vim.g.neovide_transparency = 0.95
|
||||
end
|
|
@ -0,0 +1,59 @@
|
|||
local noice = require("noice")
|
||||
local no_top_text = {
|
||||
opts = {
|
||||
border = {
|
||||
text = { top = "" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
noice.setup({
|
||||
cmdline = {
|
||||
format = {
|
||||
cmdline = no_top_text,
|
||||
filter = no_top_text,
|
||||
lua = no_top_text,
|
||||
search_down = no_top_text,
|
||||
search_up = no_top_text,
|
||||
},
|
||||
},
|
||||
|
||||
lsp = {
|
||||
override = {
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
},
|
||||
progress = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
|
||||
popupmenu = {
|
||||
backend = "cmp",
|
||||
},
|
||||
|
||||
routes = {
|
||||
{
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
kind = "search_count",
|
||||
},
|
||||
opts = { skip = true },
|
||||
},
|
||||
},
|
||||
|
||||
views = {
|
||||
cmdline_popup = {
|
||||
border = {
|
||||
style = "single",
|
||||
},
|
||||
},
|
||||
confirm = {
|
||||
border = {
|
||||
style = "single",
|
||||
text = { top = "" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim.maps = {
|
||||
insert = {
|
||||
# vsnip
|
||||
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
|
||||
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim.maps = {
|
||||
normal = {
|
||||
# General
|
||||
"<leader>fd".action = ":lua vim.g.formatsave = not vim.g.formatsave<CR>";
|
||||
"<leader>zt".action = ":<C-U>let g:default_terminal = v:count1<CR>";
|
||||
"<leader>e".action = ":NvimTreeToggle<CR>";
|
||||
"<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>";
|
||||
"<leader>lf".action = ":lua vim.lsp.buf.format()<CR>";
|
||||
"<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>";
|
||||
|
||||
# Diffview
|
||||
"<leader>gdq".action = ":DiffviewClose<CR>";
|
||||
"<leader>gdd".action = ":DiffviewOpen ";
|
||||
"<leader>gdm".action = ":DiffviewOpen<CR>";
|
||||
"<leader>gdh".action = ":DiffviewFileHistory %<CR>";
|
||||
"<leader>gde".action = ":DiffviewToggleFiles<CR>";
|
||||
|
||||
# Git
|
||||
"<leader>gu".action = "<cmd>Gitsigns undo_stage_hunk<CR>";
|
||||
"<leader>g<C-w>".action = "<cmd>Gitsigns preview_hunk<CR>";
|
||||
"<leader>gp".action = "<cmd>Gitsigns prev_hunk<CR>";
|
||||
"<leader>gn".action = "<cmd>Gitsigns next_hunk<CR>";
|
||||
"<leader>gP".action = "<cmd>Gitsigns preview_hunk_inline<CR>";
|
||||
"<leader>gR".action = "<cmd>Gitsigns reset_buffer<CR>";
|
||||
"<leader>gb".action = "<cmd>Gitsigns blame_line<CR>";
|
||||
"<leader>gD".action = "<cmd>Gitsigns diffthis HEAD<CR>";
|
||||
"<leader>gw".action = "<cmd>Gitsigns toggle_word_diff<CR>";
|
||||
|
||||
# Telescope
|
||||
"<M-f>".action = ":Telescope resume<CR>";
|
||||
"<leader>fq".action = ":Telescope quickfix<CR>";
|
||||
"<leader>f/".action = ":Telescope live_grep<cr>";
|
||||
|
||||
# Aerial
|
||||
"<S-O>".action = ":AerialToggle<CR>";
|
||||
|
||||
# vsnip
|
||||
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
|
||||
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
|
||||
};
|
||||
|
||||
normalVisualOp = {
|
||||
"<leader>gs".action = ":Gitsigns stage_hunk<CR>";
|
||||
"<leader>gr".action = ":Gitsigns reset_hunk<CR>";
|
||||
"<leader>lr".action = "<cmd>lua vim.lsp.buf.references()<CR>";
|
||||
|
||||
# ssr.nvim
|
||||
"<leader>sr".action = ":lua require('ssr').open()<CR>";
|
||||
|
||||
# Toggleterm
|
||||
"<leader>ct" = {
|
||||
# action = ":<C-U>ToggleTermSendVisualLines v:count<CR>";
|
||||
action = "':ToggleTermSendVisualLines ' . v:count == 0 ? g:default_terminal : v:count";
|
||||
expr = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim.maps = {
|
||||
select = {
|
||||
# vsnip
|
||||
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
|
||||
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim.maps = {
|
||||
terminal = {
|
||||
"<M-x>".action = "<cmd>q<CR>";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
{
|
||||
self,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (pkgs.vimPlugins) friendly-snippets aerial-nvim nvim-surround undotree mkdir-nvim ssr-nvim direnv-vim legendary-nvim;
|
||||
pluginSources = import ./sources {inherit self pkgs;};
|
||||
in {
|
||||
programs.neovim-flake.settings.vim.extraPlugins = {
|
||||
# plugins that are pulled from nixpkgs
|
||||
direnv = {package = direnv-vim;};
|
||||
friendly-snippets = {package = friendly-snippets;};
|
||||
mkdir-nvim = {package = mkdir-nvim;};
|
||||
aerial = {
|
||||
package = aerial-nvim;
|
||||
setup = "require('aerial').setup {}";
|
||||
};
|
||||
|
||||
nvim-surround = {
|
||||
package = nvim-surround;
|
||||
setup = "require('nvim-surround').setup {}";
|
||||
};
|
||||
|
||||
undotree = {
|
||||
package = undotree;
|
||||
setup = ''
|
||||
vim.g.undotree_ShortIndicators = true
|
||||
vim.g.undotree_TreeVertShape = '│'
|
||||
'';
|
||||
};
|
||||
|
||||
ssr-nvim = {
|
||||
package = ssr-nvim;
|
||||
setup = "require('ssr').setup {}";
|
||||
};
|
||||
|
||||
legendary = {
|
||||
package = legendary-nvim;
|
||||
setup = ''
|
||||
require('legendary').setup {};
|
||||
'';
|
||||
};
|
||||
|
||||
# plugins that are built from their sources
|
||||
regexplainer = {package = pluginSources.regexplainer;};
|
||||
vim-nftables = {package = pluginSources.vim-nftables;};
|
||||
|
||||
data-view = {
|
||||
package = pluginSources.data-viewer-nvim;
|
||||
setup = ''
|
||||
-- open data files in data-viewer.nvim
|
||||
vim.api.nvim_exec([[
|
||||
autocmd BufReadPost,BufNewFile *.sqlite,*.csv,*.tsv DataViewer
|
||||
]], false)
|
||||
|
||||
|
||||
-- keybinds
|
||||
vim.api.nvim_set_keymap('n', '<leader>dv', ':DataViewer<CR>', {noremap = true})
|
||||
vim.api.nvim_set_keymap('n', '<leader>dvn', ':DataViewerNextTable<CR>', {noremap = true})
|
||||
vim.api.nvim_set_keymap('n', '<leader>dvp', ':DataViewerPrevTable<CR>', {noremap = true})
|
||||
vim.api.nvim_set_keymap('n', '<leader>dvc', ':DataViewerClose<CR>', {noremap = true})
|
||||
'';
|
||||
};
|
||||
|
||||
slides-nvim = {
|
||||
package = pluginSources.slides-nvim;
|
||||
setup = "require('slides').setup {}";
|
||||
};
|
||||
|
||||
hmts = {
|
||||
package = pluginSources.hmts;
|
||||
after = ["treesitter"];
|
||||
};
|
||||
|
||||
smart-splits = {
|
||||
package = pluginSources.smart-splits;
|
||||
setup = "require('smart-splits').setup {}";
|
||||
};
|
||||
|
||||
neotab-nvim = {
|
||||
package = pluginSources.neotab-nvim;
|
||||
setup = ''
|
||||
require('neotab').setup {
|
||||
tabkey = "<Tab>",
|
||||
act_as_tab = true,
|
||||
behavior = "nested", ---@type ntab.behavior
|
||||
pairs = { ---@type ntab.pair[]
|
||||
{ open = "(", close = ")" },
|
||||
{ open = "[", close = "]" },
|
||||
{ open = "{", close = "}" },
|
||||
{ open = "'", close = "'" },
|
||||
{ open = '"', close = '"' },
|
||||
{ open = "`", close = "`" },
|
||||
{ open = "<", close = ">" },
|
||||
},
|
||||
exclude = {},
|
||||
smart_punctuators = {
|
||||
enabled = false,
|
||||
semicolon = {
|
||||
enabled = false,
|
||||
ft = { "cs", "c", "cpp", "java" },
|
||||
},
|
||||
escape = {
|
||||
enabled = false,
|
||||
triggers = {}, ---@type table<string, ntab.trigger>
|
||||
},
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
specs-nvim = {
|
||||
package = pluginSources.specs-nvim;
|
||||
setup = ''
|
||||
require('specs').setup {
|
||||
show_jumps = true,
|
||||
popup = {
|
||||
delay_ms = 0,
|
||||
inc_ms = 15,
|
||||
blend = 15,
|
||||
width = 10,
|
||||
winhl = "PMenu",
|
||||
fader = require('specs').linear_fader,
|
||||
resizer = require('specs').shrink_resizer
|
||||
},
|
||||
|
||||
ignore_filetypes = {'NvimTree', 'undotree'},
|
||||
|
||||
ignore_buftypes = {nofile = true},
|
||||
}
|
||||
|
||||
-- toggle specs using the <C-b> keybind
|
||||
vim.api.nvim_set_keymap('n', '<C-b>', ':lua require("specs").show_specs()', { noremap = true, silent = true })
|
||||
|
||||
-- bind specs to navigation keys
|
||||
vim.api.nvim_set_keymap('n', 'n', 'n:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
assistant.copilot = {
|
||||
enable = true;
|
||||
cmp.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
autocomplete = {
|
||||
enable = true;
|
||||
type = "nvim-cmp";
|
||||
mappings = {
|
||||
# close = "<C-e>";
|
||||
confirm = "<C-y>";
|
||||
next = "<C-n>";
|
||||
previous = "<C-p>";
|
||||
scrollDocsDown = "<C-j>";
|
||||
scrollDocsUp = "<C-k>";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
autopairs.enable = true;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
binds = {
|
||||
whichKey.enable = true;
|
||||
cheatsheet.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
comments.comment-nvim.enable = true;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
dashboard = {
|
||||
alpha.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
debugger.nvim-dap = {
|
||||
enable = true;
|
||||
ui.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
filetree = {
|
||||
nvimTree = {
|
||||
enable = true;
|
||||
openOnSetup = true;
|
||||
disableNetrw = true;
|
||||
|
||||
mappings = {
|
||||
toggle = "<C-w>";
|
||||
};
|
||||
|
||||
setupOpts = {
|
||||
update_focused_file.enable = true;
|
||||
|
||||
hijack_unnamed_buffer_when_opening = true;
|
||||
hijack_cursor = true;
|
||||
hijack_directories = {
|
||||
enable = true;
|
||||
auto_open = true;
|
||||
};
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
show_on_dirs = false;
|
||||
timeout = 500;
|
||||
};
|
||||
|
||||
view = {
|
||||
cursorline = false;
|
||||
width = 35;
|
||||
};
|
||||
|
||||
renderer = {
|
||||
indent_markers.enable = true;
|
||||
root_folder_label = false; # inconsistent
|
||||
|
||||
icons = {
|
||||
modified_placement = "after";
|
||||
git_placement = "after";
|
||||
show.git = true;
|
||||
show.modified = true;
|
||||
};
|
||||
};
|
||||
|
||||
diagnostics.enable = true;
|
||||
|
||||
modified = {
|
||||
enable = true;
|
||||
show_on_dirs = false;
|
||||
show_on_open_dirs = true;
|
||||
};
|
||||
|
||||
actions = {
|
||||
change_dir.enable = false;
|
||||
change_dir.global = false;
|
||||
open_file.window_picker.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
gestures.gesture-nvim.enable = false;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
git = {
|
||||
enable = true;
|
||||
gitsigns = {
|
||||
enable = true;
|
||||
codeActions = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.neovim-flake.settings.vim = {
|
||||
languages = {
|
||||
enableLSP = true;
|
||||
enableFormat = true;
|
||||
enableTreesitter = true;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
markdown.enable = true;
|
||||
nix.enable = true;
|
||||
html.enable = true;
|
||||
css.enable = true;
|
||||
tailwind.enable = true;
|
||||
ts.enable = true;
|
||||
go.enable = true;
|
||||
python.enable = true;
|
||||
bash.enable = true;
|
||||
zig.enable = false;
|
||||
dart.enable = false;
|
||||
elixir.enable = false;
|
||||
svelte.enable = false;
|
||||
sql.enable = false;
|
||||
java = let
|
||||
jdtlsCache = "${config.xdg.cacheHome}/jdtls";
|
||||
in {
|
||||
enable = true;
|
||||
lsp.package = [
|
||||
"${lib.getExe pkgs.jdt-language-server}"
|
||||
"-configuration ${jdtlsCache}/config"
|
||||
"-data ${jdtlsCache}/workspace"
|
||||
];
|
||||
};
|
||||
|
||||
lua = {
|
||||
enable = true;
|
||||
lsp.neodev.enable = true;
|
||||
};
|
||||
|
||||
rust = {
|
||||
enable = true;
|
||||
crates.enable = true;
|
||||
};
|
||||
|
||||
clang = {
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
server = "clangd";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
lsp = {
|
||||
formatOnSave = true;
|
||||
lspkind.enable = true;
|
||||
lsplines.enable = true;
|
||||
lightbulb.enable = true;
|
||||
lspsaga.enable = false;
|
||||
lspSignature.enable = true;
|
||||
nvimCodeActionMenu.enable = true;
|
||||
trouble.enable = false;
|
||||
nvim-docs-view.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
minimap = {
|
||||
# cool for vanity but practically useless on small screens
|
||||
minimap-vim.enable = false;
|
||||
codewindow.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
notes = {
|
||||
todo-comments.enable = true;
|
||||
mind-nvim.enable = false;
|
||||
obsidian.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
notify = {
|
||||
nvim-notify.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
presence.neocord.enable = false;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
projects = {
|
||||
project-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
manualMode = false;
|
||||
detectionMethods = ["lsp" "pattern"];
|
||||
patterns = [
|
||||
".git"
|
||||
".hg"
|
||||
"Makefile"
|
||||
"package.json"
|
||||
"index.*"
|
||||
".anchor"
|
||||
"flake.nix"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
session.nvim-session-manager = {
|
||||
enable = false;
|
||||
setupOpts.autoload_mode = "Disabled"; # misbehaves with dashboard
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
statusline = {
|
||||
lualine = {
|
||||
enable = true;
|
||||
theme = "catppuccin";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
tabline = {
|
||||
nvimBufferline.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
telescope.enable = true;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
};
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
terminal = {
|
||||
toggleterm = {
|
||||
enable = true;
|
||||
mappings.open = "<C-t>";
|
||||
|
||||
setupOpts = {
|
||||
direction = "tab";
|
||||
lazygit = {
|
||||
enable = true;
|
||||
direction = "tab";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
theme = {
|
||||
enable = true;
|
||||
name = "catppuccin";
|
||||
style = "mocha";
|
||||
transparent = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{pkgs, ...}: {
|
||||
programs.neovim-flake.settings.vim = {
|
||||
treesitter = {
|
||||
fold = true;
|
||||
context.enable = true;
|
||||
|
||||
# extra grammars that will be installed by Nix
|
||||
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
regex # for regexplainer
|
||||
kdl # zellij configurations are in KDL, I want syntax highlighting
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
ui = {
|
||||
noice.enable = true;
|
||||
colorizer.enable = true;
|
||||
modes-nvim.enable = false;
|
||||
illuminate.enable = true;
|
||||
|
||||
breadcrumbs = {
|
||||
enable = true;
|
||||
source = "nvim-navic";
|
||||
navbuddy.enable = false;
|
||||
};
|
||||
|
||||
smartcolumn = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
columnAt.languages = {
|
||||
markdown = [80];
|
||||
nix = [150];
|
||||
ruby = 110;
|
||||
java = 120;
|
||||
go = [130];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
borders = {
|
||||
enable = true;
|
||||
globalStyle = "rounded";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{pkgs, ...}: {
|
||||
programs.neovim-flake.settings.vim = {
|
||||
utility = {
|
||||
ccc.enable = true;
|
||||
icon-picker.enable = true;
|
||||
diffview-nvim.enable = true;
|
||||
|
||||
vim-wakatime = {
|
||||
enable = true;
|
||||
cli-package = pkgs.wakatime;
|
||||
};
|
||||
|
||||
motion = {
|
||||
hop.enable = true;
|
||||
leap.enable = false;
|
||||
};
|
||||
|
||||
preview = {
|
||||
glow.enable = true;
|
||||
markdownPreview.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
programs.neovim-flake.settings.vim = {
|
||||
visuals = {
|
||||
enable = true;
|
||||
nvimWebDevicons.enable = true;
|
||||
scrollBar.enable = true;
|
||||
smoothScroll.enable = false;
|
||||
cellularAutomaton.enable = false;
|
||||
highlight-undo.enable = true;
|
||||
|
||||
indentBlankline = {
|
||||
enable = true;
|
||||
fillChar = null;
|
||||
eolChar = null;
|
||||
scope.enabled = true;
|
||||
};
|
||||
|
||||
cursorline = {
|
||||
enable = true;
|
||||
lineTimeout = 0;
|
||||
};
|
||||
|
||||
fidget-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
notification.window = {
|
||||
winblend = 0;
|
||||
border = "none";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
self,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (self) pins;
|
||||
inherit (pkgs) fetchFromGitHub;
|
||||
inherit (pkgs.vimUtils) buildVimPlugin;
|
||||
|
||||
sources = {
|
||||
hmts = buildVimPlugin {
|
||||
name = "hmts.nvim";
|
||||
src = pins."hmts.nvim";
|
||||
};
|
||||
|
||||
smart-splits = buildVimPlugin {
|
||||
name = "smart-splits";
|
||||
src = pins."smart-splits.nvim";
|
||||
};
|
||||
|
||||
slides-nvim = buildVimPlugin {
|
||||
name = "slides.nvim";
|
||||
src = pins."slides.nvim";
|
||||
};
|
||||
|
||||
regexplainer = buildVimPlugin {
|
||||
name = "nvim-regexplainer";
|
||||
src = fetchFromGitHub {
|
||||
owner = "bennypowers";
|
||||
repo = "nvim-regexplainer";
|
||||
rev = "4250c8f3c1307876384e70eeedde5149249e154f";
|
||||
hash = "sha256-15DLbKtOgUPq4DcF71jFYu31faDn52k3P1x47GL3+b0=";
|
||||
};
|
||||
};
|
||||
|
||||
specs-nvim = buildVimPlugin {
|
||||
name = "specs.nvim";
|
||||
src = fetchFromGitHub {
|
||||
owner = "edluffy";
|
||||
repo = "specs.nvim";
|
||||
rev = "2743e412bbe21c9d73954c403d01e8de7377890d";
|
||||
hash = "sha256-mYTzltCEKO8C7BJ3WrB/iFa1Qq1rgJlcjW6NYHPfmPk=";
|
||||
};
|
||||
};
|
||||
|
||||
deferred-clipboard = buildVimPlugin {
|
||||
name = "deferred-clipboard";
|
||||
src = fetchFromGitHub {
|
||||
owner = "EtiamNullam";
|
||||
repo = "deferred-clipboard.nvim";
|
||||
rev = "810a29d166eaa41afc220cc7cd85eeaa3c43b37f";
|
||||
hash = "sha256-nanNQEtpjv0YKEkkrPmq/5FPxq+Yj/19cs0Gf7YgKjU=";
|
||||
};
|
||||
};
|
||||
|
||||
data-viewer-nvim = buildVimPlugin {
|
||||
name = "data-viewer.nvim";
|
||||
src = fetchFromGitHub {
|
||||
owner = "VidocqH";
|
||||
repo = "data-viewer.nvim";
|
||||
rev = "40ddf37bb7ab6c04ff9e820812d1539afe691668";
|
||||
hash = "sha256-D5hvLhsYski11H9qiDDL2zlZMtYmbpHgpewiWR6C7rE=";
|
||||
};
|
||||
};
|
||||
|
||||
vim-nftables = buildVimPlugin {
|
||||
name = "vim-nftables";
|
||||
src = fetchFromGitHub {
|
||||
owner = "awisse";
|
||||
repo = "vim-nftables";
|
||||
rev = "bc29309080b4c7e1888ffb1a830846be16e5b8e7";
|
||||
hash = "sha256-L1x3Hv95t/DBBrLtPBKrqaTbIPor/NhVuEHVIYo/OaA=";
|
||||
};
|
||||
};
|
||||
|
||||
neotab-nvim = buildVimPlugin {
|
||||
name = "neotab.nvim";
|
||||
src = fetchFromGitHub {
|
||||
owner = "kawre";
|
||||
repo = "neotab.nvim";
|
||||
rev = "6c6107dddaa051504e433608f59eca606138269b";
|
||||
hash = "sha256-bSFKbjj8fJHdfBzYoQ9l3NU0GAYfdfCbESKbwdbLNSw=";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
sources
|
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) filter map toString;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
inherit (lib.strings) hasSuffix fileContents removeSuffix;
|
||||
inherit (lib.attrsets) genAttrs;
|
||||
|
||||
nvf = inputs.neovim-flake;
|
||||
in {
|
||||
config = {
|
||||
programs.neovim-flake = {
|
||||
enable = true;
|
||||
settings = {
|
||||
vim = {
|
||||
package = pkgs.neovim-unwrapped;
|
||||
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
enableEditorconfig = true;
|
||||
preventJunkFiles = true;
|
||||
enableLuaLoader = true;
|
||||
useSystemClipboard = true;
|
||||
spellChecking.enable = false;
|
||||
|
||||
debugMode = {
|
||||
enable = false;
|
||||
logFile = "/tmp/nvim.log";
|
||||
};
|
||||
|
||||
luaConfigRC = let
|
||||
inherit (nvf.lib.nvim.dag) entryAnywhere;
|
||||
|
||||
# get the name of each lua file in the lua directory, where setting files reside
|
||||
configPaths = map (f: removeSuffix ".lua" f) (filter (hasSuffix ".lua") (map toString (listFilesRecursive ./lua)));
|
||||
|
||||
# get the path of each file by removing the ./. prefix from each element in the list
|
||||
configNames = map (p: removeSuffix "./" p) configPaths;
|
||||
|
||||
# generates a key-value pair that looks roughly as follows:
|
||||
# "fileName" = entryAnywhere "<contents of ./lua/fileName.lua>"
|
||||
# which is expected by neovim-flake's modified DAG library
|
||||
luaConfig = genAttrs configNames (name:
|
||||
entryAnywhere ''
|
||||
${fileContents "${name}.lua"}
|
||||
'');
|
||||
in
|
||||
luaConfig;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
xdg.desktopEntries."Neovim" = lib.mkForce {
|
||||
name = "Neovim";
|
||||
type = "Application";
|
||||
mimeType = ["text/plain"];
|
||||
|
||||
icon = builtins.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/NotAShelf/neovim-flake/main/assets/neovim-flake-logo-work.svg";
|
||||
sha256 = "19n7n9xafyak35pkn4cww0s5db2cr97yz78w5ppbcp9jvxw6yyz3";
|
||||
};
|
||||
|
||||
exec = let
|
||||
wezterm = lib.getExe config.programs.wezterm.package;
|
||||
direnv = lib.getExe pkgs.direnv;
|
||||
in "${pkgs.writeShellScript "wezterm-neovim" ''
|
||||
# define target filename
|
||||
filename="$(readlink -f "$1")"
|
||||
|
||||
# get the directory target file is in
|
||||
dirname="$(dirname "$filename")"
|
||||
|
||||
# launch a wezterm instance with direnv and nvim
|
||||
${wezterm} -e --cwd "$dirname" -- ${lib.getExe pkgs.zsh} -c "${direnv} exec . nvim '$filename'"
|
||||
''} %f";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue