diff --git a/home/vim.nix b/home/vim.nix index 9de8275..8c20638 100644 --- a/home/vim.nix +++ b/home/vim.nix @@ -77,6 +77,7 @@ in "" = ''"k"''; "" = ''"h"''; "" = ''"l"''; + "" = ''":GFiles?"''; }; }; plugins = { @@ -88,7 +89,7 @@ in fugitive.enable = true; notify.enable = true; }; - extraConfigLua = builtins.readFile ./vim/extra.lua; + extraConfigLua = builtins.replaceStrings [ "@git@" ] [ "${pkgs.git}/bin/git" ] (builtins.readFile ./vim/extra.lua); extraConfigVim = builtins.readFile ./vim/extra.vimrc; extraPlugins = with pkgs.vimPlugins; [ bufexplorer @@ -97,14 +98,11 @@ in nvim-cmp packer-nvim - #jedi-vim - context-vim direnv-vim fzf-vim vim-flake8 vim-indent-guides - vim-rooter vim-xonsh ]; viAlias = true; diff --git a/home/vim/extra.lua b/home/vim/extra.lua index 7aac317..142f688 100644 --- a/home/vim/extra.lua +++ b/home/vim/extra.lua @@ -35,10 +35,3 @@ api.nvim_create_autocmd({ "BufRead", "BufNewFile"}, { pattern = "Vagrantfile*", command = "set filetype=ruby" }) - -if api.nvim_command_output("!git rev-parse --is-inside-work-tree") == true then - vim.keymap.set(all, "", ":GFiles --cached --others --exclude-standard") - vim.keymap.set(all, "", ":GFiles?") -else - vim.keymap.set(all, "", ":Files") -end diff --git a/home/vim/extra.vimrc b/home/vim/extra.vimrc index 2390437..b54b26d 100644 --- a/home/vim/extra.vimrc +++ b/home/vim/extra.vimrc @@ -31,3 +31,5 @@ endfunction command! -nargs=? -range=% Space2Tab call IndentConvert(,,0,) command! -nargs=? -range=% Tab2Space call IndentConvert(,,1,) command! -nargs=? -range=% RetabIndent call IndentConvert(,,&et,) + +noremap (fugitive#Head() != '' ? ':GFiles --exclude-standard --others --cached' : ':Files')."\"