https://github.com/tizee/findfirst.vim
Find the file/directory path up to the moon!
https://github.com/tizee/findfirst.vim
Last synced: 4 months ago
JSON representation
Find the file/directory path up to the moon!
- Host: GitHub
- URL: https://github.com/tizee/findfirst.vim
- Owner: tizee
- Created: 2021-06-07T10:55:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-25T18:19:59.000Z (about 4 years ago)
- Last Synced: 2025-02-25T01:55:05.617Z (over 1 year ago)
- Language: Vim script
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# findfirst.vim
Find the first matched file path until reached root which is `\` in Unix-like system.
No dependency required.
## Usage
```
" return: path to file
function! g:FindFirst(pattern) " -> v:string
```
```vimscript
" find path
call FindFirst("Cargo.toml")
call FindFirst("package.json")
call FindFirst("^README.*$")
call FindFirst(".*\.md")
call FindFirst(".editorconfig")
call FindFirst(".git$")
```