profiles: add base profile

This commit is contained in:
Dmitriy Pleshevskiy 2024-05-06 02:18:36 +03:00
parent 130638c777
commit 4b9f76b764
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
2 changed files with 100 additions and 0 deletions

View file

@ -20,6 +20,9 @@
in in
{ {
lib = { inherit mkNixeovim mkNixeovimPackage; }; lib = { inherit mkNixeovim mkNixeovimPackage; };
profiles = {
base = ./modules/profiles/base.nix;
};
} }
// flake-utils.lib.eachDefaultSystem ( // flake-utils.lib.eachDefaultSystem (
system: system:
@ -27,6 +30,7 @@
{ {
packages = { packages = {
default = nixeovimPackage { }; default = nixeovimPackage { };
base = nixeovimPackage ./modules/profiles/base.nix;
}; };
} }
); );

96
modules/profiles/base.nix Normal file
View file

@ -0,0 +1,96 @@
{ config, lib, ... }:
{
vim.opt = {
# Better Unix support
viewoptions = lib.mkDefault [ "folds" "options" "cursor" "unix" "slash" ];
encoding = lib.mkDefault "utf-8";
# Enable 24-bit color
termguicolors = lib.mkDefault true;
# Other options
backspace = lib.mkDefault [ "indent" "eol" "start" ];
laststatus = lib.mkDefault 2;
showmode = lib.mkDefault false;
# Tabs as spaces
expandtab = lib.mkDefault true;
tabstop = lib.mkDefault 2;
softtabstop = lib.mkDefault 2;
shiftwidth = lib.mkDefault 2;
# Fixes broken cursor on Linux
guicursor = lib.mkDefault "";
# Disable mouse / touchpad
mouse = lib.mkDefault "";
# Incremental substitutin
inccommand = lib.mkDefault "split";
# Hide files when leaving them.
hidden = lib.mkDefault true;
# Show line numbers.
number = lib.mkDefault true;
# Minimum line number column width.
numberwidth = lib.mkDefault 1;
# Number of screen lines to use for the commandline.
cmdheight = lib.mkDefault 2;
# Lines length limit (0 if no limit).
textwidth = lib.mkDefault 0;
# Don't cut lines in the middle of a work.
linebreak = lib.mkDefault true;
# Show matching parenthesis.
showmatch = lib.mkDefault true;
# Time during which the matching parenthesis is shown.
matchtime = lib.mkDefault 2;
# Sensible default line auto cutting and formatting.
formatoptions = lib.mkDefault "jtcrq";
# Copy/Past to/from clipboard.
clipboard = lib.mkDefault "unnamedplus";
# Highlight line cursor is currently on.
cursorline = lib.mkDefault true;
# Invisible characters representation when :set list
listchars = lib.mkDefault {
tab = " ";
trail = "~";
nbsp = "";
eol = "¬";
};
# Search
# Incremental search.
incsearch = lib.mkDefault true;
# Case insensitive.
ignorecase = lib.mkDefault true;
# Case insensitive if no uppercase letter in pattern, case sensitive otherwise.
smartcase = lib.mkDefault true;
# Fold level
foldlevel = lib.mkDefault 99;
foldlevelstart = lib.mkDefault 99;
foldminlines = lib.mkDefault 3;
foldnestmax = lib.mkDefault 5;
};
plugins.navigation.nvim-tree.enable = lib.mkDefault true;
vim.keymap.set = with lib.nix2lua; [
{ mode = "n"; lhs = "<C-z>"; rhs = lambda0 (set "vim.opt.hlsearch" false); desc = "Clear search highlighting"; }
]
++ lib.optionals config.plugins.navigation.nvim-tree.enable [
{
mode = "n";
lhs = "<leader>nt";
rhs = "<CMD>NvimTreeToggle<CR>";
desc = "Open/Close file tree";
}
{
mode = "n";
lhs = "<leader>nf";
rhs = "<CMD>NvimTreeFindFile<CR>";
desc = "Open file tree and find current file";
}
];
}