summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Iannetta <paul.iannetta@ens-lyon.fr>2022-04-13 19:07:07 +0200
committerPaul Iannetta <paul.iannetta@ens-lyon.fr>2022-04-13 19:07:07 +0200
commit04f701896a31a76de4477f91e445747f8c589979 (patch)
treea68edf5e2c1dc0fa196dc3d3a8c5c7aeaa7a2e78
parent4794538a95f4af84b812e69d3061a8988b402d6f (diff)
update vim config
-rwxr-xr-x[-rw-r--r--].config/nvim/after/ftplugin/tex.vim2
-rwxr-xr-x.config/nvim/init.vim144
2 files changed, 128 insertions, 18 deletions
diff --git a/.config/nvim/after/ftplugin/tex.vim b/.config/nvim/after/ftplugin/tex.vim
index 9bd25f8..858963b 100644..100755
--- a/.config/nvim/after/ftplugin/tex.vim
+++ b/.config/nvim/after/ftplugin/tex.vim
@@ -6,6 +6,8 @@ autocmd! numbertoggle
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
+vnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
+vnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
nnoremap <F8> :Make!<cr>
nnoremap yog :Goyo<cr>
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 755b8c9..421a5b4 100755
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -1,25 +1,24 @@
set nocompatible
" Scripts-----------------------------
" Required:
-set runtimepath+=/home/paul/.local/share/dein/repos/github.com/Shougo/dein.vim
+set runtimepath+=/home/lys/.local/share/dein/repos/github.com/Shougo/dein.vim
" Required:
-if dein#load_state('/home/paul/.local/share/dein')
- call dein#begin('/home/paul/.local/share/dein')
+if dein#load_state('/home/lys/.local/share/dein')
+ call dein#begin('/home/lys/.local/share/dein')
" Let dein manage dein
" Required:
- call dein#add('/home/paul/.local/share/dein/repos/github.com/Shougo/dein.vim')
+ call dein#add('/home/lys/.local/share/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here:
" After removing a plugin you should call:
" call map(dein#check_clean(), "delete(v:val, 'rf')")
" call dein#recache_runtimepath()
- call dein#add('Shougo/neosnippet.vim')
- call dein#add('Shougo/neosnippet-snippets')
call dein#add('Shougo/denite.nvim')
- call dein#add('Shougo/defx.nvim')
+
+ call dein#add('SirVer/ultisnips')
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
@@ -30,12 +29,17 @@ if dein#load_state('/home/paul/.local/share/dein')
call dein#add('tpope/vim-abolish')
call dein#add('tpope/vim-unimpaired')
call dein#add('tpope/vim-dispatch')
+ call dein#add('tpope/vim-markdown')
call dein#add('machakann/vim-sandwich')
call dein#add('AndrewRadev/splitjoin.vim')
call dein#add('wellle/targets.vim')
+ call dein#add('luochen1990/rainbow')
call dein#add('justinmk/vim-sneak')
+ call dein#add('prabirshrestha/async.vim')
+ call dein#add('prabirshrestha/vim-lsp')
+ call dein#add('jpalardy/vim-slime')
call dein#add('dpelle/vim-LanguageTool')
call dein#add('lervag/vimtex')
@@ -64,6 +68,8 @@ syntax enable
"End dein Scripts-------------------------
+" General settings
+"""""""""""""""""""
set number relativenumber
augroup numbertoggle
autocmd!
@@ -79,30 +85,48 @@ set t_Co=256
colorscheme PaperColor
set laststatus=2
set wildoptions=
-
-let g:airline#extensions#tabline#enabled = 1
-let g:airline_powerline_fonts = 1
-let g:airline_extensions = ['coc', 'tabline']
-
-let g:tex_fold_enabled = 1
+set foldlevel=99
set list
set showbreak=↪\
set listchars=tab:→\ ,nbsp:␣,trail:•,extends:⟩,precedes:⟨
set fillchars=fold:\
+" my leader my space
+noremap <Space> <nop>
+vnoremap <Space> <nop>
+map <Space> <Leader>
+
+" Spelling Settings
+"""""""""""""""""""
map <silent> <F5> "<Esc>:silent setlocal spell! spelllang=en<CR>"
map <silent> <F6> "<Esc>:silent setlocal spell! spelllang=fr<CR>"
hi clear SpellBad
hi SpellBad cterm=underline
-let g:languagetool_jar = "/home/paul/.local/repos/languagetool/languagetool-standalone/target/LanguageTool-4.6-SNAPSHOT/LanguageTool-4.6-SNAPSHOT/languagetool-commandline.jar"
+let g:languagetool_jar = "/home/lys/.local/repos/languagetool/languagetool-standalone/target/LanguageTool-4.6-SNAPSHOT/LanguageTool-4.6-SNAPSHOT/languagetool-commandline.jar"
+" Airline
+"""""""""
+let g:airline#extensions#tabline#enabled = 1
+let g:airline_powerline_fonts = 1
+let g:airline_extensions = ['coc', 'tabline']
+
+" vimtex
+""""""""
let g:tex_flavor = "latex"
+" let g:tex_fold_enabled = 1
+" let g:vimtex_text_obj_variant="vimtex"
+
+" goyo
+""""""
let g:goyo_width = "80"
let g:goyo_height = "95%"
+" Denite
+"""""""""
+
" Define mappings
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
@@ -120,16 +144,17 @@ function! s:denite_my_settings() abort
\ denite#do_map('toggle_select').'j'
endfunction
-noremap <Space> <nop>
-vnoremap <Space> <nop>
-map <Space> <Leader>
+" Easy Align
+"""""""""""""
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
vmap <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
+" Vimsneak remapping
+"""""""""""""""""
" 2-character Sneak (default)
nmap <tab> <Plug>Sneak_s
nmap <s-tab> <Plug>Sneak_S
@@ -139,6 +164,89 @@ xmap <s-tab> <Plug>Sneak_S
" operator-pending-mode
omap <tab> <Plug>Sneak_s
omap <s-tab> <Plug>Sneak_S
-
+" repeat motion (enforced)
+nmap ;; <Plug>Sneak_;
+omap ;; <Plug>Sneak_;
+xmap ;; <Plug>Sneak_;
nnoremap ;i <c-i>
nnoremap ;o <c-o>
+
+
+" lsp configuration
+"""""""""""""""""""
+if executable('clangd')
+ au User lsp_setup call lsp#register_server({
+ \ 'name': 'clangd',
+ \ 'cmd': {server_info->['clangd', '-background-index']},
+ \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
+ \ })
+endif
+
+" \ 'workspace_config': {'rust': {'clippy_preference': 'off'}},
+if executable('rls')
+ au User lsp_setup call lsp#register_server({
+ \ 'name': 'rls',
+ \ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']},
+ \ 'whitelist': ['rust'],
+ \ })
+endif
+
+let g:lsp_diagnostics_enabled = 0 " disable diagnostics support
+let g:lsp_signs_enabled = 1 " enable signs
+
+" highlight code within markdown
+""""""""""""""""""""""""""""""""
+let g:markdown_fenced_languages = [
+ \ 'lisp',
+ \ 'ocaml',
+ \ 'c',
+ \ 'erb=eruby',
+ \ 'cpp',
+ \ 'js=javascript',
+ \ 'json=javascript',
+ \ 'ruby',
+ \ 'haskell',
+ \ 'html',
+ \ 'css'
+ \ ]
+
+" transparency toggle switch
+""""""""""""""""""""""""""""
+function! GetHighlightTerm(group, term)
+ let output = execute('hi ' . a:group)
+ return matchstr(output, a:term.'=\zs\S*')
+endfunction
+
+let g:_ctermbg = GetHighlightTerm("Normal", "ctermbg")
+function! ToogleTransparency()
+ let ctermbg = GetHighlightTerm("Normal", "ctermbg")
+ if ctermbg ==# ""
+ execute('hi Normal ctermbg=' . g:_ctermbg)
+ else
+ hi Normal ctermbg=NONE
+ endif
+endfunction
+nnoremap yot :call ToogleTransparency()<CR>
+
+" Rainbow mode & toggle switch
+""""""""""""""""""""""""""""""
+let g:rainbow_active = 1
+let g:rainbow_conf = {
+\ 'separately': {
+\ 'rust': {
+\ 'parentheses': [
+\ 'start=/(/ end=/)/ fold',
+\ 'start=/\[/ end=/\]/ fold',
+\ 'start=/{/ end=/}/ fold',
+\ 'start=/</ end=/>/ fold'
+\ ],
+\ }
+\ }
+\ }
+nnoremap yok :RainbowToggle<CR>
+
+" slime
+"""""""
+let g:slime_target = "tmux"
+let g:slime_default_config = {"socket_name": get(split($TMUX, ","), 0), "target_pane": ":.1"}
+let g:slime_dont_ask_default = 1