6 Commits 49abd34b34 ... 43c3451aeb

Author SHA1 Message Date
  Thomas Dy 43c3451aeb nixpkgs/neovim: open quickfix window after Make 2 months ago
  Thomas Dy ef1a97b4c4 git: sort branches by last committed 2 months ago
  Thomas Dy b50be72152 git: use newer diff options 2 months ago
  Thomas Dy dac86cf1e7 nixpkgs/neovim: use treesitter for indentation 2 months ago
  Thomas Dy ca5e350fbc nixpkgs/elvish: rework direlv env filtering 2 months ago
  Thomas Dy 4f33699e90 nixpkgs/elvish: avoid nesting direlv 2 months ago

+ 3 - 2
.config/git/config

@@ -2,7 +2,7 @@
 	name = Thomas Dy
 	email = thatsmydoing@gmail.com
 [merge]
-	conflictstyle = diff3
+	conflictstyle = zdiff3
 [core]
 	autocrlf = input
 	hooksPath = ~/.config/git/hooks
@@ -17,7 +17,7 @@
 [color]
 	ui = true
 [diff]
-	algorithm = patience
+	algorithm = histogram
 [difftool]
 	prompt = false
 [difftool "difft"]
@@ -27,6 +27,7 @@
 [branch]
 	# we use a hook to set this up instead
 	autoSetupMerge = false
+	sort = -committerdate
 [remote]
 	pushDefault = origin
 [alias]

+ 5 - 1
.config/nixpkgs/elvish/lib/config.elv

@@ -1,12 +1,16 @@
 use str
 use prompt
 use nix-shell
-use direlv
 use title
 use eval-export
 use completion
 use pushd
 
+# don't use direlv if we're in a nix-shell to avoid nesting direlvs
+if (not (has-env IN_NIX_SHELL)) {
+  use direlv
+}
+
 edit:add-var ls~ { |@a|
   e:ls --color=auto --group-directories-first -F --quoting-style literal $@a
 }

+ 58 - 19
.config/nixpkgs/elvish/lib/direlv.elv

@@ -37,34 +37,55 @@ fn state-type {|@a|
 
 var state-dir = (get-env XDG_STATE_HOME &default=~/.local/state)/direlv
 var dir-stack = []
-var ignore = [
+var quiet = [
   AR
+  AR_FOR_TARGET
   AS
+  AS_FOR_TARGET
   CC
-  CONFIG_SHELL
+  CC_FOR_TARGET
   CXX
-  HOME
-  HOST_PATH
+  CXX_FOR_TARGET
   LD
-  LD_DYLD_PATH
-  MACOSX_DEPLOYMENT_TARGET
+  LD_FOR_TARGET
   NM
-  OBJCOPY
-  OBJDUMP
-  OLDPWD
+  NM_FOR_TARGET
   RANLIB
-  READELF
-  SHELL
+  RANLIB_FOR_TARGET
   SIZE
-  SOURCE_DATE_EPOCH
+  SIZE_FOR_TARGET
   STRINGS
+  STRINGS_FOR_TARGET
   STRIP
+  STRIP_FOR_TARGET
+
+  READELF
+  OBJCOPY
+  OBJDUMP
+
+  MACOSX_DEPLOYMENT_TARGET
+
+  CONFIG_SHELL
+  HOST_PATH
+]
+var ignore = [
+  # keep user variables
+  HOME
+  OLDPWD
+  SHELL
   TEMP
   TEMPDIR
   TERM
   TMP
   TMPDIR
   TZ
+
+  # purity-related envs
+  NIX_ENFORCE_PURITY
+  SOURCE_DATE_EPOCH
+  ZERO_AR_DATE
+
+  # nix build variables
   buildInputs
   buildPhase
   builder
@@ -88,6 +109,7 @@ var ignore = [
   outputs
   patches
   phases
+  preferLocalBuild
   propagatedBuildInputs
   propagatedNativeBuildInputs
   shell
@@ -109,17 +131,33 @@ fn diff-env {|env|
   } $env
 }
 
+fn print-change {|key new|
+  if (has-value $quiet $key) {
+    return
+  }
+
+  if (str:has-prefix $key "NIX_") {
+    return
+  }
+
+  if $new {
+    put +$key
+  } else {
+    put -$key
+  }
+}
+
 fn apply-env {|env|
   each {|row|
     var key value = (all $row)
     if (eq $value $nil) {
-      put -$key
+      print-change $key $false
       unset-env $key
     } else {
-      put +$key
+      print-change $key $true
       set-env $key $value
     }
-  } $env
+  } $env | compact
 }
 
 fn env-from-nix-flake {|state-file|
@@ -127,15 +165,16 @@ fn env-from-nix-flake {|state-file|
   keys $data[variables] | each {|key|
     var v = $data[variables][$key]
     if (eq $v[type] "exported") {
-      if (str:has-prefix $key "NIX_") {
-        continue
-      } elif (str:has-prefix $key "__") {
+      if (str:has-prefix $key "__") {
         continue
       } elif (has-value $ignore $key) {
         continue
       } elif (has-value $extend $key) {
-        var existing = (get-env $key)
         var extended = $v[value]
+        if (eq $extended "") {
+          continue
+        }
+        var existing = (get-env $key)
         if (not-eq $existing $nil) {
           set extended = $extended":"$existing
         }

+ 4 - 0
.config/nixpkgs/neovim/make.lua

@@ -30,6 +30,10 @@ function make(opts)
       efm = errorformat,
     })
     vim.api.nvim_exec_autocmds('QuickFixCmdPost', {})
+
+    if #result > 0 then
+      vim.cmd('copen')
+    end
   end
 
   Job:new({

+ 3 - 0
.config/nixpkgs/neovim/plugins.lua

@@ -206,6 +206,9 @@ require('nvim-treesitter.configs').setup({
   highlight = {
     enable = true,
   },
+  indent = {
+    enable = true,
+  },
   incremental_selection = {
     enable = true,
     keymaps = {

+ 0 - 7
.config/nixpkgs/neovim/plugins/default.nix

@@ -3,13 +3,6 @@ let
   plugins = builtins.fromJSON (builtins.readFile ./sources.json);
 
   overrides = {
-    "leafgarland/typescript-vim" = {
-      patches = [
-        # make compiler build entire project
-        ./typescript-vim-compiler.patch
-      ];
-    };
-
     "nvim-telescope/telescope-fzf-native.nvim" = {
       dontBuild = false;
     };

+ 0 - 13
.config/nixpkgs/neovim/plugins/typescript-vim-compiler.patch

@@ -1,13 +0,0 @@
-diff --git a/compiler/typescript.vim b/compiler/typescript.vim
-index 77121eb..203af9b 100644
---- a/compiler/typescript.vim
-+++ b/compiler/typescript.vim
-@@ -22,7 +22,7 @@ execute 'CompilerSet makeprg='
-       \ . escape(g:typescript_compiler_binary, ' ')
-       \ . '\ '
-       \ . escape(g:typescript_compiler_options, ' ')
--      \ . '\ $*\ %'
-+      \ . '\ $*'
- 
- CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
-