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