Skip to content

Instantly share code, notes, and snippets.

@BugLight
Created May 9, 2022 10:43
Show Gist options
  • Save BugLight/57463e02d0debc672d118cb6615f23b3 to your computer and use it in GitHub Desktop.
Save BugLight/57463e02d0debc672d118cb6615f23b3 to your computer and use it in GitHub Desktop.
My nvim config
set nocompatible
set ignorecase
set hlsearch
set incsearch
set tabstop=4
set softtabstop=4
set expandtab
set shiftwidth=4
set autoindent
set number
set wildmode=longest,list
set cc=80
filetype plugin indent on
syntax on
set clipboard=unnamedplus
filetype plugin on
set ttyfast
set shell=powershell
call plug#begin('~/AppData/Local/nvim/plugged')
Plug 'dracula/vim'
Plug 'preservim/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'ryanoasis/vim-devicons'
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
Plug 'feline-nvim/feline.nvim'
call plug#end()
colorscheme dracula
set completeopt=menu,menuone,noselect
set tgc
lua <<EOF
-- Setup nvim-cmp.
local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
['<C-y>'] = cmp.config.disable,
['<C-e>'] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
}, {
{ name = 'buffer' },
})
})
cmp.setup.cmdline('/', {
sources = {
{ name = 'buffer' }
}
})
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').update_capabilities(
vim.lsp.protocol.make_client_capabilities()
)
require('lspconfig')['cmake'].setup {
capabilities = capabilities,
init_options = {
buildDirectory = 'build'
}
}
require('lspconfig')['clangd'].setup {
capabilities = capabilities
}
-- Setup feline
require('feline').setup()
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment