Comments (12)
Anyhow, I think this is more a question for @junegunn and how to use vim-plug
Yeah, it is. After the initial clone, vim-plug executes do
block before loading the plugin, so the command is not yet available at the point. There's no good explanation for the decision. I would say it was not an issue as the option was mainly added to run shell commands such as make
. Unfortunately it's not easy to change the order of the operations at this stage, as it concerns me that it might break some (hypothetical) user's configuration.
Anyway, in this case you can load the plugin in advance using plug#load
function.
function! DoUnicode(arg)
call plug#load('unicode.vim')
UnicodeDownload
endfunction
Plug 'chrisbra/unicode.vim', { 'do': function('DoUnicode') }
But as you have noted, the way the command works is not compatible with the subsequent buffer manipulation of vim-plug. The part of the installer was written with the assumption that the cursor stays in its window. It'll be an easy fix, I'll look into it later in the day.
from unicode.vim.
Hi Evan!
On Mi, 15 Jun 2016, Evan Sosenko wrote:
I'd like the download of
UnicodeData.txt
to happen on plugin install / update. I'm trying this with vim-plug:function! DoUnicode(arg) UnicodeDownload endfunction Plug 'chrisbra/unicode.vim', { 'do': function('DoUnicode') }which fails with
x Post-update hook for unicode.vim ... Vim:E492: Not an editor command: UnicodeDownload
I also tried
function! DoUnicode(arg) call unicode#Download(1) endfunction Plug 'chrisbra/unicode.vim', { 'do': function('DoUnicode') }which seems to run, but not actually download anything and breaks the vim-plug install process.
I don't know vim-plug very well. I would either force sourcing the
plugin/unicode.vim file or postpone the call until the VimEnter event.
Best,
Christian
Glück ist Selbstgenügsamkeit.
-- Aristoteles, 384-322 v. Chr.
from unicode.vim.
IMO, force sourcing the file goes against the grain of using a plugin manager (path resolution is non-trivial). Trying that does run the command, however it has the same issue as just calling unicode#Download(1)
as in the second example.
It would be nice if the Download function could work with this, but a workaround is
let unicode_src = 'http://unicode.org/Public/UNIDATA/UnicodeData.txt'
let unicode_dest = './autoload/unicode/UnicodeData.txt'
Plug 'chrisbra/unicode.vim',
\ { 'do': join(['curl --create-dirs -o', unicode_dest, unicode_src], ' ')}
from unicode.vim.
downloading depends on netrw. Perhaps that is not initialized, when vim-plug runs? Anyhow, I think this is more a question for @junegunn and how to use vim-plug
from unicode.vim.
Thanks @junegunn for the info. I am closing this then.
from unicode.vim.
@razor-x Should be fixed now.
function! DoUnicode(...)
call plug#load('unicode.vim')
silent! UnicodeDownload
endfunction
I found that silent!
is necessary due to an error in UnicodeDownload
(lcd
to a non-existing directory).
from unicode.vim.
@junegunn Right, silent!
fixes the issue where UnicodeDownload
breaks PlugInstall
, now the issue is with the UnicodeDownload
function itself.
@chrisbra Perhaps I should open a new issue for this, but basically UnicodeDownload
fails (with or without netrw) with the non-existing directory error. What's weird is that if you try to insert a character for the first time (<C-X><C-Z>
) then it will trigger the initial download, succeed, and then open the popup. (There is actually another bug where once the popup has opened in this way, the only way to close it is to restart vim).
For reference, I'm using Neovim.
from unicode.vim.
I'll fix that. The second bug you mentioned, I haven't seen, can you check, if this happens with Vim as well please?
from unicode.vim.
Yes, the popup bug happens in vim and gvim as well. The popup is unfocused as well as stuck open.
from unicode.vim.
The popup bug is a Vim bug. I have posted a patch. Let's hope it will get fixed soon.
from unicode.vim.
@razor-x With the latest vim-plug, you can now do this (note the :
prefix):
Plug 'chrisbra/unicode.vim', { 'do': ':silent! UnicodeDownload' }
from unicode.vim.
Am 2016-07-13 16:10, schrieb Junegunn Choi:
@razor-x [1] With the latest vim-plug, you can now do this (note the :
prefix):Plug 'chrisbra/unicode.vim', { 'do': ':silent! UnicodeDownload' }
Great, thanks!
Note: the sil! shouldn't be necessary anymore with the latest version of
unicode.vim
Best,
Christian
from unicode.vim.
Related Issues (20)
- Typo in hasmapto for UnicodeSwapCompleteName HOT 1
- "See CHANGELOG.md" at the bottom of the helpfile is not very useful. HOT 1
- Fundamental unicode problems with Vim [SOLVED] HOT 3
- Make :DigraphNew not verbose HOT 4
- DigraphGA is buggy in neovim HOT 2
- caching problems HOT 10
- Enter Unicode character in search mode HOT 4
- Lookup by html code HOT 8
- Support nerd font characters HOT 6
- E325 when running ":UnicodeTable" in 2 Vim instances simultaneously HOT 1
- Say thanks link is broken HOT 3
- `silent! lang messages` is better than `sil lang mess` HOT 11
- Command to download HOT 2
- issue with candidate sorting in completion menu? HOT 1
- windows UnicodeData.txt download error HOT 1
- UnicodeDownload data is garbled by older version of links HOT 2
- Would Perl-style short names with :UnicodeSearch be a good idea? HOT 1
- Providing way to do :DownloadUnicode! to download latest unicode data without prompt HOT 2
- Readme <C-x><C-g> looks like Insert mode command HOT 2
- Error 734 from line 75 of unicode#GetUniChar HOT 2
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 unicode.vim.