Comments (22)
Hmm, let me look at this more over the week. I'll get back to you on that.
You don't want to replace the path (in most cases) since bits of the path can be relevant to your search, like ~/wiki/note.md
and ~/notes/note.md
. Then the path helps to disambiguate them.
from notational-fzf-vim.
@borderomm, I asked @junegunn about this and I'm waiting for a reply. Otherwise, this looks like it'll involve a bunch of annoying fiddling.
As a (bad) quick fix, you could symlink your notes directory to something like ~/notes
. If it doesn't work, let me know and I can at least fix that quickly.
from notational-fzf-vim.
The latest version has g:nv_show_preview
and g:nv_show_filepath
options to allow you to hide the preview window and filenames. Try let g:nv_show_filepath = 0
to hide the filenames completely.
Let me know if that helped.
from notational-fzf-vim.
Alok,
Thanks for the changes. Unfortunately none of them work for me:
-
I already have a symlink for the dir, indeed i have
~/notes
as you suggested. However, when showing the path, it shows the full path, which is very long and covers the files -
let g:nv_show_filepath
doesn't really work for me as expected. Covering the path completely is very confusing as it also hides the filename. IF it would show the filename, maybe that would work but, as it is now, it's confusing to me.
from notational-fzf-vim.
That's odd, it doesn't show the full path when I tested it. It just showed the symlink. Can you try that again and report back? Maybe you have both the full path and the symlink listed in g:nv_directories
.
from notational-fzf-vim.
This is my .vimrc
""" configuration for notational-fzf-vim
let g:nv_directories = ['~/notes']
let g:nv_default_extension = '.md'
let g:nv_main_directory = g:nv_directories[0] " default is first in directory list
let g:nv_show_filepath = 1
let g:nv_show_preview = 1
let g:nv_preview_width = 72
let g:nv_wrap_preview_text = 0
And this is what i see:
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
/usr/local/company_name/home/user/notes/reminder_notes.md
> ls -l notes
lrwxrwxrwx 1 user user 56 Jan 29 11:58 notes -> /usr/local/company_name/home/user/GoogleDrive/#MyNotes
NOTE: I modified username and company_name
from notational-fzf-vim.
from notational-fzf-vim.
I just confirmed I'm in the last commit
silent! let g:plugs['notational-fzf-vim'].commit = 'e3f9dfb'
Without changing anything in my configuration, results seems exactly the same as 8 hours ago.
from notational-fzf-vim.
Ok. I was wondering if you maybe had ag
aliased to ag -f
, which follows symlinks. Can you try running the search manually in the terminal with ag
and see if it prints the filenames?
from notational-fzf-vim.
Mmm,
I haven't touched anything related to ag.
I went inside a folder and ran a simple ag search. Output below:
> ag txt resources
resources/app/README.md
28: ([MIT License](https://github.com/mootools/mootools-core/blob/master/Source/license.txt))
30: ([MIT License](https://github.com/jacomyal/sigma.js/blob/master/LICENSE.txt))
36: ([License](https://github.com/github/octicons/blob/master/LICENSE.txt))
> pwd
/usr/local/company_name/home/user/Downloads/app
I load fzf in zsh as below:
.zshrc
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# don't want to exclude hidden files plus ignore googledrive folder and .git
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'
# To apply the command to CTRL-T as well
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
and in .vimrc
let $FZF_DEFAULT_COMMAND= 'ag --hidden --ignore .git -g ""'
from notational-fzf-vim.
In any case, I added g:use_short_pathnames
just now. See if it works for you.
Scratch that, it doesn't work for anyone since FZF takes the text directly, and it's been modified, so the pathname isn't valid.
from notational-fzf-vim.
I think I mentioned this before, but you can feed the original path along with the shortened string to fzf, and hide the long one inside the finder using --with-nth
option.
echo "/very/long/path:/v/l/p: foobar" | fzf -d: --with-nth 2..
from notational-fzf-vim.
@junegunn Thanks for the tip. @borderomm Check the latest commit.
from notational-fzf-vim.
@alok Thanks for adding a patch.
I added the script in a directory called in $PATH. However I still see the same behavior.
How am I supposed to call the script and/or configure vim to do it?
Thanks
from notational-fzf-vim.
from notational-fzf-vim.
Is the script executable?
Yes
> ls -l bin/shorten_path_for_notational_fzf.py
-rwxr-x--- 1 user group 37356 Feb 15 22:11 bin/shorten_path_for_notational_fzf.py
from notational-fzf-vim.
Well, if it's in your $PATH
, and it's not working, then I have no idea what's wrong.
from notational-fzf-vim.
Do you have python 3 installed?
from notational-fzf-vim.
I do but, I was using python2.7 by default.
I added an alias in my .zshrc to point to python3.4
Still no luck.
David
from notational-fzf-vim.
Don't do that, just pull the latest commit. If this doesn't work, then you're probably on your own. I really can't see why your computer seems to act differently.
from notational-fzf-vim.
@alok I just tried in my linux machine at home and I have the same behavior. Nothing changes after having the script in my $PATH.
I'm not sure what I'm supposed to see.
With our without the python script I see the same path names.
Both machines are completely different (ubuntu vs debian), non-related at all and have the same outcome.
How can I know if the script is running?
from notational-fzf-vim.
from notational-fzf-vim.
Related Issues (20)
- Sort results by recent file access HOT 2
- fzf colors and preview HOT 5
- Sanitize/adjust file name on create_note_key HOT 3
- Some files in search path not appearing? HOT 11
- Support "window" position HOT 1
- Struggling to understand how it chooses which line to open the file in
- [suggestion] An option to set a alternative separator when saving new notes HOT 1
- Error on MacVim when choosing the highlight HOT 1
- E492 :NV not an editor command HOT 2
- README.md should explain that `g:nv_main_directory` must also appear in `g:nv_search_paths`
- Force fzf-vim to pass nohidden option to --preview-window to override shell defaults
- Question : pls explain note handler HOT 1
- help confirm mapping HOT 2
- Some files are missing (too many?) HOT 5
- "Command failed" error
- Is there a way to make a single key open or create a note depending on if results are found?
- Proposal to become mantainer of the project HOT 3
- windwos环境上gvim中使用出现Command failed" error
- Notational fzf not finding all results during TMUX session when starting from CLI using an alias HOT 2
- I really liked this tool, but I see lack of maint ? Any alternatives ? I would have supported it if I knew Python or vimscript. HOT 6
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 notational-fzf-vim.