AndrewRadev / diffurcate.vim

Split a git diff into separate files
MIT License
59 stars 1 forks source link

Couldn't find pattern: ^diff --git \zs.\+\ze #1

Open abbood opened 2 years ago

abbood commented 2 years ago

as soon as I run this

git diff | vim - -R +Diffurcate

I get this error

Error detected while processing command line..function diffurcate#Run:
line   11:
Couldn't find pattern: ^diff --git \zs.\+\ze
Press ENTER or type command to continue
AndrewRadev commented 2 years ago

Could you post the output of git diff in that particular project, so I can try to figure out why the pattern doesn't match?

azamat-sharapov commented 1 year ago

@AndrewRadev I get same error when running :Diffurcate in Vim:

image

Here is output of git diff:

image

AndrewRadev commented 1 year ago

@azamat-sharapov Could you post the full git output as text or attach it as a file, so I can run it locally? I could retype it from the image, but the error might be somewhere down below, or it might be some hidden characters, so ideally git diff > output.diff and uploading that here would be perfect.

azamat-sharapov commented 1 year ago

@AndrewRadev here it is output.diff.zip (github doesn't allow .diff file upload, so I compressed it).

AndrewRadev commented 1 year ago

I see, this works fine for me, but I think I understand why it might not work now -- I think you might have set nomagic somewhere in your config. Could you try it out now?

azamat-sharapov commented 1 year ago

@AndrewRadev didn't work, unfortunately..

Error detected while processing function diffurcate#Run:
line   11:
Couldn't find pattern: \m^diff --git \zs.\+\ze
Press ENTER or type command to continue

Here is my .vimrc:

.vimrc ```vim set nocompatible " Disable vi-compatibility set hidden " Swap files out of the project root set backupdir=~/.vim/backup// set directory=~/.vim/swap// syntax on filetype plugin indent on " Change let mapleader = "," let g:mapleader = "," call plug#begin() " color scheme Plug 'morhetz/gruvbox' Plug 'Shougo/context_filetype.vim' " fuzzy search Plug '/usr/local/opt/fzf' Plug 'junegunn/fzf.vim' " better in-buffer search Plug 'junegunn/vim-slash' " file tree Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeFind' } Plug 'PhilRunninger/nerdtree-visual-selection' " Plug 'jiangmiao/auto-pairs' " Plug 'Raimondi/delimitMate' " Plug 'michaeljsmith/vim-indent-object' Plug 'urxvtcd/vim-indent-object' Plug 'cohama/lexima.vim' Plug 'tpope/vim-repeat' Plug 'tpope/vim-surround' Plug 'tpope/vim-eunuch' Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-abolish' Plug 'vim-scripts/Tabmerge' Plug 'AndrewRadev/splitjoin.vim' Plug 'chaoren/vim-wordmotion' Plug 'svermeulen/vim-cutlass' Plug 'vim-scripts/delview' Plug 'vim-scripts/dbext.vim' Plug 'ekalinin/Dockerfile.vim' Plug 'AndrewRadev/diffurcate.vim' " comment plugin Plug 'tyru/caw.vim' " multi cursor support Plug 'mg979/vim-visual-multi', {'branch': 'master'} " git plugin Plug 'tpope/vim-fugitive' " inserts end keyword for ruby Plug 'tpope/vim-endwise' " HTML/CSS plugin Plug 'mattn/emmet-vim' " ruby syntax highlighting, indentation, omnicompletion, etc. Plug 'vim-ruby/vim-ruby' " rails power tools Plug 'tpope/vim-rails' " lint engine Plug 'dense-analysis/ale' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'exu/pgsql.vim' Plug 'editorconfig/editorconfig-vim' Plug 'othree/html5.vim' Plug 'jvirtanen/vim-hcl' Plug 'hashivim/vim-terraform' Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } Plug 'posva/vim-vue' Plug 'pangloss/vim-javascript' Plug 'leafgarland/typescript-vim' " Better JSON Plug 'elzr/vim-json' " github AI pairprogrammer Plug 'github/copilot.vim' " Plug 'joereynolds/vim-minisnip' call plug#end() " UI set t_Co=256 set background=dark let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors let g:gruvbox_contrast_dark='hard' let g:gruvbox_hls_cursor='red' let g:gruvbox_invert_selection=0 " let g:gruvbox_italic=0 colorscheme gruvbox highlight Search cterm=underline highlight SpecialKey ctermfg=grey guifg=grey25 set nocursorline set showmode " always show what mode we're currently editing in set showcmd " Show (partial) command in the status line set nowrap " don't wrap lines set tabstop=2 " a tab is two spaces set smarttab set tags=tags set softtabstop=0 " when hitting , pretend like a tab is removed, even if spaces set shiftwidth=3 " number of spaces to use for autoindenting set shiftround " use multiple of shiftwidth when indenting with '<' and '>' set backspace=indent,eol,start " allow backspacing over everything in insert mode set autoindent " always set autoindenting on set copyindent " copy the previous indentation on autoindenting set number " always show line numbers set incsearch " realtime search set timeout timeoutlen=400 ttimeoutlen=0 set novisualbell " don't beep set noerrorbells " don't beep set autowrite " Save on buffer switch set history=200 set nojoinspaces " no spaces on line join set foldmethod=indent set foldlevel=99 set scrolloff=5 " some padding on working line set backupcopy=yes " otherwise webpack --watch won't work set listchars=tab:>-,trail:~,extends:>,precedes:<,space:· set nolist set pastetoggle=I set ignorecase set smartcase " insensetive case when given text is all lowercase set diffopt+=internal,algorithm:patience set updatetime=300 " fix ctrl-up/down map [1;5A map [1;5B map! [1;5A map! [1;5B " Fast saves nmap w :w " Fast quit nmap q :q " Easy escaping to normal model imap jj imap jk " Easier window navigation nmap h nmap j nmap k nmap l " Resize vsplit nmap :vertical resize +5 nmap 25 :vertical resize 40 nmap 50 = nmap 75 :vertical resize 120 " Create split below nmap :sp :rightbelow sp " When I forget sudo cmap w!! w !sudo tee % >/dev/null " autocmd cursorhold * set nohlsearch " autocmd cursormoved * set hlsearch " Make double- clear search highlights " nnoremap :nohlsearch " Paste and indent nnoremap p p=`] " Quickly edit/reload the vimrc file nmap ev :e $MYVIMRC nmap sv :so $MYVIMRC " Go to tab by number noremap 1 1gt noremap 2 2gt noremap 3 3gt noremap 4 4gt noremap 5 5gt noremap 6 6gt noremap 7 7gt noremap 8 8gt noremap 9 9gt noremap 0 :tablast " Alternate file nmap 6 " vim-cutlass nnoremap x d noremap x d nnoremap xx dd nnoremap X D set statusline+=%#warningmsg# set statusline+=%* set statusline+=%F " fix alt+n mapping in Vim CLI if !has('gui_running') exec "map \en " endif " Auto save and load folds augroup AutoSaveFolds autocmd! " view files are about 500 bytes " bufleave but not bufwinleave captures closing 2nd tab " nested is needed by bufwrite* (if triggered via other autocmd) autocmd BufWinLeave,BufLeave,BufWritePost ?* nested silent! mkview! autocmd BufWinEnter ?* silent! loadview augroup end " nerdtree toggle let g:NERDTreeWinPos = 'right' let g:NERDTreeWinSize=50 let g:NERDTreeMinimalMenu=1 map t :NERDTreeFind " fzf nmap b :Buffers nnoremap (expand('%') =~ 'NERD_tree' ? "\\" : '').":GFiles --cached --others --exclude-standard\" nnoremap ag :Ag xnoremap ag y:Ag " nnoremap ` :Marks " query, ag options, fzf#run options, fullscreen autocmd VimEnter * \ command! -bang -nargs=* Ag \ call fzf#vim#ag(, '', { 'options': ['--bind', 'ctrl-a:select-all,ctrl-d:deselect-all'] }, 0) " minisnip " let g:minisnip_trigger = '' " auto-pairs " let g:AutoPairsFlyMode = 0 " coc " inoremap pumvisible() ? "\" : "\u\" " inoremap pumvisible() ? coc#_select_confirm() : "\u\" " inoremap pumvisible() ? coc#_select_confirm() : "\u\\=coc#on_enter()\" " inoremap coc#refresh() inoremap pumvisible() ? "\" : "\" " inoremap pumvisible() ? "\" : "\" " Use tab for trigger completion with characters ahead and navigate. " inoremap coc#pum#visible() ? coc#pum#next(1) : CheckBackspace() ? "\" : coc#refresh() inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" " Make to accept selected completion item or notify coc.nvim to format " u breaks current undo, please make your own choice. " inoremap coc#pum#visible() ? coc#pum#confirm() : "\u\\=coc#on_enter()\" nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Github Copilot imap Githubissues.
  • Githubissues is a development platform for aggregating issues.