ideavimrc: move to home/ideavimrc.nix

This commit is contained in:
Tigor Hutasuhut 2024-11-08 09:01:09 +07:00
parent 8c24305363
commit 466dbad9de
8 changed files with 55 additions and 43 deletions

View file

@ -1,31 +0,0 @@
set nrformats-=octal
set incsearch
set scrolloff=5
set sidescrolloff=5
set history=1000
set clipboard^=unnamedplus,unnamed
set hlsearch
set ignorecase
set smartcase
set visualbell
set showmode
set number relativenumber
" change leader key to space
nmap <space> <nop>
let mapleader = " "
" Smart join for <C-J>
set ideajoin
" Map vim marks to IDEA global marks
set ideamarks
" Mappings
nmap gd <Action>(GotoTypeDeclaration)
nmap gi <Action>(GotoImplementation)
nmap <F2> <Action>(RenameElement)
nmap K <Action>(ShowHoverInfo)
nmap <leader>db <Action>(ToggleLineBreakpoint)

View file

@ -1,11 +0,0 @@
{ config, lib, ... }:
let
cfg = config.profile.ideavim;
in
{
config = lib.mkIf cfg.enable {
home.file.".ideavimrc" = {
source = ./.ideavimrc;
};
};
}

View file

@ -13,8 +13,8 @@ in
./environments ./environments
./direnv.nix ./direnv.nix
./config/ideavim
./secrets.nix ./secrets.nix
./ideavimrc.nix
]; ];
home = { home = {

38
home/ideavimrc.nix Normal file
View file

@ -0,0 +1,38 @@
{ ... }:
{
home.file.".ideavimrc".text =
# vim
''
set nrformats-=octal
set incsearch
set scrolloff=5
set sidescrolloff=5
set history=1000
set clipboard^=unnamedplus,unnamed
set hlsearch
set ignorecase
set smartcase
set visualbell
set showmode
set number relativenumber
" change leader key to space
nmap <space> <nop>
let mapleader = " "
" Smart join for <C-J>
set ideajoin
" Map vim marks to IDEA global marks
set ideamarks
" Mappings
nmap gd <Action>(GotoTypeDeclaration)
nmap gi <Action>(GotoImplementation)
nmap <F2> <Action>(RenameElement)
nmap K <Action>(ShowHoverInfo)
nmap <leader>db <Action>(ToggleLineBreakpoint)
'';
}

View file

@ -13,6 +13,7 @@
./github.nix ./github.nix
./go.nix ./go.nix
./jellyfin.nix ./jellyfin.nix
./jetbrains-idea.nix
./kitty.nix ./kitty.nix
./microsoft-edge.nix ./microsoft-edge.nix
./mongodb-compass.nix ./mongodb-compass.nix

View file

@ -0,0 +1,13 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.profile.home.programs.jetbrains.idea;
inherit (lib) mkIf;
in
{
config = mkIf cfg.enable { home.packages = with pkgs; [ jetbrains.idea-community-bin ]; };
}

View file

@ -111,6 +111,7 @@
zoom.enable = lib.mkEnableOption "zoom"; zoom.enable = lib.mkEnableOption "zoom";
elisa.enable = lib.mkEnableOption "elisa"; elisa.enable = lib.mkEnableOption "elisa";
obsidian.enable = lib.mkEnableOption "obsidian"; obsidian.enable = lib.mkEnableOption "obsidian";
jetbrains.idea.enable = lib.mkEnableOption "jetbrains.idea";
}; };
programs = { programs = {

View file

@ -112,6 +112,7 @@ in
zoom.enable = true; zoom.enable = true;
elisa.enable = true; elisa.enable = true;
obsidian.enable = true; obsidian.enable = true;
jetbrains.idea.enable = true;
}; };
programs.mongodb-compass.enable = true; programs.mongodb-compass.enable = true;