DEV Community

Cover image for (Neo)vim for Web development

(Neo)vim for Web development

Ryan Lanciaux on October 03, 2019

I've recently been interested in using the tried-and-true vim editor again. For those unfamiliar, vim is an editor that was first released in 1991....
Collapse
 
matthewbdaly profile image
Matthew Daly • Edited

I ditched CtrlP for vim-fzf, on top of fzf and Ripgrep. They seem faster, produce better results, and handle interacting with source control better.

Most of my work is in PHP, and for that PHPactor has changed my life for the better. It provides the sort of refactoring tools that used to be solely the province of IDE's. It's one of the most useful Vim plugins I've ever seen.

Collapse
 
skydevht profile image
Holy-Elie Scaïde

vim-fzf is what works best for me. I tried Denite but it was too much configuration for things that works out of the box for vim-fzf. (File name search, in file search, buffer list,...)

Collapse
 
moopet profile image
Ben Sinclair

I just tried denite but can't get it to work at all.
I've spent the last few years ignoring fzf but I've just updated a few scripts to optionally use it if it's installed and have to say it makes things look better.

Thread Thread
 
skydevht profile image
Holy-Elie Scaïde

I had it working, but it felt a little off for me

Collapse
 
dmfay profile image
Dian Fay

I switched from ctrlp to denite a while back and love it. Here's the relevant part of my vimrc with ripgrep and some keybinds:

if executable('rg')
  call denite#custom#var('file_rec', 'command', ['rg', '--files', '--glob', '!.git'])
  call denite#custom#var('grep', 'command', ['rg'])
  call denite#custom#var('grep', 'recursive_opts', [])
  call denite#custom#var('grep', 'final_opts', [])
  call denite#custom#var('grep', 'separator', ['--'])
  call denite#custom#var('grep', 'default_opts', ['--vimgrep', '--no-heading', '--ignore-case'])
else
  call denite#custom#var('file_rec', 'command',
      \ ['grep', '--follow', '--nocolor', '--nogroup', '-g', ''])
endif

" allow grep source filtering on either path or text
call denite#custom#source('grep', 'converters', ['converter_abbr_word'])

call denite#custom#map('insert', '<C-h>', '<denite:move_to_first_line>', 'noremap')
call denite#custom#map('insert', '<C-j>', '<denite:move_to_next_line>', 'noremap')
call denite#custom#map('insert', '<C-k>', '<denite:move_to_previous_line>', 'noremap')
call denite#custom#map('insert', '<C-l>', '<denite:move_to_last_line>', 'noremap')

call denite#custom#option('default', 'prompt', '>')
call denite#custom#option('default', 'cursor_wrap', v:true)

nnoremap <C-p> :Denite -direction=topleft file_rec<CR>
nnoremap <space>/ :Denite -direction=topleft grep<CR>
nnoremap <space>f :Denite -direction=topleft -no-quit -mode=normal grep:.<CR>
nnoremap <space>s :Denite -direction=topleft buffer<CR>
Collapse
 
ryanlanciaux profile image
Ryan Lanciaux

Very cool and thanks for sharing this! I’ll have to checkout denite

Collapse
 
codenutt profile image
Jared

Made the switch completely about 6 months ago! Glad to see Conquer of Completion popping up more. That plugin is the BEST.

Collapse
 
ryanlanciaux profile image
Ryan Lanciaux

You're right! That plugin is so nicely made and really enhances my experience w/ vim :D

Collapse
 
nflamel profile image
Fran C.

Same here. Now that many more languages have their own Language Servers it is pretty easy to even configure one which doesn't have a CoC plugin. And the experience over traditional completion plugins or tags I sooooooo much better.

Collapse
 
mikaoelitiana profile image
Mika Andrianarijaona

You may also find interesting to try Vim Bootstrap that generates a configuration based on your target language vim-bootstrap.com/

Collapse
 
0ctavia profile image
Octa

Any reason why you picked neovim rather than the basic vim or gvim?