diff --git a/nvim/init.vim b/nvim/init.vim index 5f380f9..197e10a 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,8 +1,8 @@ " Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged) call plug#begin('~/.config/nvim/plugged') -" Automatically match brackets as you type -Plug 'Raimondi/delimitMate' +" Automatically match structures as you type +Plug 'tpope/vim-endwise' " Tab completion Plug 'ervandew/supertab' " EasyMotion - Allows (b|e) to jump to (b)eginning or (end) @@ -82,6 +82,7 @@ Plug 'unblevable/quick-scope' Plug 'igankevich/mesonic' Plug 'rhysd/vim-clang-format', { 'for': [ 'c', 'cpp'] } Plug 'pelodelfuego/vim-swoop' +Plug 'adelarsq/vim-matchit' " Initialize plugin system call plug#end() @@ -132,6 +133,7 @@ set gdefault " Use 'g' flag by default with :s/foo/bar/. set magic " Use 'magic' patterns (extended regular expressions). set autoread " Autoload file if it changes on disk set termguicolors " Enable colors for terminal +set fileformat=unix set clipboard^=unnamed,unnamedplus set completeopt=menuone,preview,noinsert @@ -171,7 +173,9 @@ nnoremap w :w " Search and Replace nnoremap sr :%s//g " Quit -nnoremap q :q +nnoremap x :x +nnoremap q :q +nnoremap qa :qa " Search for the word under cursor noremap d :exe ':Rg ' . expand('') " Open terminal @@ -190,15 +194,23 @@ nnoremap gc :Gcommit --signoff nnoremap gp :Git! push nnoremap gu :Git! push -u nnoremap gr :Git! remote -v +" For gitgutter +nnoremap ghn :GitGutterNextHunk +nnoremap ghp :GitGutterPrevHunk +nnoremap ghs :GitGutterStageHunk +nnoremap ghu :GitGutterUndoHunk +nnoremap ghr :GitGutterPreviewHunk +nnoremap gqf :GitGutterQuickFix +nnoremap ggf :GitGutterFold " For Cscope nnoremap cr :cs reset " For Neomake nnoremap nm :Neomake -nnoremap nr :NeomakeClean +nnoremap nc :NeomakeClean nnoremap ns :NeomakeSh -nnoremap nj :NeomakeListJobs -nnoremap nca :NeomakeCancelJobs -nnoremap ncj :NeomakeCancelJob +nnoremap njl :NeomakeListJobs +nnoremap nja :NeomakeCancelJobs +nnoremap njc :NeomakeCancelJob " Haskell specific " For ghcid @@ -224,10 +236,10 @@ nnoremap ffc :lclose " Key Bindings to help with terminal mode :tnoremap " Key bindings to move between window splits -nnoremap h -nnoremap j -nnoremap k -nnoremap l +nnoremap gh h +nnoremap gj j +nnoremap gk k +nnoremap gl l " Disable Arrow Keys inoremap @@ -315,7 +327,19 @@ let g:airline_right_sep = ' ' let g:airline_right_alt_sep = '|' " Let vim-gitgutter do its thing on large files -let g:gitgutter_max_signs=10000 +let g:gitgutter_max_signs=1000 + +" Neomake +" compile when I open a file, change text, leave insert mode, etc ... +call neomake#configure#automake({ + \ 'TextChanged': {}, + \ 'InsertLeave': {}, + \ 'BufWritePost': {}, + \ 'BufWinEnter': {} + \ }) +" When compilation is done, open the Location list or quickfix list +" Value of 2 preserves cursor position +let g:neomake_open_list = 2 " gutentags configuration " https://www.reddit.com/r/vim/comments/d77t6j/guide_how_to_setup_ctags_with_gutentags_properly/