[nvim] New changes

This commit is contained in:
Midgard 2019-06-13 19:58:34 +02:00
parent aa46c03bba
commit 924e80f68e
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -24,7 +24,7 @@ let g:tex_conceal='' " I said no conceals
set shell=/bin/zsh " use zsh instead of bash
set number " line numbers on the left side
set relativenumber " number+relativenumber = relative numbers for all but current line
"set relativenumber " number+relativenumber = relative numbers for all but current line
" toggle hybrid relative numbers when entering/leaving insert mode
":augroup numbertoggle
": autocmd!
@ -43,6 +43,22 @@ set ignorecase smartcase " don't match case if typing in all-lowercase
" Ctrl+Backspace deletes previous word like in most text editors
inoremap  <esc>dba<bs>
" Useless mode that I only activate accidentally
nnoremap Q <Nop>
" Remove trailing whitespace on save {{{2
fun! CleanExtraSpaces()
let save_cursor = getpos(".")
let old_query = getreg('/')
silent! %s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfun
if has("autocmd")
autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee :call CleanExtraSpaces()
endif
" Switching buffers {{{2
nnoremap <silent> <F14> :bprev<cr> " s-F2
nnoremap <silent> <F15> :bnext<cr> " s-F3
@ -78,7 +94,7 @@ vnoremap <Space> zf
" Escape from NeoVim terminals
tnoremap <Esc> <C-\><C-n>
" Just hit the [à0] button on an AZERTY, no need to do shift+à to for 0
nnoremap à 0
nnoremap à 0
inoremap jj <Esc>
" Clear highlighting after a search
nnoremap <silent> <leader>n :noh<CR>
@ -103,10 +119,10 @@ inoremap <home> <esc>^i
" System clipboard {{{2
" Copy to clipboard " Paste from clipboard
vnoremap <leader>y "+y | nnoremap <leader>p "+p
nnoremap <leader>Y "+yg_ | nnoremap <leader>P "+P
nnoremap <leader>y "+y | vnoremap <leader>p "+p
nnoremap <leader>yy "+yy | vnoremap <leader>P "+P
vnoremap <leader>y "+y | vnoremap <leader>d "+d | nnoremap <leader>p "+p
nnoremap <leader>Y "+yg_ | nnoremap <leader>D "+dg_ | nnoremap <leader>P "+P
nnoremap <leader>y "+y | nnoremap <leader>y "+d | vnoremap <leader>p "+p
nnoremap <leader>yy "+yy | nnoremap <leader>dd "+dd | vnoremap <leader>P "+P
" Opening windows {{{2
nnoremap <C-j> <C-w>j
@ -192,6 +208,8 @@ set undofile
set directory^=/tmp/vim-swapfile//
" Plug-ins {{{1
" =============
@ -210,7 +228,7 @@ call plug#begin('~/.config/nvim/plug')
"Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' } " included in vim-polyglot
"Plug 'LaTeX-Box-Team/LaTeX-Box', { 'for': 'tex' } " included in vim-polyglot
"Plug 'rust-lang/rust.vim', { 'for': 'rust' } " included in vim-polyglot
"Plug 'ap/vim-css-color' " CSS color names
Plug 'ap/vim-css-color' " CSS color names
" C/C++
"Plug 'vim-scripts/c.vim', { 'for': ['c', 'cpp', 'objc'] } " various IDE-like C features
@ -218,9 +236,9 @@ call plug#begin('~/.config/nvim/plug')
"Plug 'derekwyatt/vim-fswitch', { 'for': ['c', 'cpp', 'objc'] } " switch between companion source files (e.g. .h and .cpp)
Plug 'derekwyatt/vim-fswitch', { 'on': 'FSRight' } " switch between companion source files (e.g. .h and .cpp)
"Plug 'derekwyatt/vim-protodef', { 'for': ['c', 'cpp', 'objc'] } " pull in C++ function prototypes into implementation files
Plug 'vim-scripts/Conque-GDB', { 'for': ['c', 'cpp', 'objc'] } " GDB command line interface and terminal emulator
"Plug 'Shougo/vimproc.vim', { 'do': 'make' } " dependency of vim-vebugger, asynchronous execution library
"Plug 'idanarye/vim-vebugger', { 'for': ['c', 'cpp', 'objc', 'java', 'python', 'ruby'] } " debugger frontend for GDB, LDB, PDB, RDebug e.a.
"Plug 'vim-scripts/Conque-GDB', { 'for': ['c', 'cpp', 'objc'] } " GDB command line interface and terminal emulator
Plug 'Shougo/vimproc.vim', { 'do': 'make' } " dependency of vim-vebugger, asynchronous execution library
Plug 'idanarye/vim-vebugger', { 'for': ['c', 'cpp', 'objc', 'java', 'python', 'ruby'] } " debugger frontend for GDB, LDB, PDB, RDebug e.a.
" Edit
"Plug 'jiangmiao/auto-pairs' " insert or delete [], (), '' etc. in pairs
@ -262,6 +280,7 @@ call plug#begin('~/.config/nvim/plug')
"Plug 'kassio/neoterm', { 'on': 'T' } " wrapper of some neovim's :terminal functions
"Plug 'tpope/vim-fugitive' " a Git wrapper
"Plug 'vim-scripts/TeTrIs.vim' " Tetris clone
Plug 'ledger/vim-ledger', { 'for': ['journal'] } " accounting with ledger
call plug#end()"
@ -278,6 +297,7 @@ hi Comment guifg=#888888
hi link Whitespace Conceal
hi CursorLine guibg=NONE ctermbg=NONE
hi CursorLineNr guibg=NONE ctermbg=NONE
hi Folded guifg=#3b4048 ctermfg=16 guibg=NONE ctermbg=NONE gui=italic cterm=italic
" Haskell {{{2
" ------------
@ -333,22 +353,23 @@ nnoremap ;def :call protodef#ReturnSkeletonsFromPrototypesForCurrentBuffer({})<c
" ConqueGDB {{{2
" --------------
let g:ConqueGdb_Leader = ','
" Commented entries are the defaults
"let g:ConqueGdb_Run = g:ConqueGdb_Leader . 'r'
"let g:ConqueGdb_Continue = g:ConqueGdb_Leader . 'c'
let g:ConqueGdb_Next = g:ConqueGdb_Leader . 'o' " step over
let g:ConqueGdb_Step = g:ConqueGdb_Leader . 'i' " step in
"let g:ConqueGdb_Print = g:ConqueGdb_Leader . 'p'
"let g:ConqueGdb_ToggleBreak = g:ConqueGdb_Leader . 'b'
let g:ConqueGdb_Finish = g:ConqueGdb_Leader . 'O' " step out
"let g:ConqueGdb_Backtrace = g:ConqueGdb_Leader . 't'
"let g:ConqueGdb_Leader = ','
"" Commented entries are the defaults
""let g:ConqueGdb_Run = g:ConqueGdb_Leader . 'r'
""let g:ConqueGdb_Continue = g:ConqueGdb_Leader . 'c'
"let g:ConqueGdb_Next = g:ConqueGdb_Leader . 'o' " step over
"let g:ConqueGdb_Step = g:ConqueGdb_Leader . 'i' " step in
""let g:ConqueGdb_Print = g:ConqueGdb_Leader . 'p'
""let g:ConqueGdb_ToggleBreak = g:ConqueGdb_Leader . 'b'
"let g:ConqueGdb_Finish = g:ConqueGdb_Leader . 'O' " step out
""let g:ConqueGdb_Backtrace = g:ConqueGdb_Leader . 't'
nnoremap <F12> :ConqueGdb --args build/tests --debug
"nnoremap <F12> :ConqueGdb --args build/simulation --debug
" Vebugger {{{2
" -------------
"let g:vebugger_leader='<leader>v'
let g:vebugger_leader=','
"
"nnoremap <F5> :VBGstepOver<cr>
"nnoremap <F6> :VBGstepIn<cr>
@ -388,14 +409,17 @@ nmap <leader>a <Plug>(EasyAlign)
" Wildfire {{{2
" -------------
nmap <leader>s <Plug>(wildfire-quick-select)
"nmap <leader>s <Plug>(wildfire-quick-select)
let g:wildfire_objects = ["iw", "i'", "i`", 'i"', "i)", "i]", "i}", "ip", "it"]
" YouCompleteMe {{{2
" ------------------
"noremap <leader>g :YcmCompleter GoToImprecise<CR>
noremap <leader>g <esc>:YcmCompleter GoTo<CR>
noremap <M-CR> <esc>:YcmCompleter FixIt<CR>
noremap <leader>gg <esc>:YcmCompleter GoTo<CR>
noremap <leader>gi <esc>:YcmCompleter GoToImprecise<CR>
noremap <leader>gf <esc>:YcmCompleter FixIt<CR>
noremap <leader>st <esc>:YcmCompleter GetType<CR>
noremap <leader>si <esc>:YcmCompleter GetTypeImprecise<CR>
let g:ycm_enable_diagnostic_highlighting=0
let g:ycm_complete_in_comments=1
@ -446,6 +470,7 @@ let NERDTreeIgnore=[
\ ".*\\.hi$",
\ ".*\\.pyc$",
\ ".*\\.bak$",
\ ".*\\.ozf$",
\ ".*\\~$"
\ ]
@ -526,8 +551,9 @@ let g:airline#extensions#ale#enabled=1
" Ale {{{2
" --------
let g:ale_linters = {
\ 'c': [],
\ 'cpp': [],
\ 'c': [],
\ 'cpp': [],
\ 'markdown': [],
\}
let g:ale_lint_on_text_change='normal'
let g:ale_lint_on_insert_leave=1
@ -571,5 +597,11 @@ let g:EditorConfig_core_mode = 'external_command'
" TeTrIs {{{2
" -----------
" Ledger {{{2
" -----------
autocmd BufEnter,BufRead *.journal | setlocal modelines=1
autocmd BufEnter,BufRead *.journal | inoremap <buffer><silent> !! <esc>:call ledger#entry()<cr>:call CleanLedgerEntry()<cr>
autocmd BufEnter,BufRead *.journal | vnoremap <buffer> <tab> <esc>:call NextEntry()<cr>
" modeline {{{1
" vim: set foldmethod=marker foldlevel=1 et ts=2 sw=2 ft=vim nowrap :
" vim: set foldmethod=marker foldlevel=1 noet ft=vim nowrap :