diff --git a/nvim-init.vim b/nvim-init.vim index 460acf1..99ea046 100644 --- a/nvim-init.vim +++ b/nvim-init.vim @@ -7,27 +7,22 @@ let mapleader=';' " set syntax enable set mouse=a " enable mouse selection -set number " line numbers on the left side -set relativenumber " number+relativenumber = relative numbers for all but current line -set showcmd " show the commands while typing set splitright " open new splits on the right set splitbelow " open new splits below -set autoread " autoreload file on change set scrolloff=4 " keep the cursor 4 lines away from the top/bottom set ruler " show the lines/% bottomright -set encoding=utf-8 " set default encoding +set showcmd " show the commands while typing set laststatus=2 " always show the status line +set encoding=utf-8 " set default encoding +set autoread " autoreload file on change set conceallevel=0 " don't use conceals, seriously let g:tex_conceal='' " I said no conceals set shell=/bin/zsh " use zsh instead of bash -" use the nice `par` program wrap lines at 99 characters -set formatprg=par\ -w99 -set formatoptions=tcrqnlmj -set textwidth=99 - +set number " line numbers on the left side +set relativenumber " number+relativenumber = relative numbers for all but current line " toggle hybrid relative numbers when entering/leaving insert mode ":augroup numbertoggle ": autocmd! @@ -35,18 +30,15 @@ set textwidth=99 ": autocmd InsertEnter * set norelativenumber ":augroup END -" change cursor shape according to mode -:let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 +" use the nice `par` program to wrap lines at 99 characters +" TODO pass the current textwidth to par? +"set formatprg=par\ -w99 +set formatoptions=tcrqnlmj +set textwidth=99 set ignorecase smartcase " don't match case if typing in all-lowercase -" ignore motion for < > -nnoremap < << -nnoremap > >> -" make < > shifts keep selection -vnoremap < >gv - +" Ctrl+Backspace deletes previous word like in most text editors inoremap  dba " Switching buffers {{{2 @@ -62,6 +54,13 @@ set noexpandtab " tab key puts tabs " trailing whitespace looks like \cdot set list listchars=tab:¦\ ,trail:· " show indentation lines for tabs, trailing whitespace looks like \cdot +" Ignore motion for < > +nnoremap < << +nnoremap > >> +" Make < > shifts keep selection +vnoremap < >gv + " Folds {{{2 set foldlevelstart=3 " Not too much folding @@ -71,6 +70,9 @@ vnoremap zf " Misc {{{2 +" Change cursor shape according to mode +:let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 + " Escape from NeoVim terminals tnoremap " Just hit the [à0] button on an AZERTY, no need to do shift+à to for 0 @@ -118,10 +120,28 @@ nnoremap V :let spr=&sprset nosprvnewlet &spr=spr N :let spr=&sprset nosprnewlet &spr=spr " Cool arrows {{{2 -inoremap arse ↘ -inoremap arsw ↙ -inoremap arne ↗ -inoremap arnw ↖ +inoremap akl ↗ | inoremap alk ↗ +inoremap ajl ↘ | inoremap alj ↘ +inoremap ajh ↙ | inoremap ahj ↙ +inoremap akh ↖ | inoremap ahk ↖ +inoremap ajk ↕ | inoremap akj ↕ +inoremap ahl ↔ | inoremap alh ↔ + +inoremap dah ⇠ +inoremap daj ⇣ +inoremap dak ⇡ +inoremap dal ⇢ + +inoremap aahh ⇐ +inoremap aajj ⇓ +inoremap aakk ⇑ +inoremap aall ⇒ +inoremap aakl ⇗ | inoremap aalk ⇗ +inoremap aajl ⇘ | inoremap aalj ⇘ +inoremap aajh ⇙ | inoremap aahj ⇙ +inoremap aakh ⇖ | inoremap aahk ⇖ +inoremap aajk ⇕ | inoremap aakj ⇕ +inoremap aahl ⇔ | inoremap aalh ⇔ " Default visual block {{{2 nnoremap v @@ -229,7 +249,7 @@ let g:haskell_enable_static_pointers=1 " ----------- " Fuck PEP 8, tabs are better -let g:python_recommended_style = 0 +"let g:python_recommended_style = 0 " Rust {{{2 " ---------