update init.vim

This commit is contained in:
Cynthia Foxwell 2022-07-17 10:32:37 -06:00
parent 4dbe327803
commit 65ac34fb09

View file

@ -19,7 +19,7 @@ Plug 'mg979/vim-visual-multi'
Plug 'rhysd/committia.vim'
Plug 'tpope/vim-sleuth'
Plug 'm-demare/hlargs.nvim'
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'nvim-treesitter/nvim-treesitter', { 'do': { -> TSUpdate } }
Plug 'windwp/nvim-ts-autotag'
" interface
@ -32,6 +32,7 @@ Plug 'nacro90/numb.nvim'
Plug 'xiyaowong/nvim-cursorword'
Plug 'kevinhwang91/nvim-hlslens'
Plug 'simrat39/symbols-outline.nvim'
Plug 'norcalli/nvim-colorizer.lua'
" language specific
Plug 'sheerun/vim-polyglot'
@ -39,7 +40,6 @@ Plug 'sheerun/vim-polyglot'
"Plug 'prettier/vim-prettier', {'build': 'pnpm i'}
Plug 'dense-analysis/ale'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/completion-nvim'
Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'hrsh7th/nvim-cmp'
@ -99,14 +99,9 @@ let g:ale_fixers = {
\}
let g:ale_fix_on_save = 1
let g:Hexokinase_highlighters = ['virtual']
set fillchars+=vert:▎
set completeopt=menuone,noinsert,noselect
set shortmess+=c
let g:completion_enable_auto_popup = 1
set completeopt=menu,menuone,noselect
lua << EOF
vim.cmd("highlight IndentBlanklineIndent1 ctermfg=11 cterm=nocombine")
@ -162,8 +157,6 @@ null_ls.setup(
)
EOF
set completeopt=menu,menuone,noselect
lua <<EOF
local cmp = require("cmp")
@ -177,20 +170,17 @@ local feedkey = function(key, mode)
end
local mapping = {
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({select = true}),
["<CR>"] = cmp.mapping.confirm({behavior = cmp.ConfirmBehavior.Insert, select = true}),
["<Tab>"] = cmp.mapping(function(fallback)
-- This little snippet will confirm with tab, and if no entry is selected, will confirm the first item
if cmp.visible() then
local entry = cmp.get_selected_entry()
if not entry then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
else
cmp.confirm()
end
if not entry then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
else
cmp.confirm()
end
else
fallback()
end
@ -208,11 +198,12 @@ cmp.setup(
mapping = cmp.mapping.preset.insert(mapping),
sources = cmp.config.sources(
{
{name = "nvim_lsp"},
{name = "nvim_lsp", priority = 1},
{name = "vsnip"},
},
{
{name = "buffer"},
{name = "path"},
}
),
}
@ -241,18 +232,15 @@ cmp.setup.cmdline(
)
local lspconfig = require("lspconfig")
local completion_callback = require("completion").on_attach
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
lspconfig.eslint.setup(
{
on_attach = completion_callback,
capabilities = capabilities,
}
)
lspconfig.tsserver.setup(
{
on_attach = completion_callback,
capabilities = capabilities,
}
)
@ -287,8 +275,6 @@ nnoremap <silent> <C-t> :SymbolsOutline<CR>
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>": "\<S-Tab>"
imap <tab> <Plug>(completion_smart_tab)
imap <s-tab> <Plug>(completion_smart_s_tab)
" barbar keys
" Move to previous/next