Comments (10)
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.
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.
@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.
Now the filename completion is relative to current editing file directory. #74
from completor.vim.
You are a god amongst men. Thank you!
from completor.vim.
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.
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:
as you can see when adding ./
the completion start from the working directory and not the file directory.
from completor.vim.
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.
@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.
Support for this would be really nice.
from completor.vim.
Related Issues (20)
- A source for ctags?
- the fallback completer: complete form the current buffer, not from all buffers? HOT 1
- Integrate ALE completion HOT 2
- LanguageServer.jl LSP support
- Just show the function arguments over it with Jedi HOT 1
- 能否改进一下候选项的顺序
- The completed word is inserted in the wrong position, if a german umlaut is present in the current line.
- can I use pyls with completor.vim ?! HOT 1
- self.ident is HOT 1
- start_column() doen't work for non english words
- using arrow keys instead of ctrl+n
- 中文补全时会吞掉标点之前的部分字符 HOT 1
- Tweaking LSP trigger accordingly
- Validator requires vim compiled with python or python3 and has features `job`, `timers` and `lambda` HOT 1
- iskeyword option
- Getting completion for R programming
- Cannot get to work on msys2
- Placeholders for function arguments - integration with CompleteParameter.vim HOT 2
- Any updates so far, generally speaking?
- How to log an LSP output without the use of `let g:completor_debug = 1`?
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 completor.vim.