Skip to content

Commit 8881d41

Browse files
committed
Exclude "anonymous" swap files in search-notes.py (.s??)
1 parent 9933c4f commit 8881d41

4 files changed

Lines changed: 53 additions & 6 deletions

File tree

‎TODO.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# To-do list for the `notes.vim` plug-in
22

3+
* The note name highlighting uses word boundaries so that 'git' inside 'fugitive' is not highlighted, however this breaks highlighting of note names ending in punctuation (or more generically ending in non-word characters).
34
* The `ftplugin/notes.vim` script used to clear the [matchpairs] [matchpairs] option so that pairs of characters are not highlighted in notes (the irrelevant highlighting was starting to annoy me). Several people have since complained that Vim rings a bell or flashes the screen for every key press in insert mode when editing notes. I've now removed the matchpairs manipulation from the plug-in but I suspect that this may actually be a bug in Vim; to be investigated. See also [issue 10 on GitHub] [issue_10].
45
* Override `<F1>` to show a quick reference of available commands?
56
* Define aliases of the available commands that start with `Note` (to help people getting started with the plug-in).

‎autoload/xolox/notes.vim‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: December 14, 2011
3+
" Last Change: January 18, 2012
44
" URL: http://peterodding.com/code/vim/notes/
55

66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.16.16'
9+
let g:xolox#notes#version = '0.16.17'
1010
let s:scriptdir = expand('<sfile>:p:h')
1111

1212
function! xolox#notes#init() " {{{1

‎doc/notes.txt‎

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
*notes.txt* Easy note taking in Vim
22

3+
===============================================================================
4+
*notes-contents*
5+
Contents ~
6+
7+
1. Introduction |notes-introduction|
8+
2. Install & usage |notes-install-usage|
9+
3. Options |notes-options|
10+
1. The |g:notes_directory| option
11+
2. The |g:notes_suffix| option
12+
3. The |g:notes_title_sync| option
13+
4. The |g:notes_smart_quotes| option
14+
5. The |g:notes_ruler_text| option
15+
6. The |g:notes_list_bullets| option
16+
7. The |g:notes_shadowdir| option
17+
8. The |g:notes_indexfile| option
18+
9. The |g:notes_indexscript| option
19+
10. The |g:notes_tagsindex| option
20+
4. Commands |notes-commands|
21+
1. The |:Note| command
22+
2. The |:NoteFromSelectedText| command
23+
3. The |:SplitNoteFromSelectedText| command
24+
4. The |:TabNoteFromSelectedText| command
25+
5. The |:DeleteNote| command
26+
6. The |:SearchNotes| command
27+
1. |:SearchNotes| understands @tags
28+
2. Accelerated searching with Python |notes-accelerated-searching-with-python|
29+
7. The |:RelatedNotes| command
30+
8. The |:RecentNotes| command
31+
9. The |:ShowTaggedNotes| command
32+
10. The |:IndexTaggedNotes| command
33+
5. Mappings |notes-mappings|
34+
1. Insert mode mappings |notes-insert-mode-mappings|
35+
6. Customizing the syntax highlighting of notes
36+
7. Other plug-ins that work well with the notes plug-in
37+
1. utl.vim |notes-utl.vim|
38+
2. shell.vim |notes-shell.vim|
39+
3. VOoM |notes-voom|
40+
4. Txtfmt |notes-txtfmt|
41+
8. Contact |notes-contact|
42+
9. License |notes-license|
43+
44+
===============================================================================
45+
*notes-introduction*
46+
Introduction ~
47+
348
The notes.vim plug-in for the Vim text editor makes it easy to manage your
449
notes in Vim:
550

@@ -266,7 +311,6 @@ notes containing all of the given keywords:
266311
:SearchNotes syntax highlighting
267312
268313
-------------------------------------------------------------------------------
269-
*:searchnotes-understands-tags*
270314
|:SearchNotes| understands @tags ~
271315

272316
If you don't pass any arguments to the |:SearchNotes| command it will search
@@ -360,7 +404,7 @@ Insert mode mappings ~
360404

361405
- '@' automatically triggers tag completion
362406

363-
- ' becomes '‘' or '’' depending on where you type it
407+
- '' becomes '‘' or '’' depending on where you type it
364408

365409
- '"' becomes '“' or '”' (same goes for these)
366410

‎misc/notes/search-notes.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Python script for fast text file searching using keyword index on disk.
44
#
55
# Author: Peter Odding <peter@peterodding.com>
6-
# Last Change: November 25, 2011
6+
# Last Change: January 18, 2012
77
# URL: http://peterodding.com/code/vim/notes/
88
# License: MIT
99
#
@@ -113,7 +113,9 @@ def update_index(self):
113113
# First we find the filenames and last modified times of the notes on disk.
114114
notes_on_disk = {}
115115
for filename in os.listdir(self.user_directory):
116-
if filename != '.swp' and not fnmatch.fnmatch(filename, '.*.s??'): # (Vim swap files are ignored)
116+
# Vim swap files are ignored.
117+
if (filename != '.swp' and not fnmatch.fnmatch(filename, '.s??')
118+
and not fnmatch.fnmatch(filename, '.*.s??')):
117119
abspath = os.path.join(self.user_directory, filename)
118120
if os.path.isfile(abspath):
119121
notes_on_disk[abspath] = os.path.getmtime(abspath)

0 commit comments

Comments
 (0)