Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add a .gitignore and avoid bad filenames on OSX #28

Closed
wants to merge 3 commits into from

3 participants

@shelhamer

I have two trivial changes that fixed little issues for me:

  1. ignore the plugin-generated files that relate to tags (tags.txt and index.pickle) to make install & upkeep of the plugin as a git repo hassle-free
  2. strip colons from filenames converted from titles because they are forbidden in OSX filenames (it's some kind of dir separator for backwards-compatibility or some other nonsense).
shelhamer added some commits
@shelhamer shelhamer Ignore plugin use files (tags index)
Ignore tags.txt and index.pickle for 1. ease of installation as git repo
and 2. ease of development in live installation
d2c0ccd
@shelhamer shelhamer Strip colons from filenames in OSX
Strip colon in title-to-filename conversion on OSX since they are
forbidden in filenames.
dbbaf3b
@glacials

I'd like to second the .gitignore part of this, and add that everything in misc/notes/user should also be ignored.

@shelhamer shelhamer Ignore user notes directory; note default location in docs
- Ignore the contents of the default note directory (misc/notes/user)
- Add .gitignore to default note directory to keep it in repo with no
  chance of note filename collision
- Remove README in default note directory, so that the contents can be
  ignored
- Add note about default notes directory in the docs to counter removal
  of the README
bc67ddd
@shelhamer

I ignored misc/notes/user as well, removing the README file and making a note in the docs instead. I'd be happy to split the .gitignore part from the OSX commit to have this merged.

@xolox
Owner

Hi all!

Sorry for the late response. I think all issues mentioned here should now be resolved:

  • Colons in filenames on Mac OS X are now encoded (fixed in xolox#misc#path#encode())
  • Files generated by the plug-in are now ignored in .gitignore, as is doc/tags
  • misc/notes/user/README is gone, as is the containing directory in the repository (I changed the plug-in's initialization code to create the configured directory if it doesn't exist yet, so that the experience for people trying vim-notes for the first time is smooth)
  • I improved the documentation of the g:notes_directory directory to clarify the defaults

I hope this resolves your issues. If not, feel free to reopen the issue on GitHub.

Happy Vimming!

- Peter

@xolox xolox closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 29, 2012
  1. @shelhamer

    Ignore plugin use files (tags index)

    shelhamer authored
    Ignore tags.txt and index.pickle for 1. ease of installation as git repo
    and 2. ease of development in live installation
  2. @shelhamer

    Strip colons from filenames in OSX

    shelhamer authored
    Strip colon in title-to-filename conversion on OSX since they are
    forbidden in filenames.
Commits on Aug 31, 2012
  1. @shelhamer

    Ignore user notes directory; note default location in docs

    shelhamer authored
    - Ignore the contents of the default note directory (misc/notes/user)
    - Add .gitignore to default note directory to keep it in repo with no
      chance of note filename collision
    - Remove README in default note directory, so that the contents can be
      ignored
    - Add note about default notes directory in the docs to counter removal
      of the README
This page is out of date. Refresh to see the latest.
View
3  .gitignore
@@ -0,0 +1,3 @@
+misc/notes/tags.txt
+misc/notes/index.pickle
+misc/notes/user/
View
6 autoload/xolox/notes.vim
@@ -804,7 +804,11 @@ endfunction
function! xolox#notes#title_to_fname(title) " {{{3
" Convert note {title} to absolute filename.
- let filename = xolox#misc#path#encode(a:title)
+ let filename = a:title
+ if has('macunix')
+ let filename = substitute(filename, ':', '', 'g') " strip colon for osx
+ endif
+ let filename = xolox#misc#path#encode(filename)
if filename != ''
let pathname = xolox#misc#path#merge(g:notes_directory, filename . g:notes_suffix)
return xolox#misc#path#absolute(pathname)
View
3  doc/notes.txt
@@ -141,7 +141,8 @@ Vim for the changes to take effect.
The *g:notes_directory* option
All your notes are stored together in one directory. This option defines the
-path of this directory.
+path of this directory. This defaults to 'misc/notes/user' in your Vim profile
+directory.
-------------------------------------------------------------------------------
The *g:notes_suffix* option
View
0  misc/notes/user/.gitignore
No changes.
View
4 misc/notes/user/README
@@ -1,4 +0,0 @@
-README
-
-Your notes will be stored in this directory by default.
-Feel free to delete this file if you don't want to see it again.
Something went wrong with that request. Please try again.