Giter Club home page Giter Club logo

Comments (10)

amadeus avatar amadeus commented on July 24, 2024 2

I came from Neocomplete as well, and this would be super helpful to have since I often like to keep my current pwd at a project level, and not a file level.

from completor.vim.

cvlmtg avatar cvlmtg commented on July 24, 2024 1

As @maln0ir said, that's how vim's filename completion works.

sorry, I understood it as "it's already working the way you are asking". anyway, neocomplete is able to make file completion working relative to the file dir even if autochdir is not set. I've seen file completion is handled via python in completor, so I suppose it might be possibile to make it work relative to the file dir here too, but I don't know python :)

from completor.vim.

aliev avatar aliev commented on July 24, 2024 1

@cvlmtg why not to use set autochdir? or the most smart and quick fix (if you're using nerdtree or want to keep project root):

autocmd InsertEnter * let save_cwd = getcwd() | set autochdir
autocmd InsertLeave * set noautochdir | execute 'cd' fnameescape(save_cwd)

taken from here http://superuser.com/questions/604122/vim-file-name-completion-relative-to-current-file

from completor.vim.

maralla avatar maralla commented on July 24, 2024 1

Now the filename completion is relative to current editing file directory. #74

from completor.vim.

amadeus avatar amadeus commented on July 24, 2024 1

You are a god amongst men. Thank you!

from completor.vim.

 avatar commented on July 24, 2024

Filename completion works that way, but first you need to type ./ before filename. Then you can even go "up" in the directory tree without problems.

from completor.vim.

cvlmtg avatar cvlmtg commented on July 24, 2024

no, it doesn't work that way.

let's say I have this project:

tmp
  project
    app
      stores
        a-store.js
      components
        a-component.jsx

the CWD is /tmp/project and I'm editing app/components/a-component.jsx. If I want to include the store, this is what happens:

schermata 2016-10-25 alle 10 05 24

as you can see when adding ./ the completion start from the working directory and not the file directory.

from completor.vim.

josefson avatar josefson commented on July 24, 2024

As @maln0ir said, that's how vim's filename completion works.
Try loading your app/components/a-component.jsx from /tmp/project with vim -u NONE -N path/to/a-component.jsx. This will open vanilla/default vim.
Now try vim default filename completion: ./ + it will suggest files from CWD instead of the buffer/file directory.

from completor.vim.

cvlmtg avatar cvlmtg commented on July 24, 2024

@aliev setting autochdir breaks a lot of things in my workflow. I'll try the "smart" fix even if it's annoying to see the file path in the status bar change every time I enter or leave insert mode. I still think it would be more correct fix this in completor and not in my vimrc

from completor.vim.

SageEx avatar SageEx commented on July 24, 2024

Support for this would be really nice.

from completor.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.