nix_config/home/modules/neovim.nix

52 lines
1.7 KiB
Nix
Raw Normal View History

2024-11-21 00:04:00 +01:00
{
config,
lib,
pkgs,
...
2024-11-21 00:52:37 +01:00
}:
2024-11-21 00:04:00 +01:00
with lib; let
cfg = config.local.apps.neovim;
in {
options.local.apps.neovim = {
enable = mkEnableOption "Neovim settings";
};
config = mkIf cfg.enable {
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
extraConfig = ''
set nobackup
2024-11-21 00:52:37 +01:00
set showmatch " show matching
set hlsearch " highlight search
2024-11-21 00:04:00 +01:00
set incsearch " incremental search
2024-11-21 00:52:37 +01:00
set tabstop=4 " number of columns occupied by a tab
2024-11-21 00:04:00 +01:00
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
set shiftwidth=4 " width for autoindents
set autoindent " indent a new line the same amount as the line just typed
set number " add line numbers
set wildmode=longest,list " get bash-like tab completions
set cc=80 " set an 80 column border for good coding style
filetype plugin indent on " allow auto-indenting depending on file type
syntax on " syntax highlighting
set mouse=a " enable mouse click
set clipboard=unnamedplus " using system clipboard
filetype plugin on
set cursorline " highlight current cursorline
set ttyfast " Speed up scrolling in Vim
set noswapfile " disable creating swap file
'';
plugins = with pkgs.vimPlugins; [
vim-nix
2024-12-02 04:58:23 +01:00
vim-visual-multi
2024-11-21 00:04:00 +01:00
];
};
2024-11-29 01:23:37 +01:00
home.sessionVariables = {
2024-11-29 09:02:08 +01:00
"EDITOR" = mkForce "neovim";
2024-11-29 01:23:37 +01:00
};
2024-11-21 00:04:00 +01:00
};
}