mirror of
https://github.com/youwen5/neovim-flake.git
synced 2024-11-28 12:13:51 -08:00
Compare commits
19 commits
0fff5154e6
...
570fddee2d
Author | SHA1 | Date | |
---|---|---|---|
570fddee2d | |||
8e3bb627ba | |||
6db1a249a6 | |||
2543f97755 | |||
914cd10148 | |||
b123800156 | |||
6f76853957 | |||
b7ec14467a | |||
82a9a5af6b | |||
cd670638d1 | |||
c074ca3615 | |||
e935980efe | |||
c90437651c | |||
4a098743d2 | |||
ea8999a96c | |||
63fa67dd6f | |||
266e176103 | |||
4b6e2de27a | |||
3e1649bc6a |
7 changed files with 259 additions and 10 deletions
|
@ -5,7 +5,9 @@ This is the Neovim configuration for all my NixOS and Nix enabled systems
|
|||
blingful features like sidebars or fancy UI enhancements in favor of native
|
||||
(neo)Vim, while still having everything useful you'd expect, like LSPs, file
|
||||
explorer (`oil.nvim`), completions, advanced language tools, and QoL
|
||||
enhancements.
|
||||
enhancements. Additionally, a small wrapper script called `vimg` is provided in
|
||||
`packages.${system}.vimg` which simply opens Neovim inside the `Neogit` UI.
|
||||
This allows it to be used as a quick git TUI from the shell.
|
||||
|
||||
The central design goal is to prefer Vim whenever possible. The Vim text editor
|
||||
is already incredibly powerful, and many plugins designed to emulate features
|
||||
|
|
|
@ -3,8 +3,17 @@
|
|||
colorschemes.rose-pine.enable = true;
|
||||
|
||||
opts = {
|
||||
# Global status/cmdline
|
||||
laststatus = 3;
|
||||
|
||||
relativenumber = true;
|
||||
number = true;
|
||||
# sane defaults for tab/space
|
||||
shiftwidth = 2;
|
||||
tabstop = 4;
|
||||
# Crank up fold level so tree-sitter doesn't fold everything
|
||||
foldlevel = 15;
|
||||
# Persistent undos across sessions
|
||||
undofile = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -23,6 +23,128 @@
|
|||
desc = "Zen mode";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
action = ":%%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>";
|
||||
key = "<leader>fs";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Search and replace the word under the cursor globally and case-insensitively";
|
||||
};
|
||||
}
|
||||
# center the screen when scrolling
|
||||
{
|
||||
mode = "n";
|
||||
action = ":CellularAutomaton make_it_rain<CR>";
|
||||
key = "<leader>kys";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "A mysterious surprise!";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
action = "nzzzv";
|
||||
key = "n";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Search next and center screen, reopening folds";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
action = "Nzzzv";
|
||||
key = "N";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Search previous and center screen, reopening folds";
|
||||
};
|
||||
}
|
||||
# The greatest remap of all time -- the primeagen
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
action = "\"_d";
|
||||
key = "<leader>d";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Delete without copying to register";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
action = "\"+y";
|
||||
key = "<leader>y";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Yank to system clipboard";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
action = "\"+Y";
|
||||
key = "<leader>Y";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Yank whole line to system clipboard";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
action = "\"+p";
|
||||
key = "<leader>p";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Put from system clipboard";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
action = "\"+P";
|
||||
key = "<leader>P";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Put from system clipboard";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-u>";
|
||||
action = "<C-u>zz";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-d>";
|
||||
action = "<C-d>zz";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>Telescope find_files<CR>";
|
||||
key = "<Leader>ff";
|
||||
|
@ -65,7 +187,70 @@
|
|||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Go to definition";
|
||||
desc = "Go to definition, or search through them (if multiple)";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.lsp_implementations{}<CR>";
|
||||
key = "gr";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Go to implementation";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.lsp_document_symbols{}<CR>";
|
||||
key = "<leader>a";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "List and search through document symbols";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.lsp_workspace_symbols{}<CR>";
|
||||
key = "<leader>fcs";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "List and search through workplace symbols";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.lsp_type_definitions{}<CR>";
|
||||
key = "<leader>fct";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "List and search through type definitions";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.lsp_references{}<CR>";
|
||||
key = "<leader>fcr";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "List and search through references";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.diagnostics{}<CR>";
|
||||
key = "<leader>fcd";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "List and search through diagnostics";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require'telescope.builtin'.keymaps{}<CR>";
|
||||
key = "<leader>fcd";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Search through keymaps";
|
||||
};
|
||||
}
|
||||
{
|
||||
|
@ -169,12 +354,12 @@
|
|||
};
|
||||
}
|
||||
{
|
||||
action = ":Neogit commit<CR>";
|
||||
action = ":Neogit kind=floating commit<CR>";
|
||||
key = "<Leader>gc";
|
||||
options = {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
desc = "Open commit menu";
|
||||
desc = "Quickly open Neogit commit menu";
|
||||
};
|
||||
}
|
||||
{
|
||||
|
@ -431,9 +616,12 @@
|
|||
}
|
||||
{
|
||||
action = ":Telescope yank_history<CR>";
|
||||
key = "<Leader>p";
|
||||
mode = "n";
|
||||
options.desc = "Look through yank history with telescope.";
|
||||
key = "<Leader>fp";
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
options.desc = "Search through yank history with telescope.";
|
||||
}
|
||||
{
|
||||
action = '':Oil<CR>'';
|
||||
|
@ -553,5 +741,13 @@
|
|||
desc = "Toggle autoformat in buffer";
|
||||
};
|
||||
}
|
||||
{
|
||||
action = ":UndotreeToggle<CR>";
|
||||
key = "<Leader>u";
|
||||
options = {
|
||||
noremap = true;
|
||||
desc = "Open undotree";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
};
|
||||
trouble.enable = true;
|
||||
barbecue.enable = true;
|
||||
undotree.enable = true;
|
||||
lualine = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
@ -80,10 +81,22 @@
|
|||
};
|
||||
neogit = {
|
||||
enable = true;
|
||||
settings.graph_style = "unicode";
|
||||
settings = {
|
||||
graph_style = "unicode";
|
||||
integrations = {
|
||||
diffview = true;
|
||||
telescope = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
# Language specific tools
|
||||
diffview.enable = true;
|
||||
|
||||
# The greatest QoL plugin of all time. Renders codeblocks, formatting, etc
|
||||
# in LSP popup buffers too. GUI users will never flex on you with their
|
||||
# typesetting again!
|
||||
markdown-preview.enable = true;
|
||||
|
||||
# Language specific tools
|
||||
ts-autotag.enable = true;
|
||||
};
|
||||
extraPlugins = [
|
||||
|
@ -99,5 +112,9 @@
|
|||
name = "lsp-progress.nvim";
|
||||
src = inputs.lsp-progress;
|
||||
})
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "cellular-automaton.nvim";
|
||||
src = inputs.cellular-automaton;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
folding = true;
|
||||
settings = {
|
||||
highlight.enable = true;
|
||||
indent.enable = true;
|
||||
folding.enable = true;
|
||||
};
|
||||
};
|
||||
treesitter-context.enable = true;
|
||||
|
|
17
flake.lock
17
flake.lock
|
@ -1,5 +1,21 @@
|
|||
{
|
||||
"nodes": {
|
||||
"cellular-automaton": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1719777869,
|
||||
"narHash": "sha256-nIv7ISRk0+yWd1lGEwAV6u1U7EFQj/T9F8pU6O0Wf0s=",
|
||||
"owner": "Eandrju",
|
||||
"repo": "cellular-automaton.nvim",
|
||||
"rev": "11aea08aa084f9d523b0142c2cd9441b8ede09ed",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Eandrju",
|
||||
"repo": "cellular-automaton.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -314,6 +330,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"cellular-automaton": "cellular-automaton",
|
||||
"flake-parts": "flake-parts",
|
||||
"haskell-tools": "haskell-tools",
|
||||
"lsp-progress": "lsp-progress",
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
url = "github:linrongbin16/lsp-progress.nvim";
|
||||
flake = false;
|
||||
};
|
||||
cellular-automaton = {
|
||||
url = "github:Eandrju/cellular-automaton.nvim";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
@ -69,6 +73,10 @@
|
|||
|
||||
packages = {
|
||||
default = nvim;
|
||||
vimg = pkgs.writeScriptBin "vimg" ''
|
||||
#!/bin/sh
|
||||
${nvim}/bin/nvim +Neogit
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue