0

I installed

Plug 'neoclide/coc.nvim', {'branch': 'release'}

And now I seem to be able to use <C-n> and <C-p> to trigger autocomplete menu but it doesn't show up automatically as I type.

I tried adding

Plug 'vim-scripts/AutoComplPop'

but that does not seem to do anything.

My complete config is

set list
set listchars=tab:\\t

" For Vundle
set shell=/bin/bash
"set shell=bash

hi SpecialKey   guifg=#DD0000
hi SpecialKey   ctermfg=9

set nocompatible              " be iMproved, required
filetype off                  " required

" don't give message when an existing swap file is found.
set shortmess+=A

"https://stackoverflow.com/questions/1269689/to-disable-entering-ex-mode-in-vim
map Q <Nop>

" enforce soft tabs
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab

"grep -rl FactoryBot.create spec | xargs sed -i 's/FactoryBot.create/create/g'

"au! FileType ruby set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
"au! FileType rb set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
"au! FileType js set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
"au! FileType jsx set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
"au! FileType css set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
"au! FileType scss set tabstop=2 softtabstop=2 shiftwidth=2 expandtab

" no line numbers to conserve space
set nonu
set ruler
"set rulerformat=%l,%v
set rulerformat=%-14.(%l,%c%V%)\ %P

set termguicolors
let $NVIM_TUI_ENABLE_TRUE_COLOR=1

"faster update time for git gutter
set updatetime=100

" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged)
call plug#begin('~/.vim/plugged')



Plug 'neoclide/coc.nvim', {'branch': 'release'}

set signcolumn=yes


inoremap <silent><expr> <TAB>
      \ coc#pum#visible() ? coc#pum#next(1) :
      \ CheckBackspace() ? "\<Tab>" :
      \ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"

inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
                              \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"

nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

nnoremap <silent> K :call ShowDocumentation()<CR>

function! ShowDocumentation()
  if CocAction('hasProvider', 'hover')
    call CocActionAsync('doHover')
  else
    call feedkeys('K', 'in')
  endif
endfunction

Plug 'vim-scripts/AutoComplPop'


" vim in chrome / FF
"Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } }

" remove highlight when moving away from a highlight
Plug 'jesseleite/vim-noh'

" rip and tear through files at lightning speed
Plug 'jremmen/vim-ripgrep'
nnoremap ss :Rg 
nnoremap ss :Rg 

Plug 'hwartig/vim-seeing-is-believing'

" better python highlighting
"Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'}

" fast than vimgrep, similar syntax
" :Ack FactoryBot.create spec
"Plugin 'mileszs/ack.vim'

"if exists('g:started_by_firenvim')
"endif

" Make sure you use single quotes
"Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
"Plug 'ervandew/supertab'
"Plug 'elmcast/elm-vim'

"Plug 'yuezk/vim-js'
"Plug 'maxmellon/vim-jsx-pretty'

"Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] }
"Plug 'mxw/vim-jsx', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'sheerun/vim-polyglot'

"Plug 'camspiers/lens.vim'
Plug '[email protected]:habamax/lens.vim.git', { 'as': 'camspiers-habamax', 'branch': 'fix-resize' }

"Plug 'dkprice/vim-easygrep'
Plug 'wincent/ferret'


let g:lens#width_resize_max = 100
let g:lens#width_resize_min = 10
let g:lens#animate = 0

Plug 'rust-lang/rust.vim'
let g:rust_recommended_style = 0

Plug 'voldikss/vim-floaterm'
"let g:floaterm_keymap_new    = '<F7>'
"let g:floaterm_keymap_prev   = '<F8>'
"let g:floaterm_keymap_next   = '<F9>'
let g:floaterm_keymap_toggle = '<Caps>'
let g:floaterm_position = 'center'
let g:floaterm_width = 0.9
let g:floaterm_height = 0.9

Plug 'cespare/vim-toml'
Plug 'jceb/vim-orgmode'
Plug 'airblade/vim-gitgutter'
"Plug 'gabrielelana/vim-markdown' "nice syntax, slow spell checker
Plug 'yegappan/mru'
"Plug 'SirVer/ultisnips'
"Plug 'honza/vim-snippets'
"Plug 'ternjs/tern_for_vim', { 'for': ['javascript', 'javascript.jsx'] }
"Plug 'carlitux/deoplete-ternjs', { 'for': ['javascript', 'javascript.jsx'] }
"Plug 'othree/jspc.vim', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'prakashdanish/vim-githubinator'
Plug 'Konfekt/vim-scratchpad'
Plug 'tpope/vim-fugitive'

Plug 'Wolfy87/vim-syntax-expand'
Plug 'keith/rspec.vim'

"Plug 'TaDaa/vimade'

"
Plug 'vimwiki/vimwiki'
" TODO set subdirectory based on current project directory
" this could be done when a new file is opened(?) or on a load
let g:vimwiki_list = [{'path': '~/wiki/hs-tasks'}]
"let g:vimwiki_folding = 'expr'

" Set specific linters
let g:ale_linters = {
\   'javascript': ['eslint'],
\   'ruby': ['rubocop'],
\   'python': ['pylint'] 
\}
"let g:airline#extensions#ale#enabled = 1 
"Plug 'vim-airline/vim-airline-themes'

let g:ale_fixers = {
\   'ruby': ['rubocop', 'trim_whitespace'],
\}

if exists('g:started_by_firenvim')
else
  " Linting / rubocop
  Plug 'w0rp/ale'
  Plug 'vim-airline/vim-airline' 

  let g:airline#extensions#ale#enabled = 1 
  Plug 'vim-airline/vim-airline-themes'
  "set laststatus=2

  let g:airline_section_a = ''
  let g:airline_section_b = ''

  let g:airline_section_x = ''
  let g:airline_section_y = ''
  "let g:airline_section_z = ''
  "let g:airline_section_z = '%3p%% %3l/%L:%3v'
  let g:airline_section_z = '%l:%v'

  let g:airline_theme='hybrid'
endif

" Use release branch (Recommend)
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"inoremap <silent><expr> <TAB>
      "\ pumvisible() ? "\<C-n>" :
      "\ <SID>check_back_space() ? "\<TAB>" :
      "\ coc#refresh()
"inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"

"function! s:check_back_space() abort
  "let col = col('.') - 1
  "return !col || getline('.')[col - 1]  =~# '\s'
"endfunction

inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"

function! s:check_back_space() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction

Plug 'scrooloose/nerdcommenter'
nmap // <leader>c<space>
vmap // <leader>c<space><cr>gv

nnoremap qq :q!<cr>
nnoremap qqa :qa!<cr>


nnoremap ffs :<C-f>/

"nnoremap <leader>ppj :%!python -m json.tool<CR>
"nnoremap <leader>ppj :%!python -c "import json, sys, collections; print json.dumps(json.load(sys.stdin, object_pairs_hook=collections.OrderedDict), indent=2)"<CR>
nnoremap <leader>ppj :%!python -c "import json, sys, collections; print json.dumps(json.load(sys.stdin), indent=2)"<CR>
vnoremap <leader>ppj :%!python -c "import json, sys, collections; print json.dumps(json.load(sys.stdin), indent=2)"<CR>

Plug 'sbdchd/neoformat'
nnoremap <leader>f :Neoformat! html<cr>


Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'

" https://github.com/junegunn/fzf.vim/issues/439
"Plug 'junegunn/fzf', { 'dir': '/home/linuxbrew/.linuxbrew/bin' }
"Plug 'junegunn/fzf.vim'

let g:fzf_command_prefix = 'Fzf'

nnoremap <C-p> :FzfGFiles<CR>

" should help with slow Fzf cancel
if has('nvim')
  aug fzf_setup
    au!
    au TermOpen term://*FZF tnoremap <silent> <buffer><nowait> <esc> <c-c>
  aug END
end



" Initialize plugin system
call plug#end()

let g:deoplete#enable_at_startup = 1

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Plugin 'slim-template/vim-slim.git'

" Plugin 'ntpeters/vim-better-whitespace'
Plugin 'scrooloose/nerdtree'
Plugin 'vim-ruby/vim-ruby'
"let strip_whitespace_on_save = 1

Plugin 'kchmck/vim-coffee-script'

" loks nice, has bright theme but does not work
"Plugin 'sonph/onehalf', {'rtp': 'vim/'}

"Plugin 'hakunin/StripWhiteSpaces'

"Plugin 'vim-scripts/ctrlp.vim'

" Matcher needs to be built :/
" ideally I want something that works out of the box
"Plugin 'JazzCore/ctrlp-cmatcher'
"let g:ctrlp_match_func = {'match' : 'matcher#cmatch' }



"Plugin 'syntastic'
"Plugin 'vim-wakatime'

" Didn't work well after reinstall on Fedora
"Plugin 'pangloss/vim-javascript'
"Plugin 'mxw/vim-jsx'

let g:jsx_ext_required = 0
"Plugin 'elixir-lang/vim-elixir'

"Plugin 'floobits/floobits-neovim'

"Plugin 'kana/vim-submode'
"https://vi.stackexchange.com/questions/3728/how-can-i-work-with-splits-in-vim-without-ctrl-w
"does not seem to work with neovim
"call submode#enter_with('WindowsMode', 'n', '', '<Leader>k', ':echo "windows mode"<CR>')
"call submode#leave_with('WindowsMode', 'n', '', '<Leader>')

" Change of windows with hjkl
"call submode#map('WindowsMode', 'n', '', 'j', '<C-w>j')
"call submode#map('WindowsMode', 'n', '', 'k', '<C-w>k')
"call submode#map('WindowsMode', 'n', '', 'h', '<C-w>h')
"call submode#map('WindowsMode', 'n', '', 'l', '<C-w>l')

" split windows with / and !
"call submode#map('WindowsMode', 'n', '', '"', '<C-w>s')
"call submode#map('WindowsMode', 'n', '', '%', '<C-w>v')

"call submode#map('WindowsMode', 'n', '', 'q', '<C-w>c')
"call submode#map('WindowsMode', 'n', '', '<C-j>', '<C-w>J')
"call submode#map('WindowsMode', 'n', '', '<C-k>', '<C-w>K')
"call submode#map('WindowsMode', 'n', '', '<C-h>', '<C-w>H')
"call submode#map('WindowsMode', 'n', '', '<C-l>', '<C-w>L')


"Plugin 'rust-lang/rust.vim'

"Plugin 'Valloric/YouCompleteMe'
"let g:ycm_min_num_of_chars_for_completion = 1
"

"Plugin 'vim-scripts/vim-auto-save'
"let g:auto_save = 1  " enable AutoSave on Vim startup

set undodir=~/.vim/undodir
set undofile
set undolevels=5000
set undoreload=10000

" viminfo stores the the state of your previous editing session
"set viminfo+=n~/.vim/viminfo
"set viminfo+=n~/.vim/viminfo

if exists("+undofile")
  " undofile - This allows you to use undos after exiting and restarting
  " This, like swap and backup files, uses .vim-undo first, then ~/.vim/undo
  " :help undo-persistence
  " This is only present in 7.3+
  if isdirectory('~/.vim/undo') == 0
    :silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
  endif
  set undodir=./.vim-undo//
  set undodir+=~/.vim/undo//
  set undofile
endif

"set directory=~/.vim/swapfiles//

" Save your backup files to a less annoying place than the current directory.
" If you have .vim-backup in the current directory, it'll use that.
" Otherwise it saves it to ~/.vim/backup or .
if isdirectory($HOME . '/.vim/backup') == 0
  :silent !mkdir -p ~/.vim/backup >/dev/null 2>&1
endif
set backupdir-=.
set backupdir+=.
set backupdir-=~/
set backupdir^=~/.vim/backup/
set backupdir^=./.vim-backup/
set backup

" Save your swap files to a less annoying place than the current directory.
" If you have .vim-swap in the current directory, it'll use that.
" Otherwise it saves it to ~/.vim/swap, ~/tmp or .
if isdirectory($HOME . '/.vim/swap') == 0
  :silent !mkdir -p ~/.vim/swap >/dev/null 2>&1
endif
set directory=./.vim-swap//
set directory+=~/.vim/swap//
set directory+=~/tmp//
set directory+=.

syntax on

"au BufRead,BufNewFile *.tr set filetype=rust
au BufRead,BufNewFile *.thor set filetype=ruby
au BufRead,BufNewFile Gemfile.local set filetype=ruby

" uses old regex engine that is faster with ruby files
" http://stackoverflow.com/questions/16902317/vim-slow-with-ruby-syntax-highlighting
"set re=1

" this could improve vim speed overall
set ttyfast
set lazyredraw

" automaticaly reload files when they're changed without asking
"set autoread

let g:vimrubocop_config = '~/.vim/rubocop.yml'

set packpath^=~/.vim
set runtimepath^=~/.vim
execute pathogen#infect()
"filetype plugin indent on


"for ctrlP
"set runtimepath^=~/.vim/bundle/ctrlp.vim
"let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
"let g:ctrlp_user_command = ['.git/', 'git --work-tree=%s ls-files -oc --exclude-standard']
"let g:ctrlp_working_path_mode = 'ra'
" 'r' stands for `go down until you hit .git`
"let g:ctrlp_working_path_mode = 'a'

"let g:ctrlp_custom_ignore = {
  "\ 'dir': 'node_modules\|DS_Store\|.git\|tmp'
  "\ }

"*'g:ctrlp_switch_buffer'*
"When opening a file, if it's already open in a window somewhere, CtrlP will try
"to jump to it instead of opening a new instance: >
"  let g:ctrlp_switch_buffer = 'Et'
"<
"  e - jump when <cr> is pressed, but only to windows in the current tab.
"  t - jump when <c-t> is pressed, but only to windows in another tab.
"  v - like "e", but jump when <c-v> is pressed.
"  h - like "e", but jump when <c-x> is pressed.
"  E, T, V, H - like "e", "t", "v", and "h", but jump to windows anywhere.
"  0 or <empty> - disable this feature.

"When opening a file with <cr>, CtrlP avoids opening it in windows created by
"plugins, help and quickfix. Use this to setup some exceptions: >
"let g:ctrlp_reuse_window = 'nerdtree'


" https://github.com/kien/ctrlp.vim/issues/305
" CtrlP auto cache clearing.
" ----------------------------------------------------------------------------
"function! SetupCtrlP()
  "if exists("g:loaded_ctrlp") && g:loaded_ctrlp
    "augroup CtrlPExtension
      "autocmd!
      "autocmd FocusGained  * CtrlPClearCache
      "autocmd BufWritePost * CtrlPClearCache
    "augroup END
  "endif
"endfunction
"if has("autocmd")
  "autocmd VimEnter * :call SetupCtrlP()
"endif

set wildignore+=node_modules/**
set wildignore+=tmp/cache/**
set wildignore+=**/coverage/**
set wildignore+=**/test*xml


"set nobackup
"set nowritebackup
"set noswapfile

set guioptions-=m  "remove menu bar
set guioptions-=T  "remove toolbar

map <C-k> <C-w><Up>
map <C-j> <C-w><Down>
map <C-l> <C-w><Right>
map <C-h> <C-w><Left>

nnoremap K <C-w><Up>
nnoremap J <C-w><Down>
nnoremap L <C-w><Right>
nnoremap H <C-w><Left>

"nnoremap H gT
"nnoremap L gt

nnoremap <S-PageUp> gT
nnoremap <S-PageDown> gt

"map <C-k> :MRU <CR>
nnoremap <leader>p :MRU<CR>
nnoremap <leader>r :%s/\.rb.*/.rb/<CR>:%sort u<CR>:noh<CR>
nnoremap <leader>g :%g/.*gems.*/d<CR>
imap jw <Esc>

nnoremap <silent> <C-S> :<C-u>w<CR>
inoremap <c-s> <Esc>:w<CR>

"tnoremap <Esc> <C-\><C-n>

" Help FZF register escape
if has("nvim")
  au TermOpen * tnoremap <Esc> <c-\><c-n>
  au FileType fzf tunmap <Esc>
  "au FileType fzf tunmap <Esc> <Esc>:q<CR>
