A bunch of changes (mostly related to CoC)
This commit is contained in:
62
init.vim
62
init.vim
@@ -2,6 +2,7 @@ set nocompatible
|
||||
filetype off
|
||||
call plug#begin("~/.config/nvim/plugged")
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'vim-scripts/DoxygenToolkit.vim'
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
Plug 'scrooloose/nerdcommenter'
|
||||
@@ -15,6 +16,7 @@ Plug 'ciaranm/detectindent'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'antoyo/vim-licenses'
|
||||
Plug 'altercation/vim-colors-solarized'
|
||||
"Plug 'ervandew/supertab'
|
||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
call plug#end()
|
||||
filetype plugin indent on
|
||||
@@ -23,8 +25,8 @@ filetype plugin on
|
||||
|
||||
""" General
|
||||
" indentation
|
||||
set tabstop=2 " tabs only count for 4 spaces
|
||||
set shiftwidth=2 " when indenting use 4 spaces
|
||||
set tabstop=4 " tabs only count for 4 spaces
|
||||
set shiftwidth=4 " when indenting use 4 spaces
|
||||
set noexpandtab " use tab characters
|
||||
set autoindent
|
||||
|
||||
@@ -40,18 +42,43 @@ set nolist " disable line break on wrap
|
||||
|
||||
" folding
|
||||
set foldmethod=syntax
|
||||
set foldlevel=0
|
||||
set foldnestmax=1
|
||||
"set foldlevel=0
|
||||
"set foldnestmax=1
|
||||
|
||||
set clipboard+=unnamedplus
|
||||
|
||||
" CoC settings
|
||||
"inoremap <silent><expr> <TAB>
|
||||
"\ pumvisible() ? "\<C-n>" :
|
||||
"\ <SID>check_back_space() ? "\<TAB>" :
|
||||
"\ coc#refresh()
|
||||
"inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ coc#pum#visible() ? coc#pum#next(1) :
|
||||
\ CheckBackspace() ? "\<Tab>" :
|
||||
\ coc#refresh()
|
||||
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||
"inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
"inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
nmap <C-a> :CocAction<CR>
|
||||
let g:coc_disable_startup_warning = 1
|
||||
|
||||
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||
|
||||
function! CheckBackspace() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
func! s:my_colors_setup() abort
|
||||
" this is an example
|
||||
hi CocFloating cterm=reverse ctermfg=251
|
||||
hi CocMenuSel cterm=reverse ctermfg=255
|
||||
endfunc
|
||||
|
||||
augroup colorscheme_coc_setup | au!
|
||||
au ColorScheme * call s:my_colors_setup()
|
||||
augroup END
|
||||
|
||||
" Use `[g` and `]g` to navigate diagnostics
|
||||
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
||||
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
||||
|
||||
" syntax highlighting
|
||||
syntax on
|
||||
@@ -59,10 +86,15 @@ set background=dark
|
||||
colorscheme solarized
|
||||
|
||||
""" Project-Specific Settings
|
||||
" Brigham projects
|
||||
augroup AgTech
|
||||
au BufRead,BufEnter /home/nicolas/dev/C++/AgTech/* set expandtab tabstop=2 shiftwidth=2
|
||||
augroup END
|
||||
|
||||
set cino+=(0
|
||||
set cino+=:0
|
||||
set cino+=l1
|
||||
set cino+=g0
|
||||
set cino+=N-s
|
||||
set cino+=E-s
|
||||
set cino+=p2s
|
||||
set cino+=t0
|
||||
|
||||
""" key remapping
|
||||
" cursor navigation
|
||||
|
||||
Reference in New Issue
Block a user