1
0

A bunch of changes (mostly related to CoC)

This commit is contained in:
Nicolás A. Ortega Froysa
2023-03-08 10:16:48 +01:00
parent 5089f34f8b
commit e3f7ab23a3
5 changed files with 59 additions and 15 deletions

3
after/indent/c.vim Normal file
View File

@@ -0,0 +1,3 @@
setlocal shiftwidth=4
setlocal tabstop=4
setlocal noexpandtab

3
after/indent/mail.vim Normal file
View File

@@ -0,0 +1,3 @@
setlocal shiftwidth=2
setlocal tabstop=2
setlocal expandtab

View File

@@ -0,0 +1,3 @@
setlocal shiftwidth=2
setlocal tabstop=2
setlocal expandtab

3
after/indent/text.vim Normal file
View File

@@ -0,0 +1,3 @@
setlocal shiftwidth=2
setlocal tabstop=2
setlocal expandtab

View File

@@ -2,6 +2,7 @@ set nocompatible
filetype off filetype off
call plug#begin("~/.config/nvim/plugged") call plug#begin("~/.config/nvim/plugged")
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
Plug 'vim-scripts/DoxygenToolkit.vim'
Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdcommenter'
@@ -15,6 +16,7 @@ Plug 'ciaranm/detectindent'
Plug 'jiangmiao/auto-pairs' Plug 'jiangmiao/auto-pairs'
Plug 'antoyo/vim-licenses' Plug 'antoyo/vim-licenses'
Plug 'altercation/vim-colors-solarized' Plug 'altercation/vim-colors-solarized'
"Plug 'ervandew/supertab'
Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end() call plug#end()
filetype plugin indent on filetype plugin indent on
@@ -23,8 +25,8 @@ filetype plugin on
""" General """ General
" indentation " indentation
set tabstop=2 " tabs only count for 4 spaces set tabstop=4 " tabs only count for 4 spaces
set shiftwidth=2 " when indenting use 4 spaces set shiftwidth=4 " when indenting use 4 spaces
set noexpandtab " use tab characters set noexpandtab " use tab characters
set autoindent set autoindent
@@ -40,18 +42,43 @@ set nolist " disable line break on wrap
" folding " folding
set foldmethod=syntax set foldmethod=syntax
set foldlevel=0 "set foldlevel=0
set foldnestmax=1 "set foldnestmax=1
set clipboard+=unnamedplus
" CoC settings " CoC settings
"inoremap <silent><expr> <TAB> inoremap <silent><expr> <TAB>
"\ pumvisible() ? "\<C-n>" : \ coc#pum#visible() ? coc#pum#next(1) :
"\ <SID>check_back_space() ? "\<TAB>" : \ CheckBackspace() ? "\<Tab>" :
"\ coc#refresh() \ coc#refresh()
"inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
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>"
nmap <C-a> :CocAction<CR> 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 highlighting
syntax on syntax on
@@ -59,10 +86,15 @@ set background=dark
colorscheme solarized colorscheme solarized
""" Project-Specific Settings """ Project-Specific Settings
" Brigham projects
augroup AgTech set cino+=(0
au BufRead,BufEnter /home/nicolas/dev/C++/AgTech/* set expandtab tabstop=2 shiftwidth=2 set cino+=:0
augroup END set cino+=l1
set cino+=g0
set cino+=N-s
set cino+=E-s
set cino+=p2s
set cino+=t0
""" key remapping """ key remapping
" cursor navigation " cursor navigation