endif

tnoremap <C-w>h <C-\><C-n><C-w>h
tnoremap <C-w>j <C-\><C-n><C-w>j
tnoremap <C-w>k <C-\><C-n><C-w>k
tnoremap <C-w>l <C-\><C-n><C-w>l

"map <C-n> <C-w><
"map <C-m> <C-w>>

"map <C-Up> <c-w>+
"map <C-Down> <c-w>-


" select all + yank
"map <C-a> ggVGy
"map <D-a> ggVGy

"set clipboard=unnamed
"this means the yank should copy into system clipboard
" use the clipboards of vim and win
set clipboard+=unnamed
set clipboard+=unnamedplus
set paste               " Paste from a windows or from vim
"set go+=a               " Visual selection automatically copied to the clipboard

" using tabs
map <C-t> :tabedit .<CR>
map <C-S-[> gT
map <C-S-]> gt

set pastetoggle=<F2>
"set paste

noremap Y y$
nnoremap ; :
nnoremap : ;

nnoremap <expr> gp    "`[".getregtype(v:register)[0]."`]"

nmap <Leader>ha <Plug>(GitGutterStageHunk)
nmap <Leader>hu <Plug>(GitGutterUndoHunk)

" relative path  (src/foo.txt)
nnoremap <leader>tr :let @*="rspec " . expand("%")<CR>
nnoremap <leader>ty :let @*="yarn test " . expand("%")<CR>
nnoremap <leader>cf :let @*=expand("%")<CR>

" absolute path  (/something/src/foo.txt)
nnoremap <leader>cF :let @*=expand("%:p")<CR>

" filename       (foo.txt)
nnoremap <leader>ct :let @*=expand("%:t")<CR>

" directory name (/something/src)
nnoremap <leader>ch :let @*=expand("%:p:h")<CR><Paste>

nnoremap P p`[v`]

" clean yarn test results
nnoremap <leader>aa :%s/^FAIL/ FAIL/<CR>:%g!/^ FAIL.*/d<CR>:%g/^\s*$/d<CR>:%s/^ FAIL */yarn test /<CR>:noh<CR>:sort u<CR>

set guioptions-=e "no gui tabs
set guioptions-=l
set guioptions-=r
set guioptions-=b
set guioptions-=L
"set go-=Lr

set display=lastline

"set dy+=lastline
"set nu
set cursorline

set sta




set ai
set si
set pi
set is


set guifont=monaco:h12

colorscheme sunburst

"highlight OverLength ctermbg=red ctermfg=white guibg=#592929
"highlight OverLength ctermbg=red ctermfg=white guibg=#300000
"match OverLength /\%81v.\+/

"augroup vimrc_autocmds
  autocmd BufEnter *.js* highlight OverLength ctermbg=darkgrey
  autocmd BufEnter *.js* match OverLength /\%80v.*/
  autocmd WinEnter *.js* highlight OverLength ctermbg=darkgrey
  autocmd WinEnter *.js* match OverLength /\%80v.*/

  autocmd BufEnter *.rb highlight OverLength ctermbg=darkgrey
  autocmd BufEnter *.rb match OverLength /\%80v.*/
  autocmd WinEnter *.rb highlight OverLength ctermbg=darkgrey
  autocmd WinEnter *.rb match OverLength /\%80v.*/

  "autocmd BufWinEnter * highlight OverLength ctermbg=darkgrey guibg=#300000
  "autocmd BufWinEnter * match OverLength /\%80v.*/
  "autocmd BufRead * highlight OverLength ctermbg=darkgrey guibg=#300000
  "autocmd BufRead * match OverLength /\%80v.*/
  "autocmd BufAdd * highlight OverLength ctermbg=darkgrey guibg=#300000
  "autocmd BufAdd * match OverLength /\%80v.*/
  "autocmd BufNewFile * highlight OverLength ctermbg=darkgrey guibg=#300000
  "autocmd BufNewFile * match OverLength /\%80v.*/
"augroup END

"set colorcolumn=81


