aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorCamil Staps2021-06-18 14:03:32 +0200
committerCamil Staps2021-06-18 14:03:32 +0200
commit26e83c78c3430e53b8bad0066c0dce48f9f232be (patch)
tree2dfc1ffe19bdc8c9a5ed9bbdee1891fb8f02611d /vim
parentDiscard old autocmds when reloading .vimrc (diff)
Fix vim SwitchToFileOrOpen; take current directory into account
Diffstat (limited to 'vim')
-rw-r--r--vim/.vimrc3
1 files changed, 2 insertions, 1 deletions
diff --git a/vim/.vimrc b/vim/.vimrc
index e35f9cb..ff39615 100644
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -183,7 +183,8 @@ augroup END
" Switch to a window that has a buffer open, or open a new window if no window
" exists for that filename.
function! s:switch_to_file_or_open(filename, in_tab)
- let id=bufwinid('^' . a:filename . '$')
+ let fname = filenamemodify(a:filename, ':~:.')
+ let id = bufwinid('^' . a:filename . '$')
if id < 0
if a:in_tab
tabnew