From d4d4db188695832f6b947f0683d6ad2088494c3e Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Sun, 29 Aug 2021 13:48:54 +0900 Subject: [PATCH] Add minimal vimrc --- utils/vimrc.vim | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 utils/vimrc.vim diff --git a/utils/vimrc.vim b/utils/vimrc.vim new file mode 100644 index 0000000..a83e71d --- /dev/null +++ b/utils/vimrc.vim @@ -0,0 +1,53 @@ +if has('vim_starting') + set encoding=utf-8 +endif +scriptencoding utf-8 + +if &compatible + set nocompatible +endif + +let s:plug_dir = expand('/tmp/plugged/vim-plug') +if !filereadable(s:plug_dir .. '/plug.vim') + execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir) +end + +execute 'set runtimepath+=' . s:plug_dir +call plug#begin(s:plug_dir) +Plug 'hrsh7th/nvim-cmp' +Plug 'hrsh7th/cmp-buffer' +Plug 'hrsh7th/cmp-nvim-lsp' +Plug 'hrsh7th/vim-vsnip' +Plug 'neovim/nvim-lspconfig' +call plug#end() +PlugInstall | quit + +" Setup global configuration. More on configuration below. +lua << EOF +local cmp = require "cmp" +cmp.setup { + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, + + mapping = { + [''] = cmp.mapping.confirm({ select = true }) + }, + + sources = { + { name = "nvim_lsp" }, + { name = "buffer" }, + }, +} +EOF + +lua << EOF +local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) + +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +EOF +