Update nvim/init.vim

main
The_miro 2025-04-01 09:28:27 +02:00
parent 440de8fc5e
commit f76db807ec
1 changed files with 7 additions and 22 deletions

View File

@ -31,17 +31,8 @@ filetype plugin indent on
" Set shift width to 4 spaces.
set shiftwidth=4
" Set tab width to 4 columns.
set tabstop=4
" Use space characters instead of tabs.
set expandtab
" Do not save backup files.
set nobackup
" Do not let cursor scroll below or above N number of lines when scrolling.
set scrolloff=10
set scrolloff=5
" Do not wrap lines. Allow long lines to extend as far as the line goes.
set nowrap
@ -59,9 +50,6 @@ set smartcase
" Show partial command you type in the last line of the screen.
set showcmd
" Show the mode you are on the last line.
set showmode
" Show matching words during a search.
set showmatch
@ -119,17 +107,14 @@ imap <C-j> <Plug>(coc-snippets-expand-jump)
xmap <leader>x <Plug>(coc-convert-snippet)
" #####################################################
" <Tab>: completion
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-N>" :
\ s:check_back_space() ? "\<Tab>" :
\ coc#refresh()
" <S-Tab>: completion back
inoremap <silent><expr> <S-Tab> pumvisible() ? "\<C-P>" : "\<C-H>"
" <CR>: confirm completion, or insert <CR>
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
inoremap <expr> <Tab> coc#pum#visible() ? coc#pum#next(1) : "\<Tab>"
inoremap <expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(1) : "\<S-Tab>"
" <CR>: confirm completion, or insert <CR>
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>"