junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
33.89k stars 1.9k forks source link

`:` commands not available. Unknown command: :PlugInstall #1230

Closed kuncevic closed 1 year ago

kuncevic commented 1 year ago

I have implemented all the steps

  1. curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  2. created a ~/.vimrc with default config

However none of the : commands are available

 :call plug#begin('~/.vim/plugged')
cd: The directory '~/.vim/plugged' does not exist
fish: Unknown command: :call
:PlugInstall
fish: Unknown command: :PlugInstall

call plug#begin()
" The default plugin directory will be as follows:
"   - Vim (Linux/macOS): '~/.vim/plugged'
"   - Vim (Windows): '~/vimfiles/plugged'
"   - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
" You can specify a custom plugin directory by passing it as the argument
"   - e.g. `call plug#begin('~/.vim/plugged')`
"   - Avoid using standard Vim directory names like 'plugin'

" Make sure you use single quotes

" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'

" Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'

" Multiple Plug commands can be written in a single line using | separators
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'

" On-demand loading
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }

" Using a non-default branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }

" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }

" Plugin options
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }

" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }

" Unmanaged plugin (manually installed and updated)
Plug '~/my-prototype-plugin'

" Initialize plugin system
" - Automatically executes `filetype plugin indent on` and `syntax enable`.
call plug#end()
fish: Unknown command: :version
junegunn commented 1 year ago

The error messages indicate that you're running the command on your shell, fish, instead of in Vim.

fish: Unknown command

These are Vim commands and functions, they are only available inside Vim.

Also, you're not supposed to run plug#begin manually. Put it in your .vimrc, and Vim will run it when it starts.

kuncevic commented 1 year ago

I thought that are commands that are available in terminal. The doc was saying Reload .vimrc and :PlugInstall to install plugins, so I thought this is a command 🤷‍♂️ Now had to dig more into it 🙂, thank you for clearing the things out.