I am a beginner with Vim and I am trying to install Vundle for plugin management. However I keep getting the same error when I open gVim:
Error detected while processing C:\Users\jacob\Vim\_vimrc:
line 5:
E117: Unknown function: vundle#begin
line 7:
E492: Not an editor command: Plugin 'VundleVim/Vundle.vim'
line 9:
E117: Unknown function: vundle#end
I am working on windows 10 and this is how my _vimrc file looks like:
set nocompatible
filetype off
set rtp+=$HOME/.vim/bundle/Vundle.vim/
call vundle#begin('$HOME/.vim/bundle/')
Plugin 'VundleVim/Vundle.vim'
call vundle#end() " required
filetype plugin indent on " required
Perhaps a bit on the late side, but I also received the same error.
After diagnosing what has happened I came to the following problem and solution:
The problem is that using GIT to clone the files, this downloades the Vundle directory to the filepath: ~/vimfiles/bundle/Vundle.vim to the Windows home directory. the final filepath on Windows would then look like: C:\Users\User1~\vimfiles\bundle\Vundle.vim . However the _vimrc files is located under the directory C:\Users\User1\
The sollution is to copy the folder "vimfiles" to the user1 directory (exchange user1 for your own username). The final filepath for the Vundle files should then be C:\Users\User1\vimfiles\bundle\Vundle.vim .
Looks like you missed some steps of the installation, that would clone the Vundle git repository under the $HOME/.vim/bundle directory, creating a Vundle.vim subdirectory there which would have an autoload/vundle.vim which is where functions such as vundle#begin would be searched.
See the Quick Start guide for further instructions. In particular for your case, there's also a link to a quite detailed Windows setup document with many details on how to get the components you need to install Vundle.
You might also want to consider vim-plug as an alternative to Vundle. It's newer and actively maintained, while at the same time using a similar model to Vundle, supporting a similar set of commands and using similar configuration directives. It's also much easier to install, also on Windows. (It only needs a single file to be downloaded.)
Related
I'm trying to setup Facebook Duckling on Windows 10.
When I execute: stack exec duckling-example-exe it produces the following error:
duckling-example-exe.EXE: /etc/zoneinfo/: getDirectoryContents:findFirstFile: does not exist (The system cannot find the path specified.)
I don't understand why I'm getting this error since I followed the recommendation on this GitHub thread which suggests replacing "/usr/share/zoneinfo/" in Duckling/exe/ExampleMain.hs with a link to a folder containing the zoneinfo files. You can see I replaced the path as suggested in the screenshot below:
I also tried adding a double slash as seen below - but it didn't help:
I tried with forward slash instead but this didn't help either:
Moreover, I don't understand where the path: /etc/zoneinfo/ is coming from, if the path is no longer present in ExampleMain.hs? Where is the compiler pulling the path from?
Thanks!
You need to run stack exec duckling-example-exe in the directory where the stack.yaml and project.yaml files of the duckling source code is that you are trying to modify. Otherwise it will use the version of duckling from stackage without your changes.
So, I followed the instuctions in their website, there's a .vim/pack/themes/start path with the dracula folder there with everything and I add the three lines to the _vimrc (had to open as admin to be able to save changes) file in my FilesProgram/Vim folder
after that, two other files appeared, a ._vimrc.un~ and _vimrc~ and now when I try to open vim it gives the following error
Error detected while processing C:\Program Files (x86)\Vim\_vimrc:
line 41:
E919: Directory not found in 'packpath': "pack/*/opt/dracula"
line 43:
E185: Cannot find color scheme 'dracula'
Can anybody tell me where Is the mistake and how to fix it?
We have a cascade of mistakes, here.
The first one was made by the Dracula maintainers, who forgot not everyone uses the same system as them and therefore only provided instructions for "Unix"-like systems and not for Windows (and even those are incorrect anyway).
The second one was made by you, who blindly followed "Unix" instructions on Windows despite the many incompatibilities between those systems.
The third one was also made by you, who edited the system-wide C:\Program Files (x86)\Vim\_vimrc instead of your C:\Users\Edrods\_vimrc.
Follow these steps to fix your setup:
Create C:\Users\Edrods\vimfiles\.
This directory is where all your configuration is supposed to happen. Don't do anything Vim-related anywhere else.
Whenever you see ~/.vim/ mentioned in a tutorial or README.md, replace it mentally with C:\Users\Edrods\vimfiles\.
Create C:\Users\Edrods\vimfiles\vimrc.
This is your main configuration file.
Whenever you see vimrc, .vimrc, or _vimrc mentioned in a tutorial or README.md, replace it mentally with C:\Users\Edrods\vimfiles\vimrc.
Revert any change you may have performed in C:\Program Files (x86)\Vim\.
Whatever line you have added to C:\Program Files (x86)\Vim\_vimrc must be moved to C:\Users\Edrods\vimfiles\vimrc.
Whatever file or directory you may have added to C:\Program Files (x86)\Vim\ must be moved to C:\Users\Edrods\vimfiles\.
The goal is to return C:\Program Files (x86)\Vim\ to its pristine state and forget that directory even exists. It is off-limits.
Put the dracula directory where it belongs:
C:\Users\Edrods\vimfiles\pack\themes\start\dracula
Add these lines to your vimrc (remember what I said earlier about mentally replacing it with the correct path?) if they are not there already:
syntax enable
colorscheme dracula
(Optional) Tell the maintainers of that colorscheme to fix their installation instructions.
(Before downvote im aware how to do this using code thats inline to this command but not how to do it using a file that uses the --app="data:text/html,<sometags></sometags>)
How would I open a local html (mar.html) file using this command
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app=
Specifically, the issue is my lack of familiarity with the --app flag
I tried
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app="mar.html"
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app="file:///mar.html"
Both don't work.
Giving me the error
Your file was not found
It may have been moved or deleted.
ERR_FILE_NOT_FOUND
You almost got it. The file descriptor path must be absolute and encoded.
Encoding the path correctly with cli tools like "urlencode"(gridsite-clients) did not work for me.
If you have NodeJS installed and would use a linux machine, you could use this command.
chromium --app=`node -e "console.log('file://'+encodeURI(process.argv[1]))" "$(realpath "/path/of/your/file.html")"`
This works also fine with relative paths.
For windows you have to rewrite this yourself.
Problem
When I restore from a session, It'll be impossible for to load my filetype plugin.
For example, I have an arduino filetype plugin of ~/.vim/ftplugin/arduino.vim, and the content is like this.
SyntasticToggleMode
call feedkeys("\<CR>")
nnoremap <leader>s :w<cr>:ArduinoVerify<cr>
nnoremap M :ArduinoUpload<cr>
I create an arduino file named test.ino to do some coding.
Every thing seems pretty smooth.
The filetype plugin is loaded properly.
Then I close vim with the following commands.
:mksession!
:wviminfo viminfo
:qa
Now there is a session file named Session.vim.
Then I open vim again, and it automatically load the session because I have something like this in my .vimrc.
filetype indent plugin on
if filereadable("Session.vim")
source Session.vim
endif
if filereadable("viminfo")
rviminfo viminfo
endif
Now something went wrong, the key mapping in my arduino filetype plugin is not working.
Also it prints some error message like this.
Error detected while processing /home/lotp/.vim/ftplugin/arduino.vim:
line 1:
E492: Not an editor command: SyntasticToggleMode"sketch_dec06a.ino" "sketch_dec06a.ino" 12L, 150C
E492: Not an editor command: SyntasticToggleMode
IndeedSyntasticToggleMode is a valid vim command belonging to a vim plugin named syntastic.
Question
Is there a solution to solve this problem?
By this I mean using the session and filetype plugin feather simultaneously.
A partial answer:
The plugins are not loaded directly in .vimrc if you use a plugin manager. Their paths are just appended to 'runtimepath', and they are sourced later in the initialisation process.
You can try to add (i.e. in .vimrc) your own custom path to runtimepath, AFTER the end of the plugin initialisation. (i.e., for Vundle, after this line: call vundle#end()) Then add a vim file in your_custom_path/plugin where you put your code to source the session file.
I didn't check all the infos I gave, so sorry for mistakes, but hope it gives you some ideas.
See :h startup, :h 'runtimepath'
Finally I work around this problem by using an vim plugin.
That's somekind of improved version of the built in vim session system
It's called vim-session
I have unsuccessfully been trying to install some plugins for VIM for sometime. I have mostly been following the information in this reference. I've basically just been dropping the plugin files in various directories hoping something works, nothing has yet. I have a .vim directory at the following path:
/Users/{my_user_name}/.vim
I have tried adding my files to the directory above as well as a directory inside it called plugins. Can anyone suggest what I might be doing wrong?
When I enter
:help 'rtp'
I get
Unix: "$HOME/.vim,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/.vim/after"
Amiga: "home:vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
home:vimfiles/after"
PC, OS/2: "$HOME/vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/vimfiles/after"
Macintosh: "$VIM:vimfiles,
$VIMRUNTIME,
$VIM:vimfiles:after"
The correct location is in a plugin subdirectory (not the plural plugins):
/Users/{my_user_name}/.vim/plugin/*.vim
You can check your actually used path with
:set rtp?
The trailing ? means query value, don't set. (:help rtp is just the general documentation, not what's actually used.)
The useful :scriptnames command will tell you what actually got sourced.
Note that all these instructions are valid for plain *.vim plugin scripts; some plugins are also distributed as (*.zip, or *.tar.gz) archives, or the Vim-specific Vimball (*.vba, *.vmb), which typically contain the subdirectory structure already.
For an hypothetical single-file plugin:
~/.vim/plugin/plugin.vim
For an hypothetical multi-file plugin:
~/.vim/autoload/plugin.vim
~/.vim/plugin/plugin.vim
~/.vim/doc/plugin.txt
If that hypothetical multi-file plugin comes with documentation, run the following command to add it to the :help index:
:helptags ~/.vim/doc
The :scriptnames shows you a list of sourced scripts.
Also, most plugins have some kind of README that details recommended installation procedures: read it.