" Vim starts in normal mode
hi CursorLine guifg=NONE guibg=#0d0d0d gui=NONE cterm=none ctermbg=17
hi CursorLine guifg=NONE guibg=#0E0E0D gui=NONE cterm=none ctermbg=17

" Change Color when entering Insert Mode
autocmd InsertEnter * hi CursorLine guifg=NONE guibg=#0d0d0d gui=NONE cterm=none ctermbg=233

" Revert Color to default when leaving Insert Mode
autocmd InsertLeave * hi CursorLine guifg=NONE guibg=#0d0d0d gui=NONE cterm=none ctermbg=17

" Resize panes when window is resized
autocmd VimResized * wincmd =



"function! AddFrozenStringHeader()
  "if getline(1) !~ "frozen_string_literal"
    "call append(0, '# frozen_string_literal: true')
    ""call setline(1, '# frozen_string_literal: true')
  "endif
"endfun


"autocmd BufNewFile *.rb call AddFrozenStringHeader()
"autocmd BufWritePre *.rb call AddFrozenStringHeader()

" https://vi.stackexchange.com/questions/5949/substitute-with-pure-vimscript-without-s
"function! AddSpaceBeforeEqualInWholeBuffer()
"    let l = 1
"    for line in getline(1,"$")
"        call setline(l, substitute(line, '\([^= ]\)=', '\1 =', "g"))
"        let l = l + 1
"    endfor
"endfunction

"fun! autoHEADER#update_modified_time()
"    let cursor_pos = getpos('.')
"    silent! exe "1,10s/\\(Last Modified\\s\\+:\\s\\+\\)\\[[^\\]]\\+\\]/\\1[" . strftime("%Y-%m-%d %H:%M") . "]/" 
"    call setpos('.',cursor_pos)
"endfun


"au BufEnter * setlocal cursorline
"au BufLeave * setlocal nocursorline

augroup CursorLine
  au!
  au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
  au WinLeave * setlocal nocursorline
augroup END



"set foldmethod=syntax
"set foldnestmax=2
"set foldlevelstart=1




set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
set statusline+=%=
set statusline+=%l    " Current line
set statusline+=:    " Separator
set statusline+=%c    " Column

" Use Neomake instead of syntastic

"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_loc_list_height = 5
"let g:syntastic_auto_loc_list = 0
"let g:syntastic_check_on_open = 0
"let g:syntastic_check_on_wq = 1
"let g:syntastic_check_on_w = 1
"let g:syntastic_javascript_checkers = ['eslint']
"let g:syntastic_ruby_checkers = ['mri']
""let g:syntastic_ruby_rubocop_exec = 'rubocop'
""let g:syntastic_ruby_rubylint_exec = 'ruby-lint'
"let g:syntastic_quiet_messages = {}

let g:syntastic_error_symbol = '❗'
let g:syntastic_style_error_symbol = '❗'
let g:syntastic_warning_symbol = '❗'
let g:syntastic_style_warning_symbol = '❗'

"let g:syntastic_error_symbol = '!'
"let g:syntastic_style_error_symbol = '!'
"let g:syntastic_warning_symbol = '!'
"let g:syntastic_style_warning_symbol = '!'

"let g:PyLintDissabledMessages = ""
"'C0103,C0111,C0301,W0141,W0142,W0212,W0221,W0223,W0232,W0401,W0613,W0631,E1101,E1120,R0903,R0904,R0913'

"let g:javascript_conceal_this = "@"
"set conceallevel=1

highlight link SyntasticErrorSign SignColumn
highlight link SyntasticWarningSign SignColumn
highlight link SyntasticStyleErrorSign SignColumn
highlight link SyntasticStyleWarningSign SignColumn

"autocmd FileType javascript inoremap <silent> <buffer> @ <C-r>=syntax_expand#expand("@", "this")<CR>
autocmd FileType javascript inoremap <silent> <buffer> clog <C-r>=syntax_expand#expand("clog", "console.log()")<CR><Left>
autocmd FileType javascript inoremap <silent> <buffer> cnam <C-r>=syntax_expand#expand("cnam", "className=\"\"")<CR><Left>
"autocmd FileType javascript inoremap <silent> <buffer> < <C-r>=syntax_expand#expand_head("<", "return")<CR>

