Skip to content

Commit 7553b98

Browse files
committed
feat: Add :NVFiles command and multiple new features (v3.0.0)
New Features: - :NVFiles command - unique file search sorted by mtime (#22, #70) - g:nv_create_if_no_results - auto-create when no matches (#92) - g:nv_create_dirs - multi-directory create bindings (#67) Bug Fixes: - Fix shell escaping for --bind option (#99) Improvements: - Add GitHub issue templates for bugs and features - Add GitHub Actions CI workflow for linting and testing - Update documentation for all new features
1 parent 7bb4171 commit 7553b98

8 files changed

Lines changed: 477 additions & 22 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for reporting! Please fill out the info below to help us debug.
9+
10+
- type: input
11+
id: os
12+
attributes:
13+
label: Operating System
14+
placeholder: "e.g., macOS 14.0, Ubuntu 22.04, Windows 11"
15+
validations:
16+
required: true
17+
18+
- type: input
19+
id: vim-version
20+
attributes:
21+
label: Vim/Neovim Version
22+
description: "Output of `:version` (first line is enough)"
23+
placeholder: "e.g., NVIM v0.9.4, VIM - Vi IMproved 9.0"
24+
validations:
25+
required: true
26+
27+
- type: input
28+
id: fzf-version
29+
attributes:
30+
label: fzf Version
31+
description: "Output of `fzf --version`"
32+
placeholder: "e.g., 0.44.0"
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
id: minimal-config
38+
attributes:
39+
label: Minimal Configuration
40+
description: "A minimal vimrc/init.vim that reproduces the issue"
41+
render: vim
42+
placeholder: |
43+
let g:nv_search_paths = ['~/notes']
44+
" ... other relevant settings
45+
validations:
46+
required: true
47+
48+
- type: textarea
49+
id: description
50+
attributes:
51+
label: Bug Description
52+
description: "What happened? What did you expect?"
53+
validations:
54+
required: true
55+
56+
- type: textarea
57+
id: steps
58+
attributes:
59+
label: Steps to Reproduce
60+
description: "How can we reproduce this bug?"
61+
placeholder: |
62+
1. Open vim
63+
2. Run :NV
64+
3. ...
65+
validations:
66+
required: true
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Feature Description
9+
description: "What would you like to see added or changed?"
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: use-case
15+
attributes:
16+
label: Use Case
17+
description: "How would you use this feature? What problem does it solve?"
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: alternatives
23+
attributes:
24+
label: Alternatives Considered
25+
description: "Have you tried any workarounds? Are there similar features in other tools?"

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install vint
16+
run: pip install vim-vint
17+
18+
- name: Lint Vimscript
19+
run: vint plugin/notational_fzf.vim
20+
21+
test-python:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
python-version: ['3.8', '3.10', '3.12']
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Test Python scripts syntax
35+
run: |
36+
python -m py_compile shorten_path_for_notational_fzf.py
37+
python -m py_compile print_lines.py
38+
python -m py_compile unique_files_search.py
39+
40+
- name: Test unique_files_search.py
41+
run: |
42+
mkdir -p test_notes
43+
echo "hello world" > test_notes/note1.md
44+
echo "python code" > test_notes/note2.md
45+
sleep 0.1
46+
echo "recent note" > test_notes/note3.md
47+
# Test with empty query (should list all files by mtime)
48+
python unique_files_search.py "" test_notes
49+
# Test with query
50+
python unique_files_search.py "python" test_notes
51+
rm -rf test_notes

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## 3.0.0
2+
3+
Major feature release addressing long-standing issues.
4+
5+
### New Features
6+
7+
- **`:NVFiles` command** - New search mode showing unique files sorted by
8+
modification time. Searches both filenames and content, no duplicates.
9+
Closer to original Notational Velocity behavior. (Issue #22, #70)
10+
11+
- **`g:nv_create_if_no_results`** - Auto-create note when no results match
12+
and you press Enter. (Issue #92)
13+
14+
- **`g:nv_create_dirs`** - Map custom keys to create notes in specific
15+
directories. Example: `{'ctrl-1': '~/notes', 'ctrl-2': '~/work'}` (Issue #67)
16+
17+
### Bug Fixes
18+
19+
- Fixed shell escaping for `--bind` option to prevent errors with special
20+
characters like `|` and `()`. (Issue #99)
21+
22+
### Improvements
23+
24+
- Added GitHub issue templates for bug reports and feature requests
25+
- Updated documentation with new options and commands
26+
127
## 2.1.0
228

329
Added more window size management with `g:nv_window_width` and

README.md

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
# Looking for Maintainer
2-
3-
I don't have time to maintain this project anymore. If you are interested in
4-
taking over, please contact me in the GitHub issues.
5-
61
# Notational FZF
72

3+
[![Actively Maintained](https://img.shields.io/badge/status-actively%20maintained-brightgreen)](https://github.com/alok/notational-fzf-vim/issues)
4+
85
***Loosen the mental blockages to recording information. Scrape away the
96
tartar of convention that handicaps its retrieval.***
107

@@ -119,9 +116,13 @@ let g:nv_search_paths = ['~/wiki', '~/writing', '~/code', 'docs.md' , './notes.m
119116

120117
## Detailed Usage
121118

122-
This plugin unites searching and file creation. It defines a single
123-
command `:NV`, which can take 0 or more arguments, which are interpreted
124-
as regexes.
119+
This plugin unites searching and file creation. It defines two commands:
120+
121+
### `:NV` - Line-based Search (Original)
122+
123+
The original command that searches content line-by-line. When you select a
124+
result, it opens the file and jumps to the matching line. Best for finding
125+
specific content within notes.
125126

126127
Type `:NV` or bind it to a mapping to bring up a fuzzy search menu. Type
127128
in your search terms and it will fuzzy search for them. Adding an
@@ -159,16 +160,42 @@ Additional built-in keybindings:
159160

160161
The lines around the selected file will be visible in a preview window.
161162

163+
### `:NVFiles` - Unique File Search (New)
164+
165+
An alternative command that shows unique files instead of individual lines.
166+
Files are sorted by modification time (most recent first), and both filenames
167+
and file contents are searched. This is closer to the original Notational
168+
Velocity behavior.
169+
170+
```vim
171+
:NVFiles " Show all files sorted by mtime, filter interactively
172+
:NVFiles python " Pre-filter to files matching 'python'
173+
:NVFiles! " Fullscreen mode
174+
```
175+
176+
**Key differences from `:NV`:**
177+
- Shows each file only once (no duplicates)
178+
- Sorted by modification time (most recent first)
179+
- Searches both filenames and content
180+
- Opens file at the beginning (no line jumping)
181+
- Interactive filtering re-searches as you type
182+
183+
**Use `:NV` when:** You need to find a specific line or jump to exact content.
184+
185+
**Use `:NVFiles` when:** You're looking for a note by name or topic and don't
186+
need to jump to a specific line.
187+
162188
## Mappings
163189

164-
This plugin only defines a command `:NV`, and if you want a mapping for
165-
it, you can define it yourself. This is intentionally not done by
166-
default. You should use whatever mapping(s) work best for you.
190+
This plugin defines `:NV` and `:NVFiles` commands. If you want mappings
191+
for them, you can define them yourself. This is intentionally not done
192+
by default. You should use whatever mapping(s) work best for you.
167193

168194
For example,
169195

170196
``` {.vim}
171197
nnoremap <silent> <c-s> :NV<CR>
198+
nnoremap <silent> <c-n> :NVFiles<CR>
172199
```
173200

174201
## Optional Settings and Their Defaults
@@ -256,6 +283,15 @@ let g:nv_ignore_pattern = ['summarize-*', 'misc*']
256283
" handler function. Most users won't want to set this to anything.
257284
258285
let g:nv_expect_keys = []
286+
287+
" Boolean. If set, automatically create a note when no results match and you
288+
" press Enter. Disabled by default to preserve original behavior.
289+
let g:nv_create_if_no_results = 0
290+
291+
" Dictionary. Map keys to directories for creating notes in specific locations.
292+
" Each key creates a note in the corresponding directory instead of g:nv_main_directory.
293+
" Example: let g:nv_create_dirs = {'ctrl-1': '~/notes', 'ctrl-2': '~/work'}
294+
let g:nv_create_dirs = {}
259295
```
260296

261297
### bat config

doc/notational-fzf-vim.txt

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ CONTENTS *notational-fzf-contents*
1212
1.6. Optional dependencies..........|notational-fzf-optional_dependencies|
1313
1.7. Required Settings..................|notational-fzf-required_settings|
1414
1.8. Detailed Usage........................|notational-fzf-detailed_usage|
15+
1.8.1. :NV Command...............................|notational-fzf-nv|
16+
1.8.2. :NVFiles Command.....................|notational-fzf-nvfiles|
1517
1.9. Mappings....................................|notational-fzf-mappings|
1618
1.10. Optional Settings and Their Defaults.|notational-fzf-optional_settings_and_their_defaults|
1719
1.10.1. bat config.........................|notational-fzf-bat_config|
@@ -137,17 +139,22 @@ Remember that these can be relative links.
137139
--------------------------------------------------------------------------------
138140
DETAILED USAGE *notational-fzf-detailed_usage*
139141

140-
This plugin unites searching and file creation. It defines a single
141-
command `:NV`, which can take 0 or more arguments, which are interpreted
142-
as regexes.
142+
This plugin unites searching and file creation. It defines two commands:
143+
`:NV` for line-based search and `:NVFiles` for unique file search.
144+
145+
*notational-fzf-nv*
146+
:NV Command ~
147+
148+
The original command that searches content line-by-line. When you select
149+
a result, it opens the file and jumps to the matching line.
143150

144151
Type `:NV` or bind it to a mapping to bring up a fuzzy search menu. Type
145152
in your search terms and it will fuzzy search for them. Adding an
146153
exclamation mark to the command (`:NV!`), will run it fullscreen.
147154

148155
You can type `:NV` to see all results, and then filter them with FZF.
149-
You can type to restrict your initial search to lines that
150-
contain the phrase `python`. will find all numbers
156+
You can type `:NV python` to restrict your initial search to lines that
157+
contain the phrase `python`. `:NV [0-9] [0-9]` will find all numbers
151158
separated by a space. You know, regexes.
152159

153160
It does not search in a fully fuzzy fashion because that's less useful
@@ -167,16 +174,38 @@ Note that the following options can be customized.
167174

168175
The lines around the selected file will be visible in a preview window.
169176

177+
*notational-fzf-nvfiles*
178+
:NVFiles Command ~
179+
180+
An alternative command that shows unique files instead of individual lines.
181+
Files are sorted by modification time (most recent first), and both
182+
filenames and file contents are searched.
183+
>
184+
:NVFiles " Show all files sorted by mtime
185+
:NVFiles python " Pre-filter to files matching 'python'
186+
:NVFiles! " Fullscreen mode
187+
<
188+
Key differences from `:NV`:
189+
* Shows each file only once (no duplicates)
190+
* Sorted by modification time (most recent first)
191+
* Searches both filenames and content
192+
* Opens file at the beginning (no line jumping)
193+
* Interactive filtering re-searches as you type
194+
195+
Use `:NV` when you need to find a specific line or jump to exact content.
196+
Use `:NVFiles` when you're looking for a note by name or topic.
197+
170198
--------------------------------------------------------------------------------
171199
MAPPINGS *notational-fzf-mappings*
172200

173-
This plugin only defines a command `:NV`, and if you want a mapping for
174-
it, you can define it yourself. This is intentionally not done by
175-
default. You should use whatever mapping(s) work best for you.
201+
This plugin defines `:NV` and `:NVFiles` commands. If you want mappings
202+
for them, you can define them yourself. This is intentionally not done
203+
by default. You should use whatever mapping(s) work best for you.
176204

177205
For example,
178206
>
179207
nnoremap <silent> <c-s> :NV<CR>
208+
nnoremap <silent> <c-n> :NVFiles<CR>
180209
<
181210

182211
--------------------------------------------------------------------------------
@@ -238,6 +267,15 @@ default, set .
238267
" List of Strings. Key mappings like above in case you want to define your own
239268
" handler function. Most users won't want to set this to anything.
240269
let g:nv_expect_keys = []
270+
271+
" Boolean. If set, automatically create a note when no results match
272+
" and you press Enter. Disabled by default.
273+
let g:nv_create_if_no_results = 0
274+
275+
" Dictionary. Map keys to directories for creating notes in specific
276+
" locations. Each key creates a note in the corresponding directory.
277+
" Example: let g:nv_create_dirs = {'ctrl-1': '~/notes', 'ctrl-2': '~/work'}
278+
let g:nv_create_dirs = {}
241279
<
242280

243281
BAT CONFIG *notational-fzf-bat_config*

0 commit comments

Comments
 (0)