Coder Social home page Coder Social logo

Comments (22)

alok avatar alok commented on May 20, 2024

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.

alok avatar alok commented on May 20, 2024

@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.

alok avatar alok commented on May 20, 2024

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.

borderomm avatar borderomm commented on May 20, 2024

Alok,

Thanks for the changes. Unfortunately none of them work for me:

  1. 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

  2. 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.

alok avatar alok commented on May 20, 2024

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.

borderomm avatar borderomm commented on May 20, 2024

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.

alok avatar alok commented on May 20, 2024

from notational-fzf-vim.

borderomm avatar borderomm commented on May 20, 2024

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.

alok avatar alok commented on May 20, 2024

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.

borderomm avatar borderomm commented on May 20, 2024

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.

alok avatar alok commented on May 20, 2024

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.

junegunn avatar junegunn commented on May 20, 2024

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.

alok avatar alok commented on May 20, 2024

@junegunn Thanks for the tip. @borderomm Check the latest commit.

from notational-fzf-vim.

borderomm avatar borderomm commented on May 20, 2024

@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.

alok avatar alok commented on May 20, 2024

from notational-fzf-vim.

borderomm avatar borderomm commented on May 20, 2024

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.

alok avatar alok commented on May 20, 2024

Well, if it's in your $PATH, and it's not working, then I have no idea what's wrong.

from notational-fzf-vim.

alok avatar alok commented on May 20, 2024

Do you have python 3 installed?

from notational-fzf-vim.

borderomm avatar borderomm commented on May 20, 2024

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.

alok avatar alok commented on May 20, 2024

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.

borderomm avatar borderomm commented on May 20, 2024

@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.

alok avatar alok commented on May 20, 2024

from notational-fzf-vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.