You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,18 +31,24 @@ Unzip the most recent [ZIP archive] [download] file inside your Vim profile dire
31
31
32
32
All options have reasonable defaults so if the plug-in works after installation you don't need to change any options. They're available for people who like to customize their directory layout. These options can be configured in your [vimrc script][vimrc] by including a line like this:
Note that after changing an option in your [vimrc script][vimrc] you have to restart Vim for the changes to take effect.
37
37
38
-
### The `g:notes_directory` option
38
+
### The `g:notes_directories` option
39
39
40
-
All your notes are stored together in one directory. This option defines the path of this directory. The default value depends on circumstances but should work for most people:
40
+
Your notes are stored in one or more directories. This option defines where you want to store your notes. Its value should be a list (there's an example above) with one or more pathnames. The default is a single value which depends on circumstances but should work for most people:
41
41
42
42
* If the profile directory where the plug-in is installed is writable, the directory `misc/notes/user` under the profile directory is used. This is for compatibility with [Pathogen][pathogen]; the notes will be stored inside the plug-in's bundle.
43
43
44
44
* If the above doesn't work out, the default depends on the platform: `~/vimfiles/misc/notes/user` on Windows and `~/.vim/misc/notes/user` on other platforms.
45
45
46
+
#### Backwards compatibility
47
+
48
+
In the past the notes plug-in only supported a single directory and the corresponding option was called `g:notes_directory`. When support for multiple notes directories was introduced the option was renamed to `g:notes_directories` to reflect that the value is now a list of directory pathnames.
49
+
50
+
For backwards compatibility with old configurations (all of them as of this writing :-) the notes plug-in still uses `g:notes_directory` when it is defined (its no longer defined by the plug-in). However when the plug-in warns you to change your configuration you probably should because this compatibility will be removed at some point.
51
+
46
52
### The `g:notes_suffix` option
47
53
48
54
The suffix to add to generated filenames. The plug-in generates filenames for your notes based on the title (first line) of each note and by default these filenames don't include an extension like `.txt`. You can use this option to make the plug-in automatically append an extension without having to embed the extension in the note's title, e.g.:
@@ -103,28 +109,32 @@ This option defines the pathname of the text file that stores the list of known
103
109
104
110
## Commands
105
111
106
-
To edit one of your existing notes you can use Vim commands such as [:edit][edit], [:split][split] and [:tabedit][tabedit] with a filename that starts with *note:* followed by (part of) the title of one of your notes, e.g.:
112
+
To edit one of your existing notes (or create a new one) you can use Vim commands such as [:edit][edit], [:split][split] and [:tabedit][tabedit] with a filename that starts with *note:* followed by (part of) the title of one of your notes, e.g.:
107
113
108
114
:edit note:todo
109
115
110
116
This shortcut also works from the command line:
111
117
112
118
$ gvim note:todo
113
119
114
-
When you don't follow *note:* with anything a new note is created.
120
+
When you don't follow *note:* with anything a new note is created like when you execute `:Note` without any arguments.
115
121
116
122
### The `:Note` command
117
123
118
124
When executed without any arguments this command starts a new note in the current window. If you pass one or more arguments the command will edit an existing note containing the given words in the title. If more than one note is found you'll be asked which note you want to edit. If no notes are found a new note is started with the given word(s) as title.
119
125
120
126
This command will fail when changes have been made to the current buffer, unless you use `:Note!` which discards any changes.
121
127
128
+
When you are using multiple directories to store your notes and you run `:Note` while editing an existing note, a new note will inherit the directory of the note from which you started. Otherwise the note is created in the first directory in `g:notes_directories`.
129
+
122
130
*This command supports tab completion:* If you complete one word, all existing notes containing the given word somewhere in their title are suggested. If you type more than one word separated by spaces, the plug-in will complete only the missing words so that the resulting command line contains the complete note title and nothing more.
123
131
124
132
### The `:NoteFromSelectedText` command
125
133
126
134
Start a new note in the current window with the selected text as the title of the note. The name of this command isn't very well suited to daily use, that's because it's intended to be executed from a mapping. The default mapping for this command is `\en` (the backslash is actually the character defined by the [mapleader][mapleader] variable).
127
135
136
+
When you are using multiple directories to store your notes and you run `:NoteFromSelectedText` while editing an existing note, the new note will inherit the directory of the note from which it was created.
137
+
128
138
### The `:SplitNoteFromSelectedText` command
129
139
130
140
Same as `:NoteFromSelectedText` but opens the new note in a vertical split window. The default mapping for this command is `\sn`.
0 commit comments