Comments (37)
Just a 5 cents: it is very likely that people use fish_user_path
incorrectly. I've ran into this very problem and solved it by reading more about how to use fish_user_path
.
When in need to add something to path, instead of doing this (which I did and which was wrong):
set fish_user_paths $fish_user_paths /new/path
One must do this:
set fish_user_paths /new/path
set fish_user_paths /new/path /another/new/path /and/another/one
fishshell
listens for changes to $fish_user_paths
variable, and does what has to be done to update $PATH
.
I recognized this specifically by running benchmarks built into vim
and fish
, and inspecting the output. In my case there were tons and tons of fish_user_paths
calls. Here's how to benchmark:
- in vim:
vim --startuptime vim.log some_file.txt
- in fish:
fish -p profile.txt -c 'echo "Hello, world!"'
from vim-fish.
Any update on this? I had to uninstall vim-fish because of it
from vim-fish.
@ElijahLynn Yes sir! I'm on master
, installed both Vim and NeoVim with homebrew, and startup is all back to normal (at most 100ms or so).
from vim-fish.
This seems to have fixed it for myself in both vim and neovim (sorry @pierrebeaucamp!), thanks for the update @ElijahLynn
from vim-fish.
I'm closing this, as I've had my issue solved. Thank you @ElijahLynn !
from vim-fish.
Reopening because others reported slowness as well, but didn't report it being solved.
I would guess the slowness comes either from executable()
having to search all of $PATH
, although that should still be pretty much instant, it happens any time you type an unknown command into the shell; or from calling out to fish with system()
to get $fish_function_path
, which will run all your fish config.
Those of you experiencing slowness: is fish itself similarly slow to start?
from vim-fish.
There is job for vim & neovim could be used to avoid the block running system command.
from vim-fish.
Ditto, still no updates from me. I just uninstalled it @pierrebeaucamp
from vim-fish.
Ubuntu 14.04, Fish 2.4.0, vim-fish 825853f (master)
fast for me: The ftplugin/fish.vim lead is the longest of the loads but still 31ms.
048.776 001.217: loading plugins
048.917 000.141: loading packages
048.937 000.020: inits 3
049.570 000.633: reading viminfo
049.599 000.029: setting raw mode
049.608 000.009: start termcap
049.635 000.027: clearing screen
053.393 001.163 001.163: sourcing /usr/share/vim/vim74/scripts.vim
054.569 000.663 000.663: sourcing /home/elijah/.vim/bundle/vim-fish/syntax/fish.vim
086.425 031.327 031.327: sourcing /home/elijah/.vim/bundle/vim-fish/ftplugin/fish.vim
087.978 000.053 000.053: sourcing /home/elijah/.vim/bundle/vim-fish/indent/fish.vim
088.643 005.802: opening buffers
from vim-fish.
Can you checkout master
from source and try? That way we can compare.
from vim-fish.
Also, @pierrebeaucamp are you also using Homebrew and Neovim? Is it easy for you try with normal Vim, not in home brew?
from vim-fish.
I'm using Neovim. I checked out master, but it still takes multiple seconds to load. Longest file to load is ftplugin/fish.vim
as well, which takes nearly 2 seconds.
from vim-fish.
@kyleholzinger So to confirm, you are using master
, Homebrew and Neovim or Vim and the speed is normal now and it appears that using master
resolved the issue?
from vim-fish.
I'm running into the slowness issue as well.
I use:
- neovim 0.1.7
- fish 2.5.0
Both installed via homebrew.
I ran:
$ nvim --startuptime vim.log .config/fish/config.fish
Click "Details" below to see the log. Note the following line:
2901.355 2805.314 2805.314: sourcing /Users/gmile/.config/nvim/bundle/vim-fish/ftplugin/fish.vim
$ cat vim.log
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.010 000.010: --- NVIM STARTING ---
000.646 000.636: locale set
001.511 000.865: inits 1
001.529 000.018: window checked
002.118 000.589: parsing arguments
002.122 000.005: expanding arguments
002.181 000.059: inits 2
002.324 000.143: init highlight
003.039 000.317 000.317: sourcing /Users/gmile/.config/nvim/autoload/pathogen.vim
031.817 000.092 000.092: sourcing /Users/gmile/.config/nvim/bundle/apiblueprint.vim/ftdetect/apiblueprint.vim
032.014 000.041 000.041: sourcing /Users/gmile/.config/nvim/bundle/rust.vim/ftdetect/rust.vim
032.268 000.151 000.151: sourcing /Users/gmile/.config/nvim/bundle/vim-elixir/ftdetect/elixir.vim
032.549 000.178 000.178: sourcing /Users/gmile/.config/nvim/bundle/vim-fish/ftdetect/fish.vim
032.764 019.438 018.976: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/filetype.vim
032.970 000.047 000.047: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/ftplugin.vim
033.161 000.040 000.040: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/indent.vim
033.821 000.224 000.224: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/syntax/syncolor.vim
033.957 000.522 000.298: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/syntax/synload.vim
033.996 000.735 000.213: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/syntax/syntax.vim
034.676 000.181 000.181: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/syntax/syncolor.vim
035.079 000.183 000.183: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/syntax/syncolor.vim
041.581 007.486 007.122: sourcing /Users/gmile/.config/nvim/bundle/base16-vim/colors/base16-default-dark.vim
041.667 039.154 011.091: sourcing /Users/gmile/.config/nvim/init.vim
041.675 000.197: sourcing vimrc file(s)
041.976 000.085 000.085: sourcing /Users/gmile/.config/nvim/bundle/apiblueprint.vim/plugin/apiary.vim
042.129 000.102 000.102: sourcing /Users/gmile/.config/nvim/bundle/apiblueprint.vim/plugin/apiblueprint.vim
043.710 001.399 001.399: sourcing /Users/gmile/.config/nvim/bundle/bufexplorer/plugin/bufexplorer.vim
044.782 000.439 000.439: sourcing /Users/gmile/.config/nvim/bundle/ctrlp.vim/autoload/ctrlp/mrufiles.vim
045.039 001.153 000.714: sourcing /Users/gmile/.config/nvim/bundle/ctrlp.vim/plugin/ctrlp.vim
046.422 000.252 000.252: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/autoload/nerdtree.vim
048.782 000.942 000.942: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/path.vim
049.114 000.194 000.194: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/menu_controller.vim
049.369 000.128 000.128: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/menu_item.vim
049.667 000.174 000.174: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/key_map.vim
050.119 000.327 000.327: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/bookmark.vim
050.614 000.366 000.366: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/tree_file_node.vim
051.352 000.609 000.609: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/tree_dir_node.vim
051.804 000.325 000.325: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/opener.vim
052.305 000.375 000.375: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/creator.vim
052.508 000.078 000.078: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/flag_set.vim
052.854 000.222 000.222: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/nerdtree.vim
053.487 000.509 000.509: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/ui.vim
053.649 000.039 000.039: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/event.vim
053.834 000.061 000.061: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/lib/nerdtree/notifier.vim
054.655 000.683 000.683: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/autoload/nerdtree/ui_glue.vim
073.828 000.105 000.105: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/nerdtree_plugin/exec_menuitem.vim
074.550 000.647 000.647: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/nerdtree_plugin/fs_menu.vim
074.818 029.507 023.470: sourcing /Users/gmile/.config/nvim/bundle/nerdtree/plugin/NERD_tree.vim
075.021 000.048 000.048: sourcing /Users/gmile/.config/nvim/bundle/rust.vim/plugin/rust.vim
079.319 004.125 004.125: sourcing /Users/gmile/.config/nvim/bundle/vim-fugitive/plugin/fugitive.vim
080.113 000.219 000.219: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/gzip.vim
080.175 000.013 000.013: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/health.vim
080.282 000.064 000.064: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/man.vim
080.914 000.587 000.587: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/matchit.vim
081.153 000.192 000.192: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/matchparen.vim
081.705 000.496 000.496: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/netrwPlugin.vim
081.850 000.080 000.080: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/rplugin.vim
081.922 000.016 000.016: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/rrhelper.vim
082.106 000.123 000.123: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/shada.vim
082.204 000.035 000.035: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/spellfile.vim
082.439 000.175 000.175: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/tarPlugin.vim
082.610 000.112 000.112: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/tohtml.vim
082.693 000.029 000.029: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/tutor.vim
082.961 000.215 000.215: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/plugin/zipPlugin.vim
083.052 002.603: loading plugins
083.263 000.210: loading packages
083.273 000.010: inits 3
087.346 004.073: reading ShaDa
090.208 002.861: clearing screen
095.523 000.683 000.683: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/scripts.vim
2901.355 2805.314 2805.314: sourcing /Users/gmile/.config/nvim/bundle/vim-fish/ftplugin/fish.vim
2902.246 000.050 000.050: sourcing /Users/gmile/.config/nvim/bundle/vim-fish/indent/fish.vim
2902.771 000.169 000.169: sourcing /Users/gmile/.config/nvim/bundle/vim-fish/syntax/fish.vim
2905.582 000.294 000.294: sourcing /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime/autoload/remote/host.vim
2906.201 000.193 000.193: sourcing /Users/gmile/.config/nvim/bundle/ctrlp.vim/autoload/ctrlp/utils.vim
2907.541 010.630: opening buffers
2907.599 000.058: BufEnter autocommands
2907.605 000.006: editing files in windows
2908.033 000.427: VimEnter autocommands
2908.035 000.002: before starting main loop
2913.764 005.729: first screen update
2913.767 000.003: --- NVIM STARTED ---
$
from vim-fish.
Mind blowingly slow for me, wow. Any direction on how to improve the load time?
from vim-fish.
@babakness can you run vim with --startuptime
flag like this:
vim --startuptime vim.log some_file.txt
And post here the contents of vim.log
?
In my case I have solved the problem after I noticed incorrectly configured fish, specifically the usage of fish_user_paths
fish's function.
from vim-fish.
@gmile
Sure, relevant bits here:
065.290 000.046: setting raw mode
065.294 000.004: start termcap
065.313 000.019: clearing screen
074.441 001.215 001.215: sourcing /usr/local/share/vim/vim80/scripts.vim
5024.670 4950.498 4950.498: sourcing /Users/me/.vim/bundle/vim-fish/ftplugin/fish.vim
5025.775 000.068 000.068: sourcing /Users/me/.vim/bundle/vim-fish/indent/fish.vim
5026.555 000.195 000.195: sourcing /Users/me/.vim/bundle/vim-fish/syntax/fish.vim
5027.115 010.826: opening buffers
5027.171 000.056: BufEnter autocommands
5027.176 000.005: editing files in windows
5027.498 000.322: VimEnter autocommands
5027.499 000.001: before starting main loop
5028.096 000.597: first screen update
5028.097 000.001: --- VIM STARTED ---
from vim-fish.
similar issue with nvim
. Both installed via brew on mac.
from vim-fish.
@babakness can you run this:
fish -p profile.txt -c 'echo "Hello, world!"'
And post the contents of profile.txt
?
from vim-fish.
I'm just starting out with fish and I had this problem too. My config.fish
only had the following line:
brew command command-not-found-init > /dev/null 2>&1; and . (brew command-not-found-init)
Removing it caused vim-fish to launch smoothly.
from vim-fish.
Talk about specific lol. That seems unrelated to this plugin, I wanna say...
from vim-fish.
Hmm, fish_function_path
is not the same as fish_user_paths
.
from vim-fish.
@dag good point, I mistyped that! Updated the comment to have fish_function_path
removed. Thank you for spotting!
from vim-fish.
Ah you mean, this might be causing executable()
to be slow for people? I thought you were saying it was making the system()
call slow, but that you were confusing the issue.
from vim-fish.
Yes, I think it is executable()
that's slow for people. It was for me.
from vim-fish.
I found system("fish -c 'echo $fish_function_path'")
is slow, but still calling fish -c 'echo $fish_function_path
from shell is not slow.
from vim-fish.
@ypresto Have you tried the suggestion at the bottom of the readme?
Also, have you tried calling that fish -c
line from a shell other than fish?
from vim-fish.
I had uninstalled this plugin due to the same issue. However, I had also been noticing that the startup time for fish shell itself was getting longer and longer. I found that I was incorrectly setting fish_user_paths
as as @gmile had mentioned. This was causing the variable to bloat over time (tens of thousands of directories long). Removing this and then re-installing the plugin seems to have fixed both issues.
from vim-fish.
@dag Thanks, set shell=sh
resolved my issue..!
Moreover, start up time of entire vim got faster!
(echo &shell
was /bin/zsh).
from vim-fish.
hmm, I found it is still slow when I put anyenv init code in config.fish:
eval (anyenv init - fish | source)
When I put sleep 5
it tooks 5 secs to open config.fish file with vim.
from vim-fish.
I'm definitely still experiencing slowness. After profiling, I was able to narrow down the problem to ftplugin but beyond that, I'm not sure. I've also tried the suggestion of set shell=sh
which sped up vim in general but didn't make much of a difference to vim-fish startup time.
As a side note, is this repo still being maintained? I'd love to help with it in any way I can
from vim-fish.
Takes 3 seconds longer to start Neovim when opening a file of filetype fish
with vim-fish
enabled. Instant when starting same configuration from Zsh or Bash, so let me see….
In my case it seems to be because my Fish is slow at startup (because of something in my configuration, apparently), and Fish is for some reason called by vim-fish
even when I specify set shell=sh
in Neovim's init.vim
as the top to be sure it has an effect on plugins.
Workaround (with reduced functionality): I commented out every system()
and execute
in $HOME/.local/share/dein/repos/github.com/dag/vim-fish/*/*
, then fought the cache of Dein, somehow eventually successfully.
Solution (for me): Clean up $fish_user_paths
and properly set it (if at all). fish-shell/fish-shell#5834 (comment) Edit $XDG_CONFIG_HOME/fish/config.fish
and make changes according with comments, then erase all of $fish_user_paths
by running set --erase --universal fish_user_paths
and then restart Fish.
from vim-fish.
vim-fish
always calls fish to get the value of $fish_function_path
on startup.
I attempted @chemzqm's suggestion if you'd like to try it out:
blankname/pull/3
If all of the cases of this slowness are traced to misconfiguration of fish, I probably won't merge it.
from vim-fish.
Is there any chance running the job in the background results in undesired behavior?
from vim-fish.
If something uses path
before the job has finished it won't contain the $fish_function_path
directories.
Vim's docs have some things that use path
listed:
Plugins may also use path
.
The worry is that this change might be added complication to solve a problem that's better solved outside of vim through fish configuration fixes.
from vim-fish.
It seems the reason we're evaluating job_start
should be solved without it. Asynchronous startup can be a worthy pursuit, but in this case I agree that it appears worse to make that change.
I actually hadn't fixed my problem with $fish_user_paths
, but learned how with some help over at fish-shell/fish-shell#5834 (comment).
Thank you for your time, @blankname.
from vim-fish.
my performance issues ended up being a misconfigured $fish_user_paths
in my config.fish.
simple fix for me was to do the following:
- removed the offending line (e.g.
set fish_user_paths $fish_user_paths /some/path
) - then ran this
echo $fish_user_paths > ~/fish_user_paths.bak
set updated_paths (echo $fish_user_paths | tr " " "\n" | sort -r | uniq)
echo $updated_paths | tr " " "\n" | nl
set --universal fish_user_paths $updated_paths
from vim-fish.
Related Issues (20)
- Move usage notes from README to help file
- Drop or improve the funced behavior HOT 5
- Improve portability
- Syntax Checker return Unknown command 'eval' HOT 2
- HOW TO INSTALL? HOT 9
- E484: Can't open file /tmp/vnKV0xX/0 at Vim startup HOT 3
- syntastic checker doesn't work with current syntastic HOT 2
- Indentation is broken HOT 10
- Comments are replaced by empty lines HOT 5
- funced support HOT 4
- Unable to create temp dir automatically
- Unknown option error on start up HOT 2
- neosnippet snippets HOT 1
- Not keyword is not highlighted HOT 4
- Broken syntax of quoted strings
- "Invalid range" plugin error when opening fish file HOT 1
- A fork that I indend to maintain HOT 1
- Completion is broken HOT 1
- pushd and popd are considered errors
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 vim-fish.