editors: remove neovim

This commit is contained in:
notohh 2024-12-24 00:50:49 -05:00
parent 091f8cde16
commit 979f2ab10a
Signed by: notohh
GPG key ID: BD47506D475EE86D
29 changed files with 8 additions and 551 deletions

View file

@ -42,7 +42,7 @@
};
}
{
name = "javascript";
name = "typescript";
auto-format = true;
language-servers = [
"scls"
@ -52,8 +52,13 @@
}
];
formatter = with pkgs; {
command = lib.getExe biome;
args = ["format"];
command = lib.getExe deno;
args = [
"fmt"
"-"
"--ext"
"ts"
];
};
}
{

View file

@ -1,78 +0,0 @@
{inputs, ...}: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
./plugins
./themes
];
programs.nixvim = {
enable = true;
clipboard.providers.wl-copy.enable = true;
autoGroups = {
vim_enter = {};
};
highlightOverride = {
LspInlayHint.bg = "";
};
autoCmd = [
{
group = "vim_enter";
event = ["VimEnter"];
pattern = "*";
command = "Neotree";
}
];
keymaps = [
{
action = "<cmd>LazyGit<CR>";
key = "<C-l>";
mode = "n";
}
{
action = "<cmd>ToggleTerm<CR>";
key = "<C-t>";
mode = "n";
}
{
action = "<cmd>Telescope<CR>";
key = "<C-f>";
mode = "n";
}
];
extraConfigLua = ''
vim.wo.relativenumber = true
'';
extraConfigLuaPre = ''
local slow_format_filetypes = {}
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end, {
desc = "Re-enable autoformat-on-save",
})
vim.api.nvim_create_user_command("FormatToggle", function(args)
if args.bang then
-- Toggle formatting for current buffer
vim.b.disable_autoformat = not vim.b.disable_autoformat
else
-- Toggle formatting globally
vim.g.disable_autoformat = not vim.g.disable_autoformat
end
end, {
desc = "Toggle autoformat-on-save",
bang = true,
})
'';
};
}

View file

@ -1,29 +0,0 @@
_: {
imports = [
./editor/neotree.nix
./editor/trouble.nix
./editor/autoclose.nix
./editor/bufferline.nix
./editor/autosave.nix
./editor/treesitter.nix
./editor/guessindent.nix
./editor/luasnip.nix
./editor/cmp.nix
./lsp/lsp.nix
./lsp/conform.nix
./misc/wakatime.nix
./misc/direnv.nix
./misc/presence.nix
./misc/lazygit.nix
./misc/vimbbye.nix
./ui/lualine.nix
./ui/mini.nix
./ui/transparent.nix
./ui/telescope.nix
./ui/fidget.nix
./ui/dashboard.nix
./ui/toggleterm.nix
./ui/whichkey.nix
];
programs.nixvim.plugins.web-devicons.enable = true;
}

View file

@ -1,3 +0,0 @@
_: {
programs.nixvim.plugins.nvim-autopairs.enable = true;
}

View file

@ -1,3 +0,0 @@
_: {
programs.nixvim.plugins.auto-save.enable = true;
}

View file

@ -1,17 +0,0 @@
_: {
programs.nixvim.plugins.bufferline = {
enable = true;
settings = {
options = {
offsets = [
{
filetype = "neo-tree";
highlight = "Directory";
text = "File Explorer";
text_align = "center";
}
];
};
};
};
}

View file

@ -1,27 +0,0 @@
_: {
programs.nixvim.plugins = {
cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{name = "nvim_lsp";}
{name = "path";}
{name = "buffer";}
{name = "luasnip";}
];
mapping = {
__raw = ''
cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
})
'';
};
};
};
};
}

View file

@ -1,3 +0,0 @@
_: {
programs.nixvim.plugins.guess-indent.enable = true;
}

View file

@ -1,9 +0,0 @@
_: {
programs.nixvim.plugins.luasnip = {
enable = true;
settings = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
};
}

View file

@ -1,14 +0,0 @@
_: {
programs.nixvim.plugins.neo-tree = {
enable = true;
enableDiagnostics = true;
extraOptions = {
filesystem = {
filtered_items = {
visible = true;
hide_fotfiles = false;
};
};
};
};
}

View file

@ -1,36 +0,0 @@
{pkgs, ...}: let
treesitter-nu-grammar = pkgs.tree-sitter.buildGrammar {
language = "nu";
version = "0.0.0+rev=1561a94";
src = pkgs.fetchFromGitHub {
owner = "nushell";
repo = "tree-sitter-nu";
rev = "1561a947a5505d373e11ca337898e048ac2e389e";
hash = "sha256-RAAMBVov4q8b8MJZVlf1qwbLK8hE5AxPK1IV9TMCrTs=";
};
meta.homepage = "https://github.com/nushell/tree-sitter-nu";
};
in {
programs.nixvim.plugins.treesitter = {
enable = true;
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
bash
json
lua
markdown
nix
regex
toml
xml
yaml
rust
go
gomod
treesitter-nu-grammar
];
settings = {
highlight.enable = true;
indent.enable = false;
};
};
}

View file

@ -1,8 +0,0 @@
_: {
programs.nixvim.plugins.trouble = {
enable = true;
settings = {
auto_refresh = true;
};
};
}

View file

@ -1,79 +0,0 @@
{
pkgs,
lib,
...
}: {
programs.nixvim.plugins.conform-nvim = {
enable = true;
settings = {
formatters_by_ft = {
nix = [
[
"alejandra"
]
];
rust = [
[
"rustfmt"
]
];
go = [
[
"gofmt"
]
];
lua = [
[
"stylua"
]
];
};
format_on_save = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
local function on_format(err)
if err and err:match("timeout$") then
slow_format_filetypes[vim.bo[bufnr].filetype] = true
end
end
return { timeout_ms = 200, lsp_fallback = true }, on_format
end
'';
format_after_save = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
return { lsp_fallback = true }
end
'';
formatters = {
alejandra = {
commmand = "${lib.getExe pkgs.alejandra}";
};
rustfmt = {
commmand = "${lib.getExe pkgs.rustfmt}";
};
gofmt = {
commmand = "${lib.getExe pkgs.go}";
};
stylua = {
commmand = "${lib.getExe pkgs.stylua}";
};
};
};
};
}

View file

@ -1,43 +0,0 @@
_: {
programs.nixvim.plugins = {
lsp-format.enable = true;
lsp-lines.enable = true;
lint = {
lintersByFt = {
nix = [
"statix"
];
};
linters = {
statix = {
cmd = ["statix"];
};
};
};
lsp = {
enable = true;
inlayHints = true;
servers = {
nil_ls = {
enable = true;
};
rust_analyzer = {
enable = true;
autostart = true;
installCargo = true;
installRustc = true;
};
gopls = {
enable = true;
autostart = true;
};
nushell = {
enable = true;
};
lua_ls = {
enable = true;
};
};
};
};
}

View file

@ -1,3 +0,0 @@
_: {
programs.nixvim.plugins.direnv.enable = true;
}

View file

@ -1,3 +0,0 @@
_: {
programs.nixvim.plugins.lazygit.enable = true;
}

View file

@ -1,33 +0,0 @@
{pkgs, ...}: {
programs.nixvim = {
extraPlugins = with pkgs.vimPlugins; [
cord-nvim
];
extraConfigLua = ''
require('cord').setup {
timer = {
interval = 500,
},
editor = {
tooltip = 'Neovim',
},
display = {
show_time = true,
show_repository = true,
show_cursor_position = true,
},
lsp = {
show_problem_count = true,
severity = 1,
scope = 'workspace',
},
buttons = {
{
label = 'View Repository',
url = 'git',
},
},
}
'';
};
}

View file

@ -1,3 +0,0 @@
_: {
programs.nixvim.plugins.vim-bbye.enable = true;
}

View file

@ -1,3 +0,0 @@
_: {
programs.nixvim.plugins.wakatime.enable = true;
}

View file

@ -1,5 +0,0 @@
_: {
programs.nixvim.plugins.dashboard = {
enable = true;
};
}

View file

@ -1,8 +0,0 @@
_: {
programs.nixvim.plugins.fidget = {
enable = true;
notification.window = {
winblend = 0;
};
};
}

View file

@ -1,5 +0,0 @@
_: {
programs.nixvim.plugins.lualine = {
enable = true;
};
}

View file

@ -1,5 +0,0 @@
_: {
programs.nixvim.plugins.mini = {
enable = true;
};
}

View file

@ -1,5 +0,0 @@
_: {
programs.nixvim.plugins.telescope = {
enable = true;
};
}

View file

@ -1,13 +0,0 @@
_: {
programs.nixvim.plugins.toggleterm = {
enable = true;
settings = {
direction = "float";
float_opts = {
border = "curved";
height = 30;
width = 130;
};
};
};
}

View file

@ -1,12 +0,0 @@
_: {
programs.nixvim.plugins.transparent = {
enable = true;
settings = {
extra_groups = [
"NeoTreeNormal"
"NeoTreeNormalNC"
"NormalFloat"
];
};
};
}

View file

@ -1,90 +0,0 @@
_: {
programs.nixvim.plugins.which-key = {
enable = true;
settings = {
preset = "helix";
replace = {
desc = [
[
"<space>"
"SPACE"
]
[
"<leader>"
"SPACE"
]
[
"<[cC][rR]>"
"RETURN"
]
[
"<[tT][aA][bB]>"
"TAB"
]
[
"<[bB][sS]>"
"BACKSPACE"
]
];
spec = [
{
__unkeyed-1 = "<leader>b";
group = "Buffers";
icon = "󰓩 ";
}
{
__unkeyed = "<leader>c";
group = "Codesnap";
icon = "󰄄 ";
mode = "v";
}
{
__unkeyed-1 = "<leader>bs";
group = "Sort";
icon = "󰒺 ";
}
{
__unkeyed-1 = [
{
__unkeyed-1 = "<leader>f";
group = "Normal Visual Group";
}
{
__unkeyed-1 = "<leader>f<tab>";
group = "Normal Visual Group in Group";
}
];
mode = [
"n"
"v"
];
}
{
__unkeyed-1 = "<leader>w";
group = "windows";
proxy = "<C-w>";
}
{
__unkeyed-1 = "<leader>cS";
__unkeyed-2 = "<cmd>CodeSnapSave<CR>";
desc = "Save";
mode = "v";
}
{
__unkeyed-1 = "<leader>db";
__unkeyed-2 = {
__raw = ''
function()
require("dap").toggle_breakpoint()
end
'';
};
desc = "Breakpoint toggle";
mode = "n";
silent = true;
}
];
};
};
};
}

View file

@ -1,3 +0,0 @@
_: {
imports = [./tokyonight.nix];
}

View file

@ -1,8 +0,0 @@
_: {
programs.nixvim.colorschemes.tokyonight = {
enable = true;
settings = {
transparent = true;
};
};
}