nixeovim/modules/profiles/base.nix

105 lines
2.8 KiB
Nix
Raw Normal View History

2024-05-06 02:18:36 +03:00
{ config, lib, ... }:
2024-05-08 01:11:48 +03:00
let
2024-05-08 01:30:47 +03:00
inherit (lib.mod) leader cmd ctrl;
2024-05-08 01:11:48 +03:00
in
2024-05-06 02:18:36 +03:00
{
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; [
2024-05-08 01:11:48 +03:00
{
mode = "n";
lhs = ctrl "z";
rhs = lambda0 (set "vim.opt.hlsearch" false);
desc = "Clear search highlighting";
}
2024-05-06 02:18:36 +03:00
]
++ lib.optionals config.plugins.navigation.nvim-tree.enable [
{
mode = "n";
2024-05-08 01:30:47 +03:00
lhs = leader "nt";
rhs = cmd "NvimTreeToggle";
2024-05-06 02:18:36 +03:00
desc = "Open/Close file tree";
}
{
mode = "n";
2024-05-08 01:30:47 +03:00
lhs = leader "nf";
rhs = cmd "NvimTreeFindFile";
2024-05-06 02:18:36 +03:00
desc = "Open file tree and find current file";
}
];
}