wincent / command-t

⌨️ Fast file navigation for Neovim and Vim
BSD 2-Clause "Simplified" License
2.74k stars 317 forks source link

Installation Instructions Unclear #412

Closed amab8901 closed 1 year ago

amab8901 commented 1 year ago

Please make the installation instructions (https://github.com/wincent/command-t/blob/main/doc/command-t.txt) more clear.

Instruction: cd into the lua/wincent/commandt/lib/ directory

Comment: What if I don't have such a directory? And where does the lua directory begin? In root folder? In home directory? Please specify.

Instruction: type:

make <

Comment: I type it, and it says: make: *** No targets specified and no makefile found. Stop. Something isn't right here. Which target should I specify? And how should I deal with the makefile?

Instruction: See also |command-t-ruby-installation| for older installation instructions

Comment: That section apparently doesn't exist. Or at least I couldn't find it. Any links perhaps?

wincent commented 1 year ago

Hi @amab8901. Yeah, it's a bit tricky, and the docs are a bit of a work-in-progress.

What if I don't have such a directory?

If you have Command-T, you have the directory, but I can't know where you have it so I can't really put that in the docs... like, did you clone the Git repo? Did you use a plug-in manager? If so, which one? How is it configured?

A few lines up from there, it says:

Run :checkhealth wincent.commandt to confirm that the C library has been built, and check for the presence of the optional executable helpers.

If you put Command-T in "the right place" (usually the case if you used a plug-in manager to do so), then that will print out the exact path. For example, this is what it prints on my system:

wincent.commandt: require("wincent.commandt.health").check()
========================================================================
  - INFO: Command-T version: 6.0.0-a.4

## Checking that C library has been built
  - INFO: Build directory is:
    /Users/wincent/.config/nvim/pack/bundle/opt/command-t/lua/wincent/commandt/lib
  - OK: library can be `require`-ed and functions called

## Checking for optional external dependencies
  - OK: (optional) `git` binary found
  - OK: (optional) `rg` binary found
  - OK: (optional) `find` binary found
  - OK: (optional) `watchman` binary found

So, for me that means I have to cd /Users/wincent/.config/nvim/pack/bundle/opt/command-t/lua/wincent/commandt/lib before running make.

I probably need to add a section listing a few common plug-in managers and installation locations, and put the prompt to run :checkhealth front and center in the docs.

That section apparently doesn't exist. Or at least I couldn't find it.

It's here. But if you're using the Lua implementation, you probably won't have much need for the Ruby implementation. You can still run the build commands mentioned there though if you want.

amab8901 commented 1 year ago

I'm using vim-plug. I'm totally new to this stuff and I'm just today starting to learn how this vim-plug works.

Based on this (https://github.com/junegunn/vim-plug), I get the impression that I should be writing like this:

call plug#begin('~/.config/nvim')

Plug 'wincent/command-t'

" (...)

call plug#end()

in the ~/.vimrc file. And so that's exactly what I've done. Now I open some arbitrary file in nvim, for example nvim hi, and I run :checkhealth wincent.commandt in the nvim, and here is the output I get:

wincent-commandt: 
========================================================================
  - ERROR: No healthcheck found for "wincent-commandt" plugin.

I have also cloned the github repository (I realize I'm supposed to clone the github repository and that the URI refers to a location within that cloned repository). Running the make command works now.

So I think I successfully passed the installation phase. However, for some reason :checkhealth wincent.commandt doesn't produce the right output.

EDIT: I tried troubleshooting by following the instructions on this page:

If a problem occurs the first thing you should do is inspect the output of:

  ruby extconf.rb
  make

So I run ruby extconf.rb, and here is the output:

ruby: No such file or directory -- extconf.rb (LoadError)

EDIT 2:

Oh, I found the location of extconf.rb by running find -type f -name "*extconf*". Now the below runs successfully:

  ruby extconf.rb
  make

... but running checkhealth wincent.commandt still doesn't work

EDIT 3: So according to the troubleshooting instructions (https://github.com/wincent/command-t/blob/f6a6cf7fb17cee08ca0ca84ffce6aabccc3d8476/doc/command-t-ruby.txt), I'm supposed to compare the two outputs below:

~/src/command-t/ruby/command-t/ext/command-t $  
  ruby extconf.rb
  make
checking for float.h... yes
checking for ruby.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for fcntl.h... yes
checking for stdint.h... yes
checking for sys/errno.h... yes
checking for sys/socket.h... yes
checking for ruby/st.h... yes
checking for st.h... no
checking for pthread_create() in -lpthread... yes
creating Makefile
linking shared-object ext.so

 ~/src/command-t/ruby/command-t/ext/command-t $  
nvim --version
NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

I'm not sure how I'm supposed to compare them? They don't seem comparable since they provide info of different nature. I think you should clarify in the instruction/documentation how exactly the comparison should be made.

wincent commented 1 year ago

I've not used vim-plug myself but this bit looks about right:

Plug 'wincent/command-t'

(Not sure you need to pass a path to call plug#begin() though — the docs say that a presumably reasonable default will be used if you don't.)

Did you actually run :PlugInstall to install the plugin though? After that, I would expect :checkhealth wincent.commandt to work.

amab8901 commented 1 year ago

Oh, the problem was caused by my move from Vim to Neovim. Neovim doesn't use ~/.vimrc for its configuration (unlike Vim), but rather Neovim configurations are put in here: ~/.config/nvim/init.vim. After I made that discovery, I could easily figure out how to get CommandT to work. At least in the sense that :checkhealth wincent.commandt in nvim produces the following output:

wincent.commandt: require("wincent.commandt.health").check()
========================================================================
  - INFO: Command-T version: 6.0.0-a.4

## Checking that C library has been built
  - INFO: Build directory is:
    /home/amab/.vim/plugged/command-t/lua/wincent/commandt/lib
  - OK: library can be `require`-ed and functions called

## Checking for optional external dependencies
  - OK: (optional) `find` binary found
  - OK: (optional) `rg` binary found
  - OK: (optional) `git` binary found
  - WARNING: (optional) `watchman` binary is not in $PATH
    - ADVICE:
      - commandt.watchman_finder requires `watchman`

Thanks for your help!