Skip to content

Commit

Permalink
Use neovim as default editor
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Nov 2, 2023
1 parent e529ef9 commit 83c9e65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions home/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ in
# centralise where python puts its .pyc files
set -x PYTHONPYCACHEPREFIX {$HOME}/.python-cache
set -x EDITOR "${pkgs.helix}/bin/hx"
set -x EDITOR "${neovim}/bin/nvim"
set -x PAGER "${pkgs.bat}/bin/bat"
# host-specific configuration
Expand Down Expand Up @@ -155,7 +155,6 @@ in
trash = "${pkgs.python3Packages.send2trash}/bin/send2trash";
tree = "${pkgs.eza}/bin/eza -T";
vup = "${neovim}/bin/nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'";
dev = "${pkgs.helix}/bin/hx";
} // lib.optionalAttrs isLinux {
pbcopy = "${pkgs.xclip}/bin/xclip -selection clipboard";
pbpaste = "${pkgs.xclip}/bin/xclip -selection clipboard -o";
Expand Down
12 changes: 8 additions & 4 deletions home/git.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{ config, pkgs, ... }:
let
# the complete neovim package
neovim = config.programs.neovim.finalPackage;
in
{
programs.git = {
enable = true;
Expand Down Expand Up @@ -29,9 +33,9 @@
# https://blog.jez.io/cli-code-review
files = "!git diff --name-only $(git base-commit)";
stat = "!git diff --stat $(git base-commit)";
review = "!nvim -c 'set nosplitright' -p $(git files) -c \"tabdo Gvdiff $REVIEW_BASE\" -c 'set splitright'";
review = "!${neovim}/bin/nvim -c 'set nosplitright' -p $(git files) -c \"tabdo Gvdiff $REVIEW_BASE\" -c 'set splitright'";
base-commit = "!git merge-base HEAD $REVIEW_BASE";
review-commits = "!nvim -c 'Gclog --reverse $REVIEW_BASE..'";
review-commits = "!${neovim}/bin/nvim -c 'Gclog --reverse $REVIEW_BASE..'";
log-base = "!git l $REVIEW_BASE..";

# ignore modifications to files
Expand Down Expand Up @@ -125,7 +129,7 @@
autocrlf = "input";
safecrlf = true;
whitespace = "fix";
editor = "${pkgs.helix}/bin/hx";
editor = "${neovim}/bin/nvim";
mergeoptions = "--no-ff";
preloadindex = true;
ignorecase = false;
Expand All @@ -144,7 +148,7 @@
};
mergetool = {
conflicted = {
cmd = "nvim +Conflicted";
cmd = "${neovim}/bin/nvim +Conflicted";
};
smerge = {
cmd = "smerge";
Expand Down
1 change: 1 addition & 0 deletions home/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
extraPython3Packages = (ps: with ps; [
pynvim
black
Expand Down

0 comments on commit 83c9e65

Please sign in to comment.