aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins/complete-filename.lua
AgeCommit message (Collapse)AuthorFilesLines
2024-04-30lua: complete-filename: use biggest possible prefixFlorian Fischer1-1/+1
This allows for example to complete file names in markdown images. E.g.: ![](pic<C-x><C-f> will complete the file name. Previously it would have detected the '[' as prefix.
2024-03-21Fix typosMax Schillinger1-1/+1
2023-12-14complete-filename: include '{' in leading delimiter patternFlorian Fischer1-1/+1
This allows to complete file names in latex code (e.g. `\include{foo}`).
2023-11-03lua: refactor complete-filename pluginRandy Palamar1-33/+28
There are probably more things to simplify but at least this makes it easier to see what exactly is different between `<C-x><C-f>` and `<C-x><C-o>`. Some differences were removed: * whitespace in range is treated the same for both actions * empty range will expand to files in CWD for both actions closes #1146: Complete file name and file path swapped in doc
2020-12-27lua: fix luacheck warningsMarc André Tanner1-1/+1
These are either accidentally global or unused variables. In the file type pluging the mime type variable was wrongly scoped, meaning the text/plain settings applied to all otherwise unknown files.
2018-02-28Merge branch 'vis-open-fixes' of https://github.com/kj/visMarc André Tanner1-1/+2
2018-01-27vis-complete: send whole paths for completionTwoFinger1-1/+4
text_object_word() was only sending the last part of a pathname to vis-complete. text_object_longword() is better, but sometimes may send a bit too much, so leading delimiters for some languages are stripped additionally.
2018-01-01vis-open: fix for absolute and non-existent pathsKelsey Judson1-2/+3
When the shell cannot find any matching files, the glob is not expanded, and vis-open will return the absolute path of the current working directory (because dirname outputs '.'), followed by the filename, followed by a literal '*'. This commit checks that the final path actually exists, and if not, exits with status 1. It also uses text_object_longword for the range to match, so that absolute paths are accepted, and replaced properly (else it only works back to the first '/').
2017-07-14vis-lua: make selection first class primitives in Lua APIMarc André Tanner1-6/+6
2017-03-31vis: improve tab completion in command promptMarc André Tanner1-1/+30
At some point it should probably be possible to add command prompt bindings from within Lua. Currently there is no easy/realiable way to detect the prompt window. Should improve #526.
2017-03-05lua: reimplement word and file name completion in luaMarc André Tanner1-0/+23
The file name completion does not yet behave the same way as the previous C code because the completion prefix is currently simply calculated using the `iw` text object which does not handle common path elements (e.g. `.`, `/`, `~`, etc).