I have done a git-diff to generate a patch file:
cd
git diff --no-prefix ~/.vim/bundle/vim-latex-suite/ftplugin/latex-suite/compiler.vim ~/compiler.vim > ~/vimlatex.patch
The resulting patch is
diff --git home/rudra/.vim/bundle/vim-latex-suite/ftplugin/latex-suite/compiler.vim home/rudra/compiler.vim
index 65cd33a..abfcff7 100644
--- home/rudra/.vim/bundle/vim-latex-suite/ftplugin/latex-suite/compiler.vim
+++ home/rudra/compiler.vim
@@ -434,7 +434,8 @@ function! Tex_ForwardSearchLaTeX()
else
" We must be using a generic UNIX viewer
" syntax is: viewer TARGET_FILE LINE_NUMBER SOURCE_FILE
-
+ let mainfnameRelative = fnameescape(fnamemodify(Tex_GetMainFileName(), ':p:.:r'))
+ let target_file = mainfnameRelative . "." . s:target
let execString .= join([viewer, target_file, linenr, sourcefile])
endif
I want to apply this patch to /home/rudra/.vim/bundle/vim-latex-suite/ftplugin/latex-suite/compiler.vim
But when I am trying to apply the patch, its giving:
patch -p0 < vimlatex.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git home/rudra/.vim/bundle/vim-latex-suite/ftplugin/latex-suite/compiler.vim home/rudra/compiler.vim
|index 65cd33a..abfcff7 100644
|--- home/rudra/.vim/bundle/vim-latex-suite/ftplugin/latex-suite/compiler.vim
|+++ home/rudra/compiler.vim
--------------------------
File to patch: /home/rudra/.vim/bundle/vim-latex-suite/ftplugin/latex-suite/compiler.vim
patching file /home/rudra/.vim/bundle/vim-latex-suite/ftplugin/latex-suite/compiler.vim
The problem is, while it is working fine, I want it to understand which file it should patch, without asking me File to patch:
How I can achieve this?
-p
.