"autocmd BufNewFile,BufRead *.slim setlocal filetype=slim
autocmd BufNewFile,BufRead,BufWinEnter *.slim setlocal syntax=slim

" load local .vimrc from project directory
set exrc

" Hide one or two two-space indents
"syntax match HideTwoIndents /\v^  (  )?/ conceal

" (Optional) Hide regardless of cursor position
"set concealcursor=nvic

" Hide concealed matches without replacement chars completely
"set conceallevel=2

if exists('g:started_by_firenvim')
  au BufEnter github.com_*.txt set filetype=markdown
  au BufEnter tasks.hubstaff.com_*.txt set filetype=markdown
  set guifont=10
else
  "set laststatus=2
endif


autocmd FileType python setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab

" do not jump to first search
set noincsearch
set hlsearch


" Enable seeing-is-believing mappings only for Ruby
augroup seeingIsBelievingSettings
  autocmd!

  autocmd FileType ruby nmap <buffer> <Enter> <Plug>(seeing-is-believing-mark-and-run)
  autocmd FileType ruby xmap <buffer> <Enter> <Plug>(seeing-is-believing-mark-and-run)

  autocmd FileType ruby nmap <buffer> <F4> <Plug>(seeing-is-believing-mark)
  autocmd FileType ruby xmap <buffer> <F4> <Plug>(seeing-is-believing-mark)
  autocmd FileType ruby imap <buffer> <F4> <Plug>(seeing-is-believing-mark)

  autocmd FileType ruby nmap <buffer> <F5> <Plug>(seeing-is-believing-run)
  autocmd FileType ruby imap <buffer> <F5> <Plug>(seeing-is-believing-run)
augroup END

:CocInfo result:


## versions

vim version: NVIM v0.8.2
node version: v16.15.1
coc.nvim version: 0.0.81-bacd91d7 2022-06-03 10:34:52 +0800
coc.nvim directory: /home/michal/.vim/plugged/coc.nvim
term: tmux
platform: linux

## Log of coc.nvim

2023-03-01T21:54:39.461 INFO (pid:1218280) [plugin] - coc.nvim initialized with node: v16.15.1 after 81ms
2023-03-01T21:54:44.898 INFO (pid:1218280) [services] - registered service "solargraph"
2023-03-01T21:54:45.293 INFO (pid:1218280) [extension:coc-solargraph] - Solargraph is listening PORT=45811 PID=1218391

2023-03-01T22:28:06.937 INFO (pid:1218280) [attach] - receive notification: checkJsonExtension []
2023-03-01T22:28:06.966 INFO (pid:1218280) [services] - registered service "json"
2023-03-01T22:28:06.967 INFO (pid:1218280) [services] - Json language server state change: stopped => starting
2023-03-01T22:28:07.039 INFO (pid:1218280) [services] - Json language server state change: starting => running
2023-03-01T22:28:07.042 INFO (pid:1218280) [services] - service json started
2023-03-01T22:28:12.336 INFO (pid:1218280) [attach] - receive notification: showInfo []

1 Answer 1

1

The automatic completion menu on typing is a standard feature of Coc.

But it seems that on Neovim it is not compatible with the :set paste option.

I propose you comment the following option:

set paste

As @Ben point out when paste is set the keyboard input it taken literally by Vim and Coc way to detect keyboard input (TextChangedP) is deactivated.

12
  • 1
    However I was hoping it would automatically pop up like in any basic IDE.
    – hakunin
    Mar 1 at 20:50
  • 1
    Added CocInfo result
    – hakunin
    Mar 1 at 21:28
  • 1
    Your vimrc is rather large :-) Could you try to reduce it to a minimum vimrc that reproduce the problem? Mar 2 at 7:49
  • 1
    I can't reproduce your problem. The init.vim contains a number # that trigger errors. I feel I need your help to simplify the init.vim :-| Mar 2 at 8:18
  • 1
    After a long binary search it seems that set paste make it failing on Neovim. Mar 2 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.