diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..b123ece --- /dev/null +++ b/.vimrc @@ -0,0 +1,81 @@ +set nocompatible +filetype on +filetype plugin on +filetype indent on + +set wrap +set showbreak=+++ +set showmatch + +set number relativenumber +set hidden + +set tabstop=2 softtabstop=2 +set shiftwidth=2 +set expandtab +set smartindent + +set noswapfile +set nobackup +set undodir=~/.vim/undodir +set undofile + +set hlsearch +set ignorecase +set smartcase + +set incsearch + +set termguicolors +set scrolloff=8 +set cursorline +set cursorcolumn +set splitright + +set spell +hi clear SpellBad + + +" Plugins +call plug#begin() + +" List your plugins here +Plug 'tpope/vim-sensible' +Plug 'honza/vim-snippets' +Plug 'morhetz/gruvbox' +Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'neoclide/coc-snippets' +Plug 'sheerun/vim-polyglot' +Plug 'fatih/vim-go' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' + +call plug#end() + +" Gruvbox +set background=dark +let g:gruvbox_contrast_dark='hard' + +augroup my_colours + autocmd! + autocmd ColorScheme gruvbox hi SpellBad cterm=underline ctermfg=grey +augroup END + +colorscheme gruvbox +" +function! CheckBackSpace() abort + let col = col('. ') - 1 + return !col || getline('. ')[col - 1] =~ '\s' +endfunction + +" coc vim config +inoremap + \ coc#pum#visible() ? coc#pum#next(1): + \ CheckBackSpace() ? "\" : + \ coc#refresh() +inoremap coc#pum#visible() && coc#pum#info()['index'] != -1 ? coc#pum#confirm() : + \ "\u\\=coc#on_enter()\" + +" Airline +let g:airline#extensions#tabline#enabled = 1 +