mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
feat: move to nixvim
This commit is contained in:
parent
ca97476a47
commit
779c3c4098
22 changed files with 772 additions and 57 deletions
|
|
@ -1,5 +1,5 @@
|
|||
{tree, ...}: {
|
||||
imports = with tree.home.profiles; [
|
||||
neovim
|
||||
nixvim.nixvim
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,11 +53,19 @@ in {
|
|||
# Buffers
|
||||
bufferline-nvim
|
||||
rustaceanvim
|
||||
# session
|
||||
auto-session
|
||||
# zk
|
||||
zk-nvim
|
||||
# task runner
|
||||
overseer-nvim
|
||||
# tree
|
||||
nui-nvim
|
||||
neo-tree-nvim
|
||||
# obsidian vault support for neovim
|
||||
obsidian-nvim
|
||||
# aerial (skimming and quick nav)
|
||||
aerial-nvim
|
||||
# commentry
|
||||
vim-commentary
|
||||
# tree sitter
|
||||
|
|
|
|||
|
|
@ -123,7 +123,35 @@ end
|
|||
-----------------------------------------------------------
|
||||
|
||||
-- lualine
|
||||
require('lualine').setup{}
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
theme = bubbles_theme,
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { { 'mode', separator = { left = '' }, right_padding = 2 } },
|
||||
lualine_b = { 'filename', 'branch', 'diff' },
|
||||
lualine_c = {
|
||||
'%=', --[[ add your center components here in place of this comment ]]
|
||||
},
|
||||
lualine_x = { 'overseer' },
|
||||
lualine_y = { 'filetype', 'progress' },
|
||||
lualine_z = {
|
||||
{ 'location', separator = { right = '' }, left_padding = 2 },
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = { 'filename' },
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = { 'location' },
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
|
||||
-- nvim-cmp
|
||||
vim.diagnostic.config({
|
||||
|
|
@ -225,6 +253,12 @@ require('neorg').setup {
|
|||
},
|
||||
}
|
||||
|
||||
-- overseer
|
||||
require("overseer").setup()
|
||||
|
||||
-- auto-session
|
||||
require("auto-session").setup({})
|
||||
|
||||
-- telescope
|
||||
local telescope = require('telescope.builtin')
|
||||
|
||||
|
|
@ -281,6 +315,18 @@ require("twilight").setup {
|
|||
},
|
||||
}
|
||||
|
||||
-- Aerial overview (skimming and quick nav)
|
||||
require("aerial").setup({
|
||||
-- optionally use on_attach to set keymaps when aerial has attached to a buffer
|
||||
on_attach = function(bufnr)
|
||||
-- Jump forwards/backwards with '{' and '}'
|
||||
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
|
||||
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
|
||||
end,
|
||||
})
|
||||
-- You probably also want to set a keymap to toggle aerial
|
||||
vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>")
|
||||
|
||||
-- bufferline
|
||||
require('bufferline').setup {
|
||||
options = {
|
||||
|
|
@ -362,3 +408,25 @@ vim.keymap.set("", "F", function()
|
|||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
|
||||
end, {remap=true})
|
||||
|
||||
-- https://github.com/zk-org/zk-nvim
|
||||
require("zk").setup({
|
||||
-- Can be "telescope", "fzf", "fzf_lua", "minipick", "snacks_picker",
|
||||
-- or select" (`vim.ui.select`).
|
||||
picker = "telescope",
|
||||
|
||||
lsp = {
|
||||
-- `config` is passed to `vim.lsp.start(config)`
|
||||
config = {
|
||||
name = "zk",
|
||||
cmd = { "zk", "lsp" },
|
||||
filetypes = { "markdown" },
|
||||
-- on_attach = ...
|
||||
-- etc, see `:h vim.lsp.start()`
|
||||
},
|
||||
|
||||
-- automatically attach buffers in a zk notebook that match the given filetypes
|
||||
auto_attach = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
106
home/profiles/nixvim/nixvim.nix
Normal file
106
home/profiles/nixvim/nixvim.nix
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
lib,
|
||||
tree,
|
||||
std,
|
||||
...
|
||||
}: let
|
||||
inherit (std) set;
|
||||
inherit (lib.attrsets) genAttrs;
|
||||
in {
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
imports = [
|
||||
tree.home.profiles.nixvim.plugins
|
||||
];
|
||||
vimAlias = true;
|
||||
opts = {
|
||||
mouse = "a";
|
||||
clipboard = "unnamedplus";
|
||||
completeopt = "longest,menuone";
|
||||
backup = false;
|
||||
writebackup = false;
|
||||
ttimeoutlen = 100;
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
showmatch = true;
|
||||
foldmethod = "marker";
|
||||
colorcolumn = "80";
|
||||
splitright = true;
|
||||
splitbelow = true;
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
wrap = true;
|
||||
linebreak = true;
|
||||
showbreak = "↳";
|
||||
termguicolors = true;
|
||||
laststatus = 3;
|
||||
cursorline = true;
|
||||
cmdheight = 1;
|
||||
hlsearch = true;
|
||||
expandtab = true;
|
||||
shiftwidth = 2;
|
||||
tabstop = 2;
|
||||
smartindent = true;
|
||||
list = true;
|
||||
listchars = {
|
||||
tab = "» ";
|
||||
extends = "›";
|
||||
precedes = "‹";
|
||||
nbsp = "·";
|
||||
trail = "✖";
|
||||
};
|
||||
hidden = true;
|
||||
history = 1000;
|
||||
shada = "'1000,f1,<500,@500,/500";
|
||||
lazyredraw = true;
|
||||
synmaxcol = 240;
|
||||
updatetime = 700;
|
||||
};
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = ",";
|
||||
};
|
||||
plugins = let
|
||||
pluginsToGen = [
|
||||
"lastplace"
|
||||
"commentary"
|
||||
"treesitter"
|
||||
"treesitter-context"
|
||||
"nix-develop"
|
||||
"lualine"
|
||||
"startup"
|
||||
"lazygit"
|
||||
"web-devicons"
|
||||
"auto-session"
|
||||
"overseer"
|
||||
"twilight"
|
||||
"bufferline"
|
||||
"zk"
|
||||
"rainbow"
|
||||
];
|
||||
basePlugin = {
|
||||
enable = true;
|
||||
autoLoad = true;
|
||||
};
|
||||
in
|
||||
set.merge [
|
||||
(genAttrs pluginsToGen (_: basePlugin))
|
||||
{
|
||||
auto-session.settings = {
|
||||
bypass_save_filetypes = ["startup"];
|
||||
close_filetypes_on_save = ["startup"];
|
||||
};
|
||||
twilight.settings = {
|
||||
context = 10;
|
||||
dimming.alpha = 0.5;
|
||||
expand = [
|
||||
"function"
|
||||
"method"
|
||||
"table"
|
||||
"if_statement"
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
29
home/profiles/nixvim/plugins/aerial.nix
Normal file
29
home/profiles/nixvim/plugins/aerial.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
_: {
|
||||
plugins = let
|
||||
basePlugin = {
|
||||
enable = true;
|
||||
autoLoad = true;
|
||||
};
|
||||
in {
|
||||
aerial =
|
||||
basePlugin
|
||||
// {
|
||||
settings = {
|
||||
backends = [
|
||||
"treesitter"
|
||||
"lsp"
|
||||
"markdown"
|
||||
"man"
|
||||
];
|
||||
attach_mode = "global";
|
||||
highlight_on_hover = true;
|
||||
on_attach.__raw = ''
|
||||
function(buffer)
|
||||
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
|
||||
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
60
home/profiles/nixvim/plugins/hop.nix
Normal file
60
home/profiles/nixvim/plugins/hop.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
_: {
|
||||
keymaps = [
|
||||
{
|
||||
key = "f";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require'hop'.hint_char1({
|
||||
direction = require'hop.hint'.HintDirection.AFTER_CURSOR,
|
||||
current_line_only = true
|
||||
})
|
||||
end
|
||||
'';
|
||||
options.remap = true;
|
||||
}
|
||||
{
|
||||
key = "F";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require'hop'.hint_char1({
|
||||
direction = require'hop.hint'.HintDirection.BEFORE_CURSOR,
|
||||
current_line_only = true
|
||||
})
|
||||
end
|
||||
'';
|
||||
options.remap = true;
|
||||
}
|
||||
{
|
||||
key = "t";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require'hop'.hint_char1({
|
||||
direction = require'hop.hint'.HintDirection.AFTER_CURSOR,
|
||||
current_line_only = true,
|
||||
hint_offset = -1
|
||||
})
|
||||
end
|
||||
'';
|
||||
options.remap = true;
|
||||
}
|
||||
{
|
||||
key = "T";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require'hop'.hint_char1({
|
||||
direction = require'hop.hint'.HintDirection.BEFORE_CURSOR,
|
||||
current_line_only = true,
|
||||
hint_offset = 1
|
||||
})
|
||||
end
|
||||
'';
|
||||
options.remap = true;
|
||||
}
|
||||
];
|
||||
plugins = {
|
||||
hop = {
|
||||
enable = true;
|
||||
autoLoad = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
44
home/profiles/nixvim/plugins/lsp.nix
Normal file
44
home/profiles/nixvim/plugins/lsp.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.attrsets) genAttrs;
|
||||
in {
|
||||
lsp.servers = let
|
||||
baseServer = {
|
||||
enable = true;
|
||||
activate = true;
|
||||
};
|
||||
serversToGen = [
|
||||
"rust_analyzer"
|
||||
"nixd"
|
||||
"zk"
|
||||
];
|
||||
in
|
||||
(genAttrs serversToGen (_: baseServer))
|
||||
// {
|
||||
};
|
||||
plugins = let
|
||||
pluginsToGen = [
|
||||
"lspconfig"
|
||||
"cmp"
|
||||
"cmp-clippy"
|
||||
"cmp-cmdline"
|
||||
"cmp-emoji"
|
||||
"cmp-nvim-lsp"
|
||||
"cmp-path"
|
||||
"cmp-rg"
|
||||
"cmp-spell"
|
||||
"cmp-tmux"
|
||||
"cmp-treesitter"
|
||||
"cmp-zsh"
|
||||
];
|
||||
basePlugin = {
|
||||
enable = true;
|
||||
autoLoad = true;
|
||||
};
|
||||
in
|
||||
genAttrs pluginsToGen (_: basePlugin);
|
||||
diagnostic.settings = {
|
||||
virtual_text = true;
|
||||
virtual_lines = true;
|
||||
underlines = true;
|
||||
};
|
||||
}
|
||||
95
home/profiles/nixvim/plugins/startup.nix
Normal file
95
home/profiles/nixvim/plugins/startup.nix
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
_: {
|
||||
plugins = let
|
||||
basePlugin = {
|
||||
enable = true;
|
||||
autoLoad = true;
|
||||
};
|
||||
in {
|
||||
startup =
|
||||
basePlugin
|
||||
// {
|
||||
settings = {
|
||||
colors = {
|
||||
background = "#1f2227";
|
||||
folded_section = "#56b6c2";
|
||||
};
|
||||
mappings = {
|
||||
execute_command = "<CR>";
|
||||
open_file = "o";
|
||||
open_file_split = "<c-o>";
|
||||
open_help = "?";
|
||||
open_section = "<TAB>";
|
||||
};
|
||||
header = {
|
||||
type = "text";
|
||||
oldfiles_directory = false;
|
||||
align = "center";
|
||||
fold_section = false;
|
||||
title = "Header";
|
||||
margin = 5;
|
||||
highlight = "Statement";
|
||||
default_color = "";
|
||||
oldfiles_amount = 0;
|
||||
content = [
|
||||
"█ █ █ █ "
|
||||
"█ █ █ █ █ "
|
||||
"█ █ █ █ █ "
|
||||
"█ ▒█ ███ █████ █████ █░ █ █░ █ ███ █████ ▓██▒ █▒██▒ "
|
||||
"█ ▒█ █ █ █ ▓▒ ▒▓ ▓▒ ▒█ █ █ ▓█ ▓ █▓ ▒█ "
|
||||
"█▒█ █ █ █ ▒█ █▒ ░█ █ █▒ █ █ █░ █ █ "
|
||||
"██▓ █ █ █ █ █ █▒█▒█ █ █ █ █ █ "
|
||||
"█░█░ █ █ █ █▓▓ █████ █ █ █░ █ █ "
|
||||
"█ ░█ █ █░ █░ ▓█▒ ▒█▒█▒ █ █░ ▓█ ▓ █ █ "
|
||||
"█ ▒█ █████ ▒██ ▒██ ▒█ █ █ █████ ▒██ ▓██▒ █ █ "
|
||||
" ▒█ "
|
||||
" █▒ "
|
||||
" ██ "
|
||||
];
|
||||
};
|
||||
body = {
|
||||
type = "mapping";
|
||||
oldfiles_directory = false;
|
||||
align = "center";
|
||||
fold_section = false;
|
||||
title = "Basic Commands";
|
||||
margin = 5;
|
||||
content = [
|
||||
[" Find File" "Telescope find_files" "<leader>ff"]
|
||||
[" Find Word" "Telescope live_grep" "<leader>lg"]
|
||||
[" Recent Files" "Telescope oldfiles" "<leader>of"]
|
||||
[" File Browser" "Telescope file_browser" "<leader>fb"]
|
||||
[" New File" "lua require'startup'.new_file()" "<leader>nf"]
|
||||
];
|
||||
highlight = "String";
|
||||
default_color = "";
|
||||
oldfiles_amount = 0;
|
||||
};
|
||||
footer = {
|
||||
type = "text";
|
||||
oldfiles_directory = false;
|
||||
align = "center";
|
||||
fold_section = false;
|
||||
title = "Footer";
|
||||
margin = 5;
|
||||
content = ["waow sleepy girl"];
|
||||
highlight = "Number";
|
||||
default_color = "";
|
||||
oldfiles_amount = 0;
|
||||
};
|
||||
options = {
|
||||
after = null;
|
||||
cursor_column = 0.5;
|
||||
disable_statuslines = true;
|
||||
empty_lines_between_mappings = true;
|
||||
mapping_keys = true;
|
||||
paddings = [1 3 3 0];
|
||||
};
|
||||
parts = [
|
||||
"header"
|
||||
"body"
|
||||
"footer"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
36
home/profiles/nixvim/plugins/telescope.nix
Normal file
36
home/profiles/nixvim/plugins/telescope.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
_: {
|
||||
keymaps = [
|
||||
{
|
||||
options.silent = true;
|
||||
key = "<Leader>fb";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require("telescope").extensions.file_browser.file_browser()
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
plugins = let
|
||||
basePlugin = {
|
||||
enable = true;
|
||||
autoLoad = true;
|
||||
};
|
||||
in {
|
||||
telescope =
|
||||
basePlugin
|
||||
// {
|
||||
keymaps = {
|
||||
"<Leader>fg" = "live_grep";
|
||||
"<Leader>ff" = "find_files";
|
||||
"<Leader>fB" = "buffers";
|
||||
"<Leader>fh" = "help_tags";
|
||||
};
|
||||
extensions = {
|
||||
file-browser.enable = true;
|
||||
frecency.enable = true;
|
||||
ui-select.enable = true;
|
||||
undo.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
13
home/profiles/shell/lazygit.nix
Normal file
13
home/profiles/shell/lazygit.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
_: {
|
||||
programs.lazygit = {
|
||||
enable = true;
|
||||
settings = {
|
||||
git = {
|
||||
overrideGpg = true;
|
||||
pagers = [
|
||||
{pager = "delta --paging=never";}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
3
home/profiles/shell/navi.nix
Normal file
3
home/profiles/shell/navi.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
_: {
|
||||
programs.navi.enable = true;
|
||||
}
|
||||
14
home/profiles/shell/television.nix
Normal file
14
home/profiles/shell/television.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
programs.nix-search-tv = {
|
||||
enable = true;
|
||||
package = inputs.nix-search-tv.packages.${pkgs.system}.default;
|
||||
enableTelevisionIntegration = true;
|
||||
};
|
||||
programs.television = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
3
home/profiles/shell/zk.nix
Normal file
3
home/profiles/shell/zk.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
_: {
|
||||
programs.zk.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue