mirror of
https://github.com/Superredstone/nixos.git
synced 2026-03-07 20:28:08 +01:00
Moved neovim config to a separate module
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
./git.nix
|
||||
./gnome.nix
|
||||
./kitty.nix
|
||||
./nvim
|
||||
./tmux.nix
|
||||
./zoxide.nix
|
||||
./mangohud.nix
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.plugins.lspkind.enable = true;
|
||||
programs.nixvim.plugins.cmp-nvim-lsp-signature-help.enable = true;
|
||||
programs.nixvim.plugins.cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "nvim_lsp_signature_help"; }
|
||||
{ name = "path"; }
|
||||
{ name = "buffer"; }
|
||||
{ name = "dap"; }
|
||||
];
|
||||
mapping = {
|
||||
"<Tab>" = "cmp.mapping.select_next_item()";
|
||||
"<S-Tab>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-j>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-k>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-Esc>" = "cmp.mapping.close()";
|
||||
"<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./opts.nix
|
||||
./lsp.nix
|
||||
./cmp.nix
|
||||
./keymaps.nix
|
||||
./plugins
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
colorschemes.catppuccin.enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
wl-clipboard
|
||||
];
|
||||
clipboard.register = "unnamedplus";
|
||||
clipboard.providers.wl-copy.enable = true;
|
||||
clipboard.providers.wl-copy.package = pkgs.wl-clipboard;
|
||||
clipboard.providers.xclip.enable = true;
|
||||
clipboard.providers.xclip.package = pkgs.xclip;
|
||||
};
|
||||
}
|
||||
@@ -1,169 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.keymaps = [
|
||||
{
|
||||
action = ":bnext<CR>";
|
||||
key = "<A-l>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Next tab";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":bprevious<CR>";
|
||||
key = "<A-h>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Previous tab";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":bdelete<CR>";
|
||||
key = "<S-q>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Next tab";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = "<C-\\><C-n>";
|
||||
key = "<Esc>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Exit terminal insert mode";
|
||||
};
|
||||
mode = "t";
|
||||
}
|
||||
{
|
||||
action = ":w<CR>";
|
||||
key = "<C-s>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Save";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":lua vim.lsp.buf.format()<CR>";
|
||||
key = "<C-f>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Format buffer";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":q<CR>";
|
||||
key = "<C-q>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Quit";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":wincmd l<CR>";
|
||||
key = "<Space>wl";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go to left panel";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":wincmd k<CR>";
|
||||
key = "<Space>wk";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go to upper panel";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":wincmd j<CR>";
|
||||
key = "<Space>wj";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go to down panel";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = ":wincmd h<CR>";
|
||||
key = "<Space>wh";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go to left panel";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = "$";
|
||||
key = "gl";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go to end line";
|
||||
};
|
||||
mode = [ "n" "v" ];
|
||||
}
|
||||
{
|
||||
action = "^";
|
||||
key = "gh";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go to start line";
|
||||
};
|
||||
mode = [ "n" "v" ];
|
||||
}
|
||||
# Neotree
|
||||
{
|
||||
action = ":Neotree toggle<CR>";
|
||||
key = "<Space>e";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle file explorer";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
# ToggleTerm
|
||||
{
|
||||
action = ":ToggleTerm direction=float<CR>";
|
||||
key = "<Space>t";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle terminal";
|
||||
};
|
||||
mode = "n";
|
||||
}
|
||||
# Dap
|
||||
{
|
||||
action.__raw = ''
|
||||
function()
|
||||
require("dap").toggle_breakpoint()
|
||||
end
|
||||
'';
|
||||
key = "<Space>b";
|
||||
mode = "n";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle breakpoint";
|
||||
};
|
||||
}
|
||||
{
|
||||
action.__raw = ''
|
||||
function()
|
||||
require("dapui").toggle()
|
||||
end
|
||||
'';
|
||||
key = "<Space>y";
|
||||
mode = "n";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle debugger";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.plugins.lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
clangd.enable = true;
|
||||
nil_ls.enable = true;
|
||||
gopls.enable = true;
|
||||
jdtls.enable = true;
|
||||
lua_ls.enable = true;
|
||||
rust_analyzer = {
|
||||
enable = true;
|
||||
installCargo = false;
|
||||
installRustc = false;
|
||||
installRustfmt = false;
|
||||
};
|
||||
zls.enable = true;
|
||||
nim_langserver.enable = true;
|
||||
pyright.enable = true;
|
||||
emmet_language_server.enable = true;
|
||||
ts_ls.enable = true;
|
||||
docker_compose_language_service.enable = true;
|
||||
jsonls.enable = true;
|
||||
phpactor.enable = true;
|
||||
gleam.enable = true;
|
||||
elixirls.enable = true;
|
||||
};
|
||||
keymaps = {
|
||||
lspBuf = {
|
||||
"<Space>k" = "hover";
|
||||
"<Space>r" = "rename";
|
||||
"<Space>a" = "code_action";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.opts = {
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
signcolumn = "yes";
|
||||
splitright = true;
|
||||
splitbelow = true;
|
||||
cursorline = true;
|
||||
scrolloff = 5;
|
||||
undofile = true;
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
gdefault = true;
|
||||
termguicolors = true;
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.plugins.comment = {
|
||||
enable = true;
|
||||
settings.toggler = {
|
||||
block = "<C-x>";
|
||||
line = "<C-c>";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nixvim.plugins = {
|
||||
dap = {
|
||||
enable = true;
|
||||
adapters = {
|
||||
executables = {
|
||||
gdb = {
|
||||
command = "gdb";
|
||||
args = [
|
||||
"-i"
|
||||
"dap"
|
||||
];
|
||||
};
|
||||
lldb = {
|
||||
command = "lldb";
|
||||
};
|
||||
};
|
||||
servers = {
|
||||
codelldb = {
|
||||
port = 13000;
|
||||
executable = {
|
||||
command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
|
||||
args = [
|
||||
"--port"
|
||||
"13000"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
configurations = {
|
||||
cpp = [
|
||||
{
|
||||
name = "Launch GDB";
|
||||
type = "gdb";
|
||||
request = "launch";
|
||||
program.__raw = ''
|
||||
function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end'';
|
||||
}
|
||||
{
|
||||
name = "Launch LLDB";
|
||||
type = "lldb";
|
||||
request = "launch";
|
||||
program.__raw = ''
|
||||
function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end'';
|
||||
}
|
||||
{
|
||||
name = "Launch CodeLLDB";
|
||||
type = "codelldb";
|
||||
request = "launch";
|
||||
program.__raw = ''
|
||||
function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
dap-ui.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.plugins.dashboard = {
|
||||
enable = true;
|
||||
settings.config = {
|
||||
header = [
|
||||
" ███▄ █ ▓█████ ▒█████ ██▒ █▓ ██▓ ███▄ ▄███▓"
|
||||
" ██ ▀█ █ ▓█ ▀ ▒██▒ ██▒▓██░ █▒▓██▒▓██▒▀█▀ ██▒"
|
||||
"▓██ ▀█ ██▒▒███ ▒██░ ██▒ ▓██ █▒░▒██▒▓██ ▓██░"
|
||||
"▓██▒ ▐▌██▒▒▓█ ▄ ▒██ ██░ ▒██ █░░░██░▒██ ▒██ "
|
||||
"▒██░ ▓██░░▒████▒░ ████▓▒░ ▒▀█░ ░██░▒██▒ ░██▒"
|
||||
"░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▐░ ░▓ ░ ▒░ ░ ░"
|
||||
"░ ░░ ░ ▒░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ▒ ░░ ░ ░"
|
||||
" ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ▒ ░░ ░ "
|
||||
" ░ ░ ░ ░ ░ ░ ░ ░ "
|
||||
];
|
||||
footer = [ "Made with ❤️" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./comment.nix
|
||||
./dap.nix
|
||||
./dashboard.nix
|
||||
./guess-indent.nix
|
||||
./lualine.nix
|
||||
./neotree.nix
|
||||
./telescope.nix
|
||||
./treesitter.nix
|
||||
];
|
||||
|
||||
programs.nixvim.plugins = {
|
||||
web-devicons.enable = true;
|
||||
bufferline.enable = true;
|
||||
toggleterm.enable = true;
|
||||
gitsigns.enable = true;
|
||||
which-key.enable = true;
|
||||
autoclose.enable = true;
|
||||
markview.enable = true;
|
||||
nvim-surround.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.plugins.guess-indent = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.plugins.lualine = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
programs.nixvim.plugins.neo-tree = {
|
||||
enable = true;
|
||||
window = {
|
||||
width = 30;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.plugins.telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<Space>f" = "find_files";
|
||||
"<Space>g" = "live_grep";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim.plugins.treesitter = {
|
||||
enable = true;
|
||||
settings = {
|
||||
highlight = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user