1
0
Files
nvim-config/init.vim

161 lines
4.3 KiB
VimL
Raw Normal View History

2021-08-11 19:09:19 +02:00
set nocompatible
filetype off
call plug#begin("~/.config/nvim/plugged")
Plug 'tpope/vim-fugitive'
Plug 'tkztmk/vim-vala'
Plug 'vim-scripts/DoxygenToolkit.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdcommenter'
Plug 'javier-lopez/sprunge.vim'
Plug 'vim-scripts/Trailer-Trash'
Plug 'vim-scripts/bad-whitespace'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
2024-06-11 10:28:07 +02:00
Plug 'junegunn/fzf.vim'
Plug 'aklt/plantuml-syntax'
2023-03-11 15:18:56 +01:00
Plug 'vim-scripts/scons.vim'
Plug 'danro/rename.vim'
Plug 'ciaranm/detectindent'
Plug 'jiangmiao/auto-pairs'
Plug 'antoyo/vim-licenses'
2025-03-31 15:02:09 +02:00
Plug 'flazz/vim-colorschemes'
2024-10-11 12:55:21 +02:00
Plug 'xiyaowong/transparent.nvim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
2021-08-11 19:09:19 +02:00
filetype plugin indent on
" to ignore plugin indent changes, instead use:
2022-09-02 15:46:48 +02:00
filetype plugin on
2021-08-11 19:09:19 +02:00
""" General
" indentation
set tabstop=4 " tabs only count for 4 spaces
set shiftwidth=4 " when indenting use 4 spaces
2024-06-04 11:05:37 +02:00
set expandtab " use tab characters
2021-08-11 19:09:19 +02:00
set autoindent
" view
set number
set showmatch " show matching bracket
set incsearch " search as characters are typed
set hlsearch " highlight found matches
set incsearch nohlsearch " turn off hightlight after search
set wrap
set linebreak
set nolist " disable line break on wrap
" folding
set foldmethod=syntax
"set foldlevel=0
"set foldnestmax=1
2025-11-07 13:54:40 +01:00
" Scrolloff
set scrolloff=7
" CoC settings
2025-11-13 08:10:14 +01:00
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
2025-11-13 08:10:14 +01:00
\ coc#expandableOrJumpable() ? "\<C-r>=coc#snippet#next()\<CR>" :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
2025-11-13 08:10:14 +01:00
inoremap <silent><expr> <S-TAB>
\ coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
\ coc#expandableOrJumpable() ? "\<C-r>=coc#snippet#prev()\<CR>" :
\ CheckBackspace() ? "\<S-Tab>" :
\ coc#refresh()
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>"
2025-11-13 08:10:14 +01:00
let g:coc_snippet_next = '<Tab>'
let g:coc_snippet_prev = '<S-Tab>'
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)
2024-05-22 17:24:50 +02:00
nmap <silent> ]f <Plug>(coc-fix-current)
2025-11-13 08:18:06 +01:00
" Symbol renaming
nmap <leader>rn <Plug>(coc-rename)
2025-11-13 08:20:10 +01:00
" GoTo code navigation
nmap <silent><nowait> gd <Plug>(coc-definition)
nmap <silent><nowait> gy <Plug>(coc-type-definition)
nmap <silent><nowait> gi <Plug>(coc-implementation)
nmap <silent><nowait> gr <Plug>(coc-references)
2021-08-11 19:09:19 +02:00
" syntax highlighting
syntax on
set background=dark
highlight Normal ctermbg=none
colorscheme solarized8_dark
2021-08-11 19:09:19 +02:00
""" Project-Specific Settings
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
2021-08-11 19:09:19 +02:00
""" key remapping
" cursor navigation
"nmap j gj
"nmap k gk
"vmap j gj
"vmap k gk
" tab navigation
nmap <S-J> :tabn<CR>
nmap <S-K> :tabp<CR>
2021-08-11 19:09:19 +02:00
" Rust
let g:rust_recommended_style = 0 " disable retarded option
""" plugin settings
" airline
let g:airline#extensions#tabline#enabled = 1 " enable tabline
2025-04-02 09:10:43 +02:00
let g:airline_theme='solarized_flood'
2021-08-11 19:09:19 +02:00
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
let g:airline_symbols.notexists = '∄'
let g:airline_symbols.spell = 'Ꞩ'
let g:airline_symbols.whitespace = 'Ξ'
let g:airline#extensions#whitespace#mixed_indent_algo = 2
let g:airline#extensions#whitespace#checks = [ 'indent', 'long']
" vim-licenses
2024-10-11 12:53:19 +02:00
let g:licenses_copyright_holders_name = 'Nicolás Ortega Froysa <nicolas@ortegas.org>'
let g:licenses_authors_name = 'Nicolás Ortega Froysa <nicolas@ortegas.org>'
2021-08-11 19:09:19 +02:00
let g:licenses_default_command = [ 'Affero' ]
2022-09-02 15:46:48 +02:00
" FZF
2025-10-19 10:33:10 +02:00
nnoremap <leader>f :GFiles<CR>
nnoremap <leader>F :tabnew<CR>:GFiles<CR>