Git Product home page Git Product logo

Comments (9)

r10r avatar r10r commented on July 1, 2024 1

Ok now I understand that it only works in split view because both buffers are active then. Thanks for your help!

Bildschirmfoto 2024-05-24 um 08 57 23

from coc.nvim.

fannheyward avatar fannheyward commented on July 1, 2024

Use coc-sh:

image

from coc.nvim.

r10r avatar r10r commented on July 1, 2024

@fannheyward Thanks for the quick answer. Is there a way to do this without the coc-sh languageserver extension ?
My mistake I should have noted that I'm searching a more general way, e.g specify a newline separated file as completion source.

from coc.nvim.

fannheyward avatar fannheyward commented on July 1, 2024
image

Open my.env in another buffer, coc.nvim will provide completion item from buffer source.

from coc.nvim.

r10r avatar r10r commented on July 1, 2024

Hmm, unfortunately this doesn't work for me. Any ideas ?

[[email protected]:~/.vim/pack/vendor/start/coc.nvim]# git log
commit a0f3e2c1b13157a25063b32b49debf46cc96a873 (grafted, HEAD -> release, origin/release)
Author: Heyward Fann <[email protected]>
Date:   Mon Mar 11 10:59:55 2024 +0800

    commit 84ce03120925c980288665028aedcf06f6cb837e
[[email protected]:~]# vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Nov 24 2023 11:25:06)
Included patches: 1-2127
Compiled by Alpine Linux
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term -gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     -perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
-clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3/dyn       +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby/dyn          +wildignore
+cursorbind        +lua/dyn           +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             +xattr
-dnd               -mouseshape        +spell             -xfontset
-ebcdic            +mouse_dec         +startuptime       -xim
+emacs_tags        -mouse_gpm         +statusline        -xpm
+eval              -mouse_jsbterm     -sun_workshop      -xsmp
+ex_extra          +mouse_netterm     +syntax            -xterm_clipboard
+extra_search      +mouse_sgr         +tag_binary        -xterm_save
-farsi             -mouse_sysmouse    -tag_old_static    
   system vimrc file: "/etc/vim/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -
D_FORTIFY_SOURCE=1 
Linking: gcc -Wl,--as-needed,-O1,--sort-common -Wl,-z,pack-relative-relocs -L/usr/local/lib -o vim -lm -lncurses 
Bildschirmfoto 2024-05-23 um 11 38 01

from coc.nvim.

fannheyward avatar fannheyward commented on July 1, 2024

Can't reproduce, the :CocList sources already has buffer source. Try minimal vimrc.

from coc.nvim.

r10r avatar r10r commented on July 1, 2024

Can't get it working on alpine, even with a minimal vimrc.

(NOTE for myself: buffer resource is builtin. See also https://github.com/neoclide/coc.nvim/wiki/Completion-with-sources#bundled-sources)

I've also tested it in a debian:latest container with the default vimrc and latest coc.nvim from the release branch but the buffer completion only completes from the active buffer.

c=$(buildah from debian:latest)
buildah run $c /bin/bash
apt-get update
apt-get install vim nodejs git
mkdir -p ~/.vim/pack/vendor/start
cd ~/.vim/pack/vendor/start
git clone https://github.com/neoclide/coc.nvim.git --branch release
cd
#
vim myscript.sh my.env

from coc.nvim.

r10r avatar r10r commented on July 1, 2024

Can't reproduce, the :CocList sources already has buffer source. Try minimal vimrc.

Did you try it yourself with a minimal vimrc and emtpy coc settings ?

from coc.nvim.

fannheyward avatar fannheyward commented on July 1, 2024

buffer completion only completes from the active buffer

Yes, this is expected, coc.nvim needs to active a buffer first before to use as completion source.

from coc.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.