mirror of
https://github.com/youwen5/nixos.git
synced 2024-11-25 02:03:51 -08:00
Compare commits
No commits in common. "02a6f0b4f8da63fc86591f784a6a071f078d30ea" and "a47575cfae76e388652c6f9520b98e84bcf9f57b" have entirely different histories.
02a6f0b4f8
...
a47575cfae
11 changed files with 734 additions and 106 deletions
111
flake.lock
111
flake.lock
|
@ -94,7 +94,6 @@
|
|||
"devshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
|
@ -196,27 +195,8 @@
|
|||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722555600,
|
||||
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_3": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
|
@ -325,28 +305,25 @@
|
|||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"flake-compat"
|
||||
],
|
||||
"gitignore": "gitignore_2",
|
||||
"nixpkgs": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724440431,
|
||||
"narHash": "sha256-9etXEOUtzeMgqg1u0wp+EdwG7RpmrAZ2yX516bMj2aE=",
|
||||
"lastModified": 1723803910,
|
||||
"narHash": "sha256-yezvUuFiEnCFbGuwj/bQcqg7RykIEqudOy/RBrId0pc=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "c8a54057aae480c56e28ef3e14e4960628ac495b",
|
||||
"rev": "bfef0ada09e2c8ac55bbcd0831bd0c9d42e651ba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -380,7 +357,6 @@
|
|||
"gitignore_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"git-hooks",
|
||||
"nixpkgs"
|
||||
|
@ -423,17 +399,16 @@
|
|||
"home-manager_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724435763,
|
||||
"narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=",
|
||||
"lastModified": 1723986931,
|
||||
"narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be",
|
||||
"rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -577,17 +552,16 @@
|
|||
"nix-darwin_3": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724469941,
|
||||
"narHash": "sha256-+U5152FwmDD9EUOiFi5CFxCK6/yFESyDei9jEIlmUtI=",
|
||||
"lastModified": 1723859949,
|
||||
"narHash": "sha256-kiaGz4deGYKMjJPOji/JVvSP/eTefrIA3rAjOnOpXl4=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "ea319a737939094b48fda9063fa3201ef2479aac",
|
||||
"rev": "076b9a905af8a52b866c8db068d6da475839d97b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -630,18 +604,6 @@
|
|||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1722555339,
|
||||
"narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1710695816,
|
||||
|
@ -690,43 +652,26 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1724224976,
|
||||
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixvim": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-compat": "flake-compat_3",
|
||||
"flake-parts": "flake-parts_3",
|
||||
"flake-parts": "flake-parts_2",
|
||||
"git-hooks": "git-hooks",
|
||||
"home-manager": "home-manager_2",
|
||||
"nix-darwin": "nix-darwin_3",
|
||||
"nixpkgs": [
|
||||
"personal-neovim",
|
||||
"nixpkgs"
|
||||
],
|
||||
"nuschtosSearch": "nuschtosSearch",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724528976,
|
||||
"narHash": "sha256-5W13nD/5ySIsxSvDqXHlj4bg2F3tNcYGKCGudWzpNzw=",
|
||||
"lastModified": 1724222231,
|
||||
"narHash": "sha256-IFlMn1lgVsZQZC9WklY9YKcCdI0mUxSYZ7EfkaKCsQU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "8234ee85eaa2c8b7f2c74f5b4cdf02c4965b07fc",
|
||||
"rev": "b7f419a759f70126e220533b724cc17e8528b184",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -739,7 +684,6 @@
|
|||
"inputs": {
|
||||
"flake-utils": "flake-utils_4",
|
||||
"nixpkgs": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
|
@ -758,26 +702,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"personal-neovim": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"nixvim": "nixvim"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724568951,
|
||||
"narHash": "sha256-hAZPVkjZi1xUEi4OGrVb+CYUlBjBbxUgCzzpB1MDPQQ=",
|
||||
"owner": "youwen5",
|
||||
"repo": "neovim-flake",
|
||||
"rev": "707837ca26cf3e125309b883815d4bbfd25ccc92",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "youwen5",
|
||||
"repo": "neovim-flake",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks-nix": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
|
@ -818,7 +742,7 @@
|
|||
"nix-darwin": "nix-darwin",
|
||||
"nix-homebrew": "nix-homebrew",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"personal-neovim": "personal-neovim",
|
||||
"nixvim": "nixvim",
|
||||
"spicetify": "spicetify",
|
||||
"stablepkgs": "stablepkgs"
|
||||
}
|
||||
|
@ -964,17 +888,16 @@
|
|||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"personal-neovim",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724338379,
|
||||
"narHash": "sha256-kKJtaiU5Ou+e/0Qs7SICXF22DLx4V/WhG1P6+k4yeOE=",
|
||||
"lastModified": 1723808491,
|
||||
"narHash": "sha256-rhis3qNuGmJmYC/okT7Dkc4M8CeUuRCSvW6kC2f3hBc=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "070f834771efa715f3e74cd8ab93ecc96fabc951",
|
||||
"rev": "1d07739554fdc4f8481068f1b11d6ab4c1a4167a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -49,12 +49,15 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
spicetify = {
|
||||
url = "github:Gerg-L/spicetify-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
personal-neovim.url = "github:youwen5/neovim-flake";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
|
|
|
@ -152,6 +152,7 @@
|
|||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
wget
|
||||
git
|
||||
curl
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
catppuccin.nixosModules.catppuccin
|
||||
lix-module.nixosModules.default
|
||||
# lanzaboote.nixosModules.lanzaboote
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
@ -30,9 +31,11 @@
|
|||
../../users/youwen/linux/laptop
|
||||
../../users/youwen/linux/packages/x86_64
|
||||
../../users/youwen/linux/programs
|
||||
../../users/youwen/common/neovim
|
||||
../../users/youwen/common
|
||||
../../users/youwen/common/neofetch
|
||||
catppuccin.homeManagerModules.catppuccin
|
||||
inputs.catppuccin.homeManagerModules.catppuccin
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -122,6 +122,7 @@
|
|||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
wget
|
||||
git
|
||||
curl
|
||||
|
|
|
@ -29,8 +29,11 @@
|
|||
../../users/youwen/common
|
||||
../../users/youwen/linux/laptop
|
||||
../../users/youwen/linux/packages/aarch-64
|
||||
../../users/youwen/common/neovim
|
||||
./home-manager-extras
|
||||
catppuccin.homeManagerModules.catppuccin
|
||||
|
||||
inputs.catppuccin.homeManagerModules.catppuccin
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -135,9 +135,23 @@
|
|||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
wget
|
||||
git
|
||||
curl
|
||||
librewolf
|
||||
gnumake
|
||||
gcc
|
||||
cachix
|
||||
gnupg
|
||||
openssh
|
||||
python3
|
||||
steam-run
|
||||
|
||||
# deps for neovim compilation
|
||||
lua51Packages.lua
|
||||
lua51Packages.luarocks
|
||||
tree-sitter
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
|
|
|
@ -32,10 +32,12 @@
|
|||
../../users/youwen/linux/packages/x86_64
|
||||
../../users/youwen/linux/programs
|
||||
../../users/youwen/common/neofetch
|
||||
../../users/youwen/common/neovim
|
||||
../../users/youwen/common
|
||||
../../users/youwen/linux/spicetify
|
||||
./home-manager-extras
|
||||
catppuccin.homeManagerModules.catppuccin
|
||||
nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
../../users/youwen/darwin/darwin-home.nix
|
||||
../../users/youwen/common/core.nix
|
||||
../../users/youwen/common/neofetch
|
||||
../../users/youwen/common/neovim
|
||||
];
|
||||
home-manager.backupFileExtension = "backup";
|
||||
}
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
{
|
||||
inputs,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = [
|
||||
inputs.personal-neovim.packages.${system}.default
|
||||
];
|
||||
|
||||
security.sudo.enable = false;
|
||||
|
||||
security.doas = {
|
||||
|
|
685
users/youwen/common/neovim/default.nix
Normal file
685
users/youwen/common/neovim/default.nix
Normal file
|
@ -0,0 +1,685 @@
|
|||
{pkgs, ...}: {
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
withNodeJs = true;
|
||||
withRuby = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
# TS/JS
|
||||
nodePackages.prettier
|
||||
|
||||
# Rust
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
|
||||
# Nix
|
||||
alejandra
|
||||
|
||||
# Python
|
||||
black
|
||||
|
||||
# Lua
|
||||
stylua
|
||||
lua-language-server
|
||||
|
||||
# Haskell
|
||||
haskellPackages.fourmolu
|
||||
|
||||
# Misc
|
||||
codespell
|
||||
ripgrep
|
||||
yazi
|
||||
fd
|
||||
];
|
||||
|
||||
luaLoader.enable = true;
|
||||
performance = {
|
||||
combinePlugins.enable = true;
|
||||
byteCompileLua.enable = true;
|
||||
};
|
||||
|
||||
colorschemes.rose-pine.enable = true;
|
||||
|
||||
opts = {
|
||||
laststatus = 3;
|
||||
relativenumber = true;
|
||||
number = true;
|
||||
};
|
||||
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
};
|
||||
|
||||
extraConfigLua = ''
|
||||
require("telescope").load_extension("yank_history")
|
||||
vim.diagnostic.config({ virtual_lines = false });
|
||||
'';
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
# Unmap space (leader)
|
||||
action = "<nop>";
|
||||
key = "<Leader>";
|
||||
options = {
|
||||
noremap = true;
|
||||
silent = true;
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = "<cmd>sp<CR><C-w>j";
|
||||
key = "<Leader>-";
|
||||
options.silent = true;
|
||||
options.desc = "Split window horizontally";
|
||||
}
|
||||
{
|
||||
action = "<cmd>vsp<CR><c-w>l";
|
||||
key = "<Leader>\\";
|
||||
options.silent = true;
|
||||
options.desc = "Split window vertically";
|
||||
}
|
||||
{
|
||||
action = "<cmd>ZenMode<CR>";
|
||||
key = "<Space>wz";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Zen mode";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<C-w>h";
|
||||
key = "<C-h>";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Move to left window";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<C-w>j";
|
||||
key = "<C-j>";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Move to lower window";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<C-w>k";
|
||||
key = "<C-k>";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Move to upper window";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<C-w>l";
|
||||
key = "<C-l>";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Move to right window";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>close<CR>";
|
||||
key = "<Leader>wd";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Close current window";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope find_files<CR>";
|
||||
key = "<Leader>ff";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Find files";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope live_grep<CR>";
|
||||
key = "<Leader>/";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Live grep";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope buffers<CR>";
|
||||
key = "<Leader>fb";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "List buffers";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope help_tags<CR>";
|
||||
key = "<Leader>fh";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Help tags";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.lsp_definitions{}<CR>";
|
||||
key = "gd";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Go to definition";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.git_files{}<CR>";
|
||||
key = "<Leader> ";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "List Git files";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.find_files{}<CR>";
|
||||
key = "<Leader>ff";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "List all files";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<C-\\><C-n>";
|
||||
key = "<C-Esc>";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Go to normal mode in built-in terminal.";
|
||||
};
|
||||
mode = "t";
|
||||
}
|
||||
{
|
||||
action = ":resize +4<CR>";
|
||||
key = "<Leader>w=";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Increase window height.";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":resize -4<CR>";
|
||||
key = "<Leader>w-";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Decrease window height.";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":vertical resize +4<CR>";
|
||||
key = "<Leader>w]";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Increase window width.";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":vertical resize -4<CR>";
|
||||
key = "<Leader>w[";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Decrease window width.";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":Bdelete!<CR>";
|
||||
key = "<Leader>bd";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Close buffer";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":bprev<CR>";
|
||||
key = "H";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Move to the previous buffer.";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":bnext<CR>";
|
||||
key = "L";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Move to the next buffer.";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":LazyGit<CR>";
|
||||
key = "<Leader>gg";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Open LazyGit";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":split | wincmd j | resize 15 | term<CR>";
|
||||
key = "<Leader>tt";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Open a half-size horizontal terminal split";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":split | wincmd j | term<CR>";
|
||||
key = "<Leader>te";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Open a horizontal terminal split";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":vsplit | wincmd l | term<CR>";
|
||||
key = "<Leader>tv";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Open a vertical terminal split";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":Trouble diagnostics<CR>";
|
||||
key = "<Leader>xx";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "View trouble diagnostics";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":Trouble symbols<CR>";
|
||||
key = "<Leader>xs";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "View symbols";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = "<Plug>(YankyPutAfter)";
|
||||
key = "p";
|
||||
mode = ["n" "x"];
|
||||
}
|
||||
{
|
||||
action = "<Plug>(YankyPutBefore)";
|
||||
key = "P";
|
||||
mode = ["n" "x"];
|
||||
}
|
||||
{
|
||||
action = "<Plug>(YankyGPutAfter)";
|
||||
key = "gp";
|
||||
mode = ["n" "x"];
|
||||
}
|
||||
{
|
||||
action = "<Plug>(YankyGPutBefore)";
|
||||
key = "gP";
|
||||
mode = ["n" "x"];
|
||||
}
|
||||
{
|
||||
action = ":Telescope yank_history<CR>";
|
||||
key = "<Leader>p";
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = '':lua require("yazi").yazi()<CR>'';
|
||||
key = "<Leader>mm";
|
||||
options = {
|
||||
desc = "Open Yazi current nvim working directory";
|
||||
noremap = true;
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
action = '':lua vim.lsp.buf.code_action()<CR>'';
|
||||
key = "<Leader>ca";
|
||||
options = {
|
||||
desc = "View available code actions";
|
||||
noremap = true;
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
action = '':lua vim.lsp.buf.rename()<CR>'';
|
||||
key = "<Leader>cr";
|
||||
options = {
|
||||
desc = "Rename symbol";
|
||||
noremap = true;
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
action = '':lua require("lsp_lines").toggle()<CR>'';
|
||||
key = "<Leader>cd";
|
||||
options = {
|
||||
desc = "Toggle lsp lines";
|
||||
noremap = true;
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
# {
|
||||
# action = ":Yazi<CR>";
|
||||
# key = "<Leader>mf";
|
||||
# options = {
|
||||
# desc = "Open Yazi at current file";
|
||||
# noremap = true;
|
||||
# silent = true;
|
||||
# };
|
||||
# }
|
||||
# {
|
||||
# action = "<cmd>lua require'conform'.format({ bufnr = args.bf })<CR>";
|
||||
# key = "<Leader>cf";
|
||||
# options = {
|
||||
# silent = true;
|
||||
# noremap = true;
|
||||
# desc = "Format buffer";
|
||||
# };
|
||||
# }
|
||||
];
|
||||
|
||||
plugins = {
|
||||
# LSP and Treesitter related
|
||||
lsp = {
|
||||
enable = true;
|
||||
inlayHints = true;
|
||||
servers = {
|
||||
bashls.enable = true;
|
||||
clangd.enable = true;
|
||||
pyright.enable = true;
|
||||
nixd.enable = true;
|
||||
nushell.enable = true;
|
||||
svelte.enable = true;
|
||||
tailwindcss.enable = true;
|
||||
typst-lsp.enable = true;
|
||||
marksman.enable = true;
|
||||
};
|
||||
};
|
||||
treesitter = {
|
||||
enable = true;
|
||||
settings = {
|
||||
highlight.enable = true;
|
||||
indent.enable = true;
|
||||
folding.enable = true;
|
||||
};
|
||||
};
|
||||
lsp-lines.enable = true;
|
||||
crates-nvim.enable = true;
|
||||
treesitter-context.enable = true;
|
||||
|
||||
# Language specific tools
|
||||
markdown-preview.enable = true;
|
||||
# rustaceanvim.enable = true;
|
||||
typescript-tools.enable = true;
|
||||
|
||||
# git stuff
|
||||
lazygit.enable = true;
|
||||
gitsigns.enable = true;
|
||||
|
||||
# QoL and utility
|
||||
intellitab.enable = true;
|
||||
guess-indent.enable = true;
|
||||
vim-bbye.enable = true;
|
||||
indent-blankline.enable = true;
|
||||
which-key.enable = true;
|
||||
zen-mode.enable = true;
|
||||
nvim-autopairs.enable = true;
|
||||
yanky = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
telescope = {
|
||||
enable = true;
|
||||
extensions = {
|
||||
ui-select = {
|
||||
enable = true;
|
||||
settings = {
|
||||
codeactions = true;
|
||||
};
|
||||
};
|
||||
media-files = {
|
||||
enable = true;
|
||||
settings = {
|
||||
filetypes = [
|
||||
"png"
|
||||
"webp"
|
||||
"jpg"
|
||||
"jpeg"
|
||||
"mp4"
|
||||
"svg"
|
||||
"pdf"
|
||||
"mov"
|
||||
"mkv"
|
||||
"avi"
|
||||
];
|
||||
find_cmd = "rg";
|
||||
};
|
||||
dependencies = {
|
||||
imageMagick.enable = true;
|
||||
pdftoppm.enable = true;
|
||||
ffmpegthumbnailer.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
trouble.enable = true;
|
||||
direnv.enable = true;
|
||||
yazi = {
|
||||
enable = true;
|
||||
settings = {
|
||||
open_for_directories = true;
|
||||
};
|
||||
};
|
||||
harpoon = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
addFile = "<Leader>hh";
|
||||
cmdToggleQuickMenu = "<Leader>hm";
|
||||
gotoTerminal = {
|
||||
"1" = "<Leader>ht";
|
||||
"2" = "<Leader>2";
|
||||
"3" = "<Leader>3";
|
||||
"4" = "<Leader>4";
|
||||
};
|
||||
navFile = {
|
||||
"1" = "<Leader>ha";
|
||||
"2" = "<Leader>hs";
|
||||
"3" = "<Leader>hd";
|
||||
"4" = "<Leader>hf";
|
||||
};
|
||||
navNext = "<Leader>h]";
|
||||
navPrev = "<Leader>h[";
|
||||
toggleQuickMenu = "<Leader>hk";
|
||||
};
|
||||
};
|
||||
|
||||
# Code formatting
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
formatOnSave = {
|
||||
timeoutMs = 500;
|
||||
lspFallback = true;
|
||||
};
|
||||
formattersByFt = {
|
||||
lua = ["stylua"];
|
||||
python = ["black"];
|
||||
nix = ["alejandra"];
|
||||
svelte = ["prettier"];
|
||||
rust = ["rustfmt"];
|
||||
haskell = ["fourmolu"];
|
||||
"*" = ["codespell"];
|
||||
"_" = ["trim_whitespace"];
|
||||
};
|
||||
};
|
||||
|
||||
# mini.nvim
|
||||
mini = {
|
||||
enable = true;
|
||||
modules = {
|
||||
surround = {};
|
||||
ai = {};
|
||||
hipatterns = {};
|
||||
notify = {};
|
||||
tabline = {};
|
||||
trailspace = {};
|
||||
comment = {};
|
||||
cursorword = {};
|
||||
bracketed = {};
|
||||
};
|
||||
};
|
||||
|
||||
# Completion
|
||||
cmp-async-path.enable = true;
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
autoEnableSources = true;
|
||||
experimental = {ghost_text = true;};
|
||||
performance = {
|
||||
debounce = 60;
|
||||
fetchingTimeout = 200;
|
||||
maxViewEntries = 30;
|
||||
};
|
||||
snippet = {expand = "luasnip";};
|
||||
formatting = {fields = ["kind" "abbr" "menu"];};
|
||||
sources = [
|
||||
{name = "nvim_lsp";}
|
||||
{name = "emoji";}
|
||||
{
|
||||
name = "buffer"; # text within current buffer
|
||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||
keywordLength = 3;
|
||||
}
|
||||
# { name = "copilot"; } # enable/disable copilot
|
||||
{
|
||||
name = "path"; # file system paths
|
||||
keywordLength = 3;
|
||||
}
|
||||
{
|
||||
name = "luasnip"; # snippets
|
||||
keywordLength = 3;
|
||||
}
|
||||
];
|
||||
|
||||
window = {
|
||||
completion = {border = "solid";};
|
||||
documentation = {border = "solid";};
|
||||
};
|
||||
|
||||
mapping = {
|
||||
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
|
||||
};
|
||||
};
|
||||
};
|
||||
cmp-nvim-lsp = {
|
||||
enable = true; # LSP
|
||||
};
|
||||
cmp-buffer = {
|
||||
enable = true;
|
||||
};
|
||||
cmp-path = {
|
||||
enable = true; # file system paths
|
||||
};
|
||||
cmp-cmdline = {
|
||||
enable = true; # autocomplete for cmdline
|
||||
};
|
||||
|
||||
# Extra (stuff that doesn't affect editing)
|
||||
wakatime.enable = true;
|
||||
presence-nvim = {
|
||||
enable = true;
|
||||
editingText = "Hacking %s";
|
||||
workspaceText = "The One True Text Editor";
|
||||
buttons = [
|
||||
{
|
||||
label = "GitHub";
|
||||
url = "https://github.com/youwen5";
|
||||
}
|
||||
{
|
||||
label = "Code Forge";
|
||||
url = "https://code.youwen.dev/";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
extraPlugins = [
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "satellite.nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lewis6991";
|
||||
repo = "satellite.nvim";
|
||||
rev = "777ed56e1ef45ec808df701730b6597fc4fb0fbc";
|
||||
hash = "sha256-04Js+9SB4VuCq/ACbNh5BZcolu8i8vlGU72qo5xxfpk=";
|
||||
};
|
||||
})
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "render-markdown.nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "MeanderingProgrammer";
|
||||
repo = "render-markdown.nvim";
|
||||
rev = "7986be47531d652e950776536987e01dd5b55b94";
|
||||
hash = "sha256-lc++IrXzEA3M2iUFZACAZOcH2EwVqX4p0fhET+en37o=";
|
||||
};
|
||||
})
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "haskell-tools-nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "mrcjkb";
|
||||
repo = "haskell-tools.nvim";
|
||||
rev = "959eac0fadbdd27442904a8cb363f39afb528027";
|
||||
hash = "sha256-5CS5kvUSqQJe7iFFpicinBjCQXgFPL0ElGgnrZHTT+Y=";
|
||||
};
|
||||
})
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "rustaceanvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "mrcjkb";
|
||||
repo = "rustaceanvim";
|
||||
rev = "7cba8e599deca98d4b44cac1bcbd720c62937d90";
|
||||
hash = "sha256-OYfeJuo4FZUBdW9wGGCT0lZGYr/ur1uy8frcyUJMF3k=";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue