Comments (8)
Also experienced this issue. My guess is that Vim / the OS doesn't know how to expand the ~
. The solution that seemed to work for me is to wrap the s:dir
in an expand()
This works for me in Linux and Windows.
diff --git a/plugin/sensible.vim b/plugin/sensible.vim
index 4c5b37b..44b2f30 100644
--- a/plugin/sensible.vim
+++ b/plugin/sensible.vim
@@ -63,13 +63,13 @@ set viminfo^=!
let s:dir = has('win32') ? '~/Application Data/Vim' : has('mac') ? '~/Library/Vim' : '~/.local/share/vim'
if isdirectory(expand(s:dir))
if &directory =~# '^\.,'
- let &directory = s:dir . '/swap//,' . &directory
+ let &directory = expand(s:dir) . '/swap//,' . &directory
endif
if &backupdir =~# '^\.,'
- let &backupdir = s:dir . '/backup//,' . &backupdir
+ let &backupdir = expand(s:dir) . '/backup//,' . &backupdir
endif
if exists('+undodir') && &undodir =~# '^\.\%(,\|$\)'
- let &undodir = s:dir . '/undo//,' . &undodir
+ let &undodir = expand(s:dir) . '/undo//,' . &undodir
endif
endif
if exists('+undofile')
from vim-sensible.
Strangely enough, it stills has the ~
when I do set undodir?
, so I'm not sure what magic is happening
from vim-sensible.
I actually worried that this might happen, but then completely half-assed verifying that it worked. Thanks.
from vim-sensible.
Strangely my undodir,directory and backupdir aren't assigned correclty at all.
:echo &directory | echo &undodir | echo &swap
.,/Users/timosand/tmp,/var/tmp,/tmp
.
.,/Users/timosand/tmp,/Users/timosand/
This is annoying since it inserts the temp files in the cwd of the file.
I'm on OS X 10.8, vim 7.3
from vim-sensible.
You have to create the directories yourself to opt in.
On Tue, Feb 5, 2013 at 5:41 PM, Timo Sand [email protected] wrote:
Strangely my undodir,directory and backupdir aren't assigned correclty at
all.
:echo &directory | echo &undodir | echo &swap.,/Users/timosand/tmp,/var/tmp,/tmp
.
.,/Users/timosand/tmp,/Users/timosand/This is annoying since it inserts the temp files in the cwd of the file.
I'm on OS X 10.8, vim 7.3
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-13156424.
from vim-sensible.
I have created them
$ ll ~/Library/Vim
total 0
drwxr-xr-x 2 timosand staff 68 Jan 26 21:40 backup/
drwxr-xr-x 2 timosand staff 68 Jan 26 21:40 swap/
drwxr-xr-x 2 timosand staff 68 Jan 26 21:40 undo/
from vim-sensible.
This is just a hunch, but maybe you aren't using MacVim? In the code, it uses has('mac')
to check if it is running on the Mac, and according to this post on stackoverflow, the native Vim binary doesn't itself report itself as "having mac". A more convoluted solutions follows, using system(uname)
to check if it is Darwin, but that obviously won't work on Windows.
from vim-sensible.
Well crap, that's almost certainly it. Open a new bug for it. I'm not sure how I'll solve it yet.
Long term I'm definitely moving this to a separate plugin. It's way too much of a headache to be "sensible".
from vim-sensible.
Related Issues (20)
- set mouse=a HOT 11
- sessionoptions+=localoptions HOT 8
- Revert accidental <C-W> HOT 2
- viewoptions-=options HOT 1
- Installation instructions incorrect HOT 2
- Proposal: let g:netrw_banner = 0 HOT 2
- :set secure and :set nomodeline HOT 1
- sidescrolloff setting causes sudden row offsets in vifm plugin in Neovim on Windows HOT 1
- Scrolloff in terminal HOT 4
- Insert mode <c-w> mapping breaks abbreviations HOT 1
- "set display+=lastline" do nothing if added after "set display=truncate" HOT 1
- SSL certificate HOT 2
- `:redir` causes shell prompt to move when exiting vim HOT 2
- Terminal positions cursor in the bottom left of the screen when exiting Vim HOT 3
- Conflict with gitsessions.vim, syntax highlighting isn't restored HOT 2
- .vimrc:3: parse error near `\n' HOT 1
- Usage of :redir causes ≈10x perf regression when loading vim-sensible HOT 2
- vim-sensible causes indentation when typing "#" in YAML files? HOT 4
- New to vim - Followed instructions but nothing HOT 1
- Line 62, laststatus = 2 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-sensible.