2017-02-14 20:51:44 +01:00
|
|
|
" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged)
|
|
|
|
call plug#begin('~/.config/nvim/plugged')
|
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
" ----------------------------- Plugins --------------------------------------
|
2017-10-19 11:12:12 +02:00
|
|
|
" Tab completion
|
|
|
|
Plug 'ervandew/supertab'
|
2019-12-10 06:22:04 +01:00
|
|
|
" EasyMotion
|
2017-02-14 20:51:44 +01:00
|
|
|
Plug 'easymotion/vim-easymotion'
|
2019-12-10 06:22:04 +01:00
|
|
|
Plug 'haya14busa/incsearch.vim'
|
|
|
|
Plug 'haya14busa/incsearch-easymotion.vim'
|
2019-12-02 12:22:42 +01:00
|
|
|
" Fuzzy search
|
2019-12-06 16:35:31 +01:00
|
|
|
Plug 'junegunn/fzf.vim'
|
2017-02-14 20:51:44 +01:00
|
|
|
" Remove extraneous whitespace when edit mode is exited
|
2020-02-17 07:02:59 +01:00
|
|
|
Plug 'axelf4/vim-strip-trailing-whitespace'
|
2020-04-22 07:20:31 +02:00
|
|
|
" Tabline
|
|
|
|
Plug 'ap/vim-buftabline'
|
2017-02-14 20:51:44 +01:00
|
|
|
" Manage Project sessions
|
2019-11-25 17:15:20 +01:00
|
|
|
Plug 'thaerkh/vim-workspace'
|
2017-02-15 10:23:41 +01:00
|
|
|
" Commenter
|
2019-12-21 08:00:44 +01:00
|
|
|
Plug 'tpope/vim-commentary'
|
2017-02-15 10:23:41 +01:00
|
|
|
" Theme
|
2020-04-23 16:25:35 +02:00
|
|
|
Plug 'sainnhe/sonokai'
|
2020-02-15 16:47:18 +01:00
|
|
|
" Syntax highlighting
|
|
|
|
Plug 'sheerun/vim-polyglot'
|
2018-11-14 15:13:47 +01:00
|
|
|
" Autoload and read from dish if file changes
|
|
|
|
Plug 'tmux-plugins/vim-tmux-focus-events'
|
2019-10-30 15:12:51 +01:00
|
|
|
Plug 'wellle/tmux-complete.vim'
|
2018-11-21 17:51:14 +01:00
|
|
|
" For LaTeX support
|
2019-07-05 06:57:52 +02:00
|
|
|
Plug 'lervag/vimtex'
|
2020-02-16 09:24:31 +01:00
|
|
|
" Primary git support
|
2019-07-05 19:30:05 +02:00
|
|
|
Plug 'tpope/vim-fugitive'
|
2020-02-16 09:24:31 +01:00
|
|
|
" Manage git hunks
|
|
|
|
Plug 'airblade/vim-gitgutter'
|
|
|
|
" Git blame
|
2019-06-27 18:36:14 +02:00
|
|
|
Plug 'rhysd/git-messenger.vim'
|
2020-02-16 09:24:31 +01:00
|
|
|
" Git logs
|
2019-10-28 09:08:01 +01:00
|
|
|
Plug 'rbong/vim-flog'
|
2020-02-16 09:24:31 +01:00
|
|
|
" Handle merge conflicts
|
2020-02-16 13:23:49 +01:00
|
|
|
Plug 'samoshkin/vim-mergetool'
|
2020-04-03 09:09:24 +02:00
|
|
|
" Git diffs in quickfix list
|
|
|
|
Plug 'oguzbilgic/vim-gdiff'
|
2020-04-12 14:48:54 +02:00
|
|
|
" Boost vim command line mode
|
2019-01-27 18:19:26 +01:00
|
|
|
Plug 'vim-utils/vim-husk'
|
2019-08-02 20:58:42 +02:00
|
|
|
" GDB
|
2019-10-29 07:15:54 +01:00
|
|
|
Plug 'sakhnik/nvim-gdb', { 'do': ':UpdateRemotePlugins' }
|
2019-02-12 09:23:56 +01:00
|
|
|
" Haskell
|
2019-11-04 05:42:38 +01:00
|
|
|
Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' }
|
2019-12-03 10:30:29 +01:00
|
|
|
Plug 'Twinside/vim-hoogle', { 'for': 'haskell' }
|
2019-11-04 06:59:31 +01:00
|
|
|
Plug 'hspec/hspec.vim'
|
2020-01-08 13:01:18 +01:00
|
|
|
Plug 'pbrisbin/vim-syntax-shakespeare'
|
2019-12-03 10:30:29 +01:00
|
|
|
Plug 'zenzike/vim-haskell-unicode', { 'for': 'haskell' }
|
2020-04-12 14:48:54 +02:00
|
|
|
Plug 'godlygeek/tabular', { 'for': 'haskell' }
|
|
|
|
Plug 'Twinside/vim-haskellFold'
|
|
|
|
" Purescript
|
|
|
|
Plug 'frigoeu/psc-ide-vim', { 'for': 'purescript' }
|
2019-08-28 20:23:21 +02:00
|
|
|
" Erlang Support
|
2019-12-03 10:30:29 +01:00
|
|
|
Plug 'vim-erlang/vim-erlang-tags', { 'for': 'erlang' }
|
|
|
|
Plug 'vim-erlang/vim-erlang-omnicomplete', { 'for': 'erlang' }
|
|
|
|
Plug 'vim-erlang/vim-erlang-compiler', { 'for': 'erlang' }
|
2020-04-12 14:48:54 +02:00
|
|
|
" Lisp
|
|
|
|
Plug 'guns/vim-sexp', { 'for': [ 'scheme', 'lisp', 'clojure' ] }
|
|
|
|
Plug 'tpope/vim-sexp-mappings-for-regular-people', { 'for': [ 'scheme', 'lisp', 'clojure' ] }
|
|
|
|
Plug 'junegunn/rainbow_parentheses.vim', { 'for': [ 'scheme', 'lisp', 'clojure' ] }
|
|
|
|
Plug 'kovisoft/slimv', { 'for': [ 'scheme', 'lisp', 'clojure' ] }
|
|
|
|
" Python
|
|
|
|
Plug 'davidhalter/jedi-vim', { 'for': 'python' }
|
|
|
|
" For autocompletion
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
|
|
|
Plug 'deoplete-plugins/deoplete-jedi', { 'for': 'python' }
|
|
|
|
Plug 'sebastianmarkow/deoplete-rust', { 'for': 'rust' }
|
|
|
|
Plug 'Shougo/neco-syntax'
|
|
|
|
Plug 'deoplete-plugins/deoplete-tag'
|
2019-12-11 17:33:32 +01:00
|
|
|
" Neo/Async stuff
|
|
|
|
Plug 'sbdchd/neoformat'
|
|
|
|
Plug 'neomake/neomake'
|
2020-01-11 16:35:54 +01:00
|
|
|
" Quickfix
|
|
|
|
Plug 'sk1418/QFGrep'
|
2020-01-15 05:16:56 +01:00
|
|
|
Plug 'ronakg/quickr-cscope.vim'
|
2020-01-11 16:35:54 +01:00
|
|
|
Plug 'stefandtw/quickfix-reflector.vim'
|
2020-04-02 16:44:37 +02:00
|
|
|
Plug 'romainl/vim-qlist'
|
|
|
|
Plug 'mhinz/vim-grepper'
|
2020-04-07 08:28:41 +02:00
|
|
|
Plug 'milkypostman/vim-togglelist'
|
2020-04-12 12:08:39 +02:00
|
|
|
Plug 'skywind3000/vim-quickui'
|
2020-03-01 15:59:53 +01:00
|
|
|
" Text Object plugins
|
|
|
|
Plug 'kana/vim-textobj-user'
|
|
|
|
Plug 'danidiaz/vim-textobj-do-block'
|
|
|
|
Plug 'michaeljsmith/vim-indent-object'
|
|
|
|
Plug 'wellle/targets.vim'
|
2019-06-30 19:13:19 +02:00
|
|
|
Plug 'tpope/vim-surround'
|
2020-03-01 15:59:53 +01:00
|
|
|
Plug 'junegunn/vim-easy-align'
|
2020-04-06 10:39:13 +02:00
|
|
|
Plug 'tommcdo/vim-exchange'
|
2020-04-06 17:40:02 +02:00
|
|
|
" For folds
|
|
|
|
Plug 'pseewald/vim-anyfold'
|
2020-03-01 15:59:53 +01:00
|
|
|
" Absolute essentials miscellaneous
|
2019-10-30 15:12:51 +01:00
|
|
|
Plug 'tpope/vim-repeat'
|
2019-06-30 19:13:19 +02:00
|
|
|
Plug 'tpope/vim-eunuch'
|
2019-12-01 17:01:18 +01:00
|
|
|
Plug 'tpope/vim-sleuth'
|
2019-12-30 12:59:20 +01:00
|
|
|
Plug 'tpope/vim-vinegar'
|
2020-01-11 16:35:54 +01:00
|
|
|
Plug 'Yggdroot/indentLine'
|
2020-03-12 07:00:11 +01:00
|
|
|
" Floating terminal
|
|
|
|
Plug 'voldikss/vim-floaterm'
|
|
|
|
" Smooth scrolling
|
|
|
|
Plug 'psliwka/vim-smoothie'
|
2020-04-06 17:42:37 +02:00
|
|
|
" Handle line & column jump specifications as found in stack traces
|
|
|
|
Plug 'wsdjeg/vim-fetch'
|
2020-01-11 16:35:54 +01:00
|
|
|
" Miscellaneous
|
2020-03-12 07:00:11 +01:00
|
|
|
Plug 'andymass/vim-matchup'
|
2019-12-05 06:12:09 +01:00
|
|
|
Plug 'liuchengxu/vim-which-key'
|
2020-02-09 13:44:52 +01:00
|
|
|
Plug 'farmergreg/vim-lastplace'
|
2017-02-14 20:51:44 +01:00
|
|
|
|
|
|
|
" Initialize plugin system
|
|
|
|
call plug#end()
|
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
" ----------------------------- Settings -------------------------------------
|
2017-02-14 20:51:44 +01:00
|
|
|
" Set up leaders
|
|
|
|
let mapleader="\<SPACE>"
|
2019-12-07 10:38:10 +01:00
|
|
|
let maplocalleader=","
|
2017-02-14 20:51:44 +01:00
|
|
|
|
2019-09-25 05:34:51 +02:00
|
|
|
set colorcolumn=80 " Highlight 80th column
|
|
|
|
set laststatus=2 " Always show status bar
|
2020-01-06 15:09:10 +01:00
|
|
|
set updatetime=300 " Let plugins show effects after 500ms
|
2019-09-25 05:34:51 +02:00
|
|
|
set mouse-=a " Disable mouse click to go to position
|
2017-02-14 20:51:44 +01:00
|
|
|
set encoding=utf-8
|
2019-01-24 15:13:30 +01:00
|
|
|
set exrc " Allow loading local .nvimrc files
|
|
|
|
set secure " Disallow use of autocmd, shell and write in local rc
|
2017-02-14 20:51:44 +01:00
|
|
|
set showcmd " Show (partial) command in status line.
|
|
|
|
set showmatch " Show matching brackets.
|
|
|
|
set ruler " Show the line and column numbers of the cursor.
|
|
|
|
set formatoptions+=o " Continue comment marker in new lines.
|
2019-11-25 16:34:56 +01:00
|
|
|
set formatoptions+=j " Delete comment character when joining commented lines
|
2019-12-21 15:54:16 +01:00
|
|
|
set textwidth=78 " Hard-wrap long lines as you type them.
|
2019-11-27 08:28:41 +01:00
|
|
|
set autoindent " Copy indent from current line when starting a new line
|
2017-02-14 20:51:44 +01:00
|
|
|
set noerrorbells " No beeps.
|
|
|
|
set modeline " Enable modeline.
|
|
|
|
set linespace=0 " Set line-spacing to minimum.
|
|
|
|
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
|
2019-12-01 17:01:18 +01:00
|
|
|
set noshowmode " Because of neovim's cursor shape
|
2017-02-14 20:51:44 +01:00
|
|
|
set splitbelow " Horizontal split below current.
|
|
|
|
set splitright " Vertical split to right of current.
|
2019-11-18 06:15:12 +01:00
|
|
|
set nobackup " no backup files
|
|
|
|
set nowritebackup " only in case you don't want a backup file while editing
|
|
|
|
set noswapfile " no swap files
|
2019-12-01 17:01:18 +01:00
|
|
|
set nofoldenable " Open folds by default
|
2020-01-06 15:09:10 +01:00
|
|
|
set undofile " Enable undo persistence across sessions
|
2020-04-12 14:48:54 +02:00
|
|
|
set hidden
|
2020-02-29 06:56:08 +01:00
|
|
|
set noautochdir
|
2020-04-22 05:39:06 +02:00
|
|
|
set hlsearch
|
2019-12-01 17:01:18 +01:00
|
|
|
|
|
|
|
" Wild menu
|
|
|
|
set wildmenu
|
|
|
|
set wildmode=list:longest,full
|
2019-11-24 14:29:44 +01:00
|
|
|
set wildoptions=pum
|
|
|
|
set pumblend=30
|
2019-12-02 06:55:12 +01:00
|
|
|
set wildignore+=.hg,.git,.svn " Version control
|
|
|
|
set wildignore+=*.aux,*.out,*.toc " LaTeX intermediate files
|
|
|
|
set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg " binary images
|
|
|
|
set wildignore+=*.o " compiled object files
|
|
|
|
set wildignore+=*.sw? " Vim swap files
|
|
|
|
set wildignore+=*.luac " Lua byte code
|
|
|
|
set wildignore+=*.pyc " Python byte code
|
|
|
|
set wildignore+=*.orig " Merge resolution files
|
2017-02-14 20:51:44 +01:00
|
|
|
|
|
|
|
if !&scrolloff
|
|
|
|
set scrolloff=3 " Show next 3 lines while scrolling.
|
|
|
|
endif
|
|
|
|
if !&sidescrolloff
|
|
|
|
set sidescrolloff=5 " Show next 5 columns while side-scrolling.
|
|
|
|
endif
|
|
|
|
set nostartofline " Do not jump to first character with page commands.
|
|
|
|
|
|
|
|
set ignorecase " Make searching case insensitive
|
|
|
|
set smartcase " ... unless the query has capital letters.
|
|
|
|
set magic " Use 'magic' patterns (extended regular expressions).
|
2018-11-14 15:13:47 +01:00
|
|
|
set autoread " Autoload file if it changes on disk
|
2019-08-12 07:34:20 +02:00
|
|
|
set termguicolors " Enable colors for terminal
|
2019-11-05 07:18:13 +01:00
|
|
|
set fileformat=unix
|
2019-12-12 05:22:35 +01:00
|
|
|
set inccommand=split
|
2020-04-21 10:10:44 +02:00
|
|
|
set switchbuf=useopen
|
2019-02-11 16:26:11 +01:00
|
|
|
|
2019-09-25 05:34:51 +02:00
|
|
|
set clipboard^=unnamed,unnamedplus
|
2019-11-27 08:28:41 +01:00
|
|
|
set backspace=indent,eol,start
|
2020-01-11 16:35:54 +01:00
|
|
|
set completeopt=menu,noselect,preview,noinsert
|
2019-11-25 17:15:20 +01:00
|
|
|
" Required for vim-workspace
|
|
|
|
" See https://github.com/thaerkh/vim-workspace/issues/11
|
|
|
|
set sessionoptions-=blank
|
2020-04-12 14:48:54 +02:00
|
|
|
set grepprg=rg\ --vimgrep
|
2017-02-14 20:51:44 +01:00
|
|
|
|
2020-04-23 16:25:35 +02:00
|
|
|
let g:sonokai_style = 'andromeda'
|
|
|
|
let g:sonokai_enable_italic = 1
|
|
|
|
let g:sonokai_disable_italic_comment = 1
|
|
|
|
colorscheme sonokai
|
2020-04-23 06:47:54 +02:00
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
" --------------------------- Key Bindings -----------------------------------
|
2020-04-23 06:07:02 +02:00
|
|
|
" Allow saving of files as sudo when I forgot to start vim using sudo
|
|
|
|
cmap w!! w !sudo tee > /dev/null %
|
2020-01-25 04:30:20 +01:00
|
|
|
" Remap escape keys to something usable on home row
|
|
|
|
inoremap jk <Esc>
|
|
|
|
cnoremap jk <C-C>
|
|
|
|
inoremap <Esc> <Nop>
|
|
|
|
cnoremap <Esc> <Nop>
|
2019-11-18 06:15:12 +01:00
|
|
|
" Use Q to execute default register.
|
|
|
|
nnoremap Q <Nop>
|
2017-02-14 20:51:44 +01:00
|
|
|
|
2019-12-04 07:50:57 +01:00
|
|
|
" For Fuzzy
|
2020-02-26 05:45:22 +01:00
|
|
|
nnoremap <Leader>ff :GFiles<CR>
|
|
|
|
nnoremap <Leader>f? :GFiles?<CR>
|
|
|
|
nnoremap <Leader>fF :Files<CR>
|
|
|
|
nnoremap <Leader>fb :Buffers<CR>
|
|
|
|
nnoremap <Leader>fL :Lines<CR>
|
|
|
|
nnoremap <Leader>fl :BLines<CR>
|
|
|
|
nnoremap <Leader>ft :BTags<CR>
|
|
|
|
nnoremap <Leader>fT :Tags<CR>
|
|
|
|
nnoremap <Leader>fc :BCommits<CR>
|
|
|
|
nnoremap <Leader>fC :Commits<CR>
|
|
|
|
nnoremap <Leader>fh :History:<CR>
|
|
|
|
nnoremap <Leader>fH :History/<CR>
|
|
|
|
nnoremap <Leader>fm :Commands<CR>
|
|
|
|
nnoremap <Leader>fo :Locate<SPACE>
|
|
|
|
nnoremap <Leader>fk :Maps<CR>
|
|
|
|
nnoremap <Leader>f/ :Rg<CR>
|
|
|
|
nnoremap <Leader>fs :exe ':Rg ' . expand('<cword>')<CR>
|
2020-04-21 10:10:44 +02:00
|
|
|
imap <C-x><C-w> <Plug>(fzf-complete-word)
|
|
|
|
imap <C-x><C-p> <Plug>(fzf-complete-path)
|
|
|
|
imap <C-x><C-f> <Plug>(fzf-complete-file)
|
|
|
|
imap <C-x><C-l> <Plug>(fzf-complete-line)
|
2019-08-12 07:06:10 +02:00
|
|
|
" Save
|
2019-12-30 14:45:26 +01:00
|
|
|
nnoremap <Leader>w <Esc>:w<CR>
|
2019-08-12 07:06:10 +02:00
|
|
|
" Search and Replace
|
2019-12-30 12:15:21 +01:00
|
|
|
nnoremap sr :%s//g<Left><Left>
|
2020-02-17 15:00:24 +01:00
|
|
|
nnoremap <Leader>sr :%s/\<<C-r><C-w>\>//g<Left><Left>
|
2019-08-12 07:06:10 +02:00
|
|
|
" Quit
|
2019-11-05 07:18:13 +01:00
|
|
|
nnoremap <Leader>x <Esc>:x<CR>
|
2019-12-30 11:59:11 +01:00
|
|
|
nnoremap <Leader>q <Esc>:q<CR>
|
2019-12-06 17:51:52 +01:00
|
|
|
nnoremap <Leader>Q <Esc>:qa<CR>
|
2019-12-30 15:16:15 +01:00
|
|
|
" Navigate buffers
|
|
|
|
nnoremap [b :bprevious<CR>
|
|
|
|
nnoremap ]b :bnext<CR>
|
|
|
|
nnoremap [B :bfirst<CR>
|
|
|
|
nnoremap ]B :blast<CR>
|
2020-04-21 10:10:44 +02:00
|
|
|
nnoremap <Leader>b :b<SPACE>
|
|
|
|
nnoremap <Leader>bl :ls<CR>:b<SPACE>
|
|
|
|
nnoremap <Leader>bd :bd<SPACE>
|
2020-02-27 04:59:33 +01:00
|
|
|
" For floating terminal
|
|
|
|
nnoremap se :FloatermNew<CR>
|
|
|
|
nnoremap [s :FloatermPrev<CR>
|
|
|
|
nnoremap ]s :FloatermNext<CR>
|
|
|
|
nnoremap st :FloatermToggle<CR>
|
2019-10-30 08:56:55 +01:00
|
|
|
" For git
|
2019-06-27 18:36:14 +02:00
|
|
|
nnoremap <Leader>gm :GitMessenger<CR>
|
2019-12-05 09:26:29 +01:00
|
|
|
nnoremap <Leader>gl :0Glog<CR>
|
|
|
|
nnoremap <Leader>gL :Glog<CR>
|
|
|
|
nnoremap <Leader>gd :Gdiff<CR>
|
|
|
|
nnoremap <Leader>gD :Gdiffsplit<CR>
|
2019-10-30 08:56:55 +01:00
|
|
|
nnoremap <Leader>gs :Gstatus<CR>
|
2019-12-05 09:26:29 +01:00
|
|
|
nnoremap <Leader>gc :Gcommit -v -q --signoff<CR>
|
|
|
|
nnoremap <Leader>gt :Gcommit -v -q --signoff %:p<CR>
|
|
|
|
nnoremap <Leader>gp :Git push<CR>
|
|
|
|
nnoremap <Leader>gu :Git push -u<SPACE>
|
|
|
|
nnoremap <Leader>gr :Git remote -v<CR>
|
|
|
|
nnoremap <Leader>gb :Git branch<SPACE>
|
|
|
|
nnoremap <Leader>go :Git checkout<SPACE>
|
|
|
|
nnoremap <Leader>g- :Git stash<CR>:e<CR>
|
|
|
|
nnoremap <Leader>g+ :Git stash pop<CR>:e<CR>
|
2020-03-06 08:24:18 +01:00
|
|
|
nnoremap <Leader>gG :exe ':Ggrep ' . expand('<cword>')<CR>
|
2019-12-05 09:26:29 +01:00
|
|
|
nnoremap <Leader>gF :Ggrep<SPACE>
|
2019-12-06 17:51:52 +01:00
|
|
|
nnoremap <Leader>gg :GGrep<SPACE>
|
2020-02-16 13:23:49 +01:00
|
|
|
nnoremap <Leader>ml :MergetoolDiffExchangeLeft<CR>
|
|
|
|
nnoremap <Leader>mr :MergetoolDiffExchangeRight<CR>
|
|
|
|
nnoremap <Leader>mu :MergetoolDiffExchangeUp<CR>
|
|
|
|
nnoremap <Leader>md :MergetoolDiffExchangeDown<CR>
|
|
|
|
nnoremap <Leader>mg :diffget<CR>
|
|
|
|
nnoremap <Leader>mp :diffput<CR>
|
2019-11-05 07:18:13 +01:00
|
|
|
" For gitgutter
|
2019-12-30 15:16:15 +01:00
|
|
|
nnoremap ]h :GitGutterNextHunk<CR>
|
|
|
|
nnoremap [h :GitGutterPrevHunk<CR>
|
2020-01-28 14:43:18 +01:00
|
|
|
nnoremap <Leader>sh :GitGutterStageHunk<CR>
|
|
|
|
nnoremap <Leader>uh :GitGutterUndoHunk<CR>
|
|
|
|
nnoremap <Leader>ph :GitGutterPreviewHunk<CR>
|
|
|
|
nnoremap <Leader>qh :GitGutterQuickFix<CR>
|
2020-03-06 08:24:18 +01:00
|
|
|
nnoremap <Leader>gf :GitGutterFold<CR>
|
2019-12-11 17:33:32 +01:00
|
|
|
" For Neomake/Neoformat
|
2020-02-10 04:53:40 +01:00
|
|
|
nnoremap <Leader>nm :Neomake<CR>
|
|
|
|
nnoremap <Leader>nc :NeomakeClean<CR>
|
|
|
|
nnoremap <Leader>ns :NeomakeSh<SPACE>
|
|
|
|
nnoremap <Leader>njl :NeomakeListJobs<CR>
|
|
|
|
nnoremap <Leader>nja :NeomakeCancelJobs<CR>
|
|
|
|
nnoremap <Leader>njc :NeomakeCancelJob<SPACE>
|
|
|
|
nnoremap <Leader>nf :Neoformat<CR>
|
|
|
|
nnoremap <Leader>ne :NeomakeEnable<CR>
|
|
|
|
nnoremap <Leader>nd :NeomakeDisable<CR>
|
2019-11-25 17:15:20 +01:00
|
|
|
" For workspace
|
2019-12-30 12:15:21 +01:00
|
|
|
nnoremap <Leader>ws :ToggleWorkspace<CR>
|
2019-12-02 17:42:00 +01:00
|
|
|
" Quickfix & Location list mappings
|
2019-12-30 11:59:11 +01:00
|
|
|
nnoremap qo :copen<CR>
|
|
|
|
nnoremap qc :cclose<CR>
|
2019-12-30 15:16:15 +01:00
|
|
|
nnoremap [q :cprevious<CR>
|
|
|
|
nnoremap ]q :cnext<CR>
|
|
|
|
nnoremap [Q :cfirst<CR>
|
|
|
|
nnoremap ]Q :clast<CR>
|
2020-04-02 16:44:37 +02:00
|
|
|
nnoremap qs :Grepper -nojump -query<SPACE>
|
|
|
|
nnoremap q* :Grepper -nojump -cword<CR>
|
2019-12-30 11:59:11 +01:00
|
|
|
nnoremap qt :call ToggleQuickfixList()<CR>
|
|
|
|
nnoremap Lo :lopen<CR>
|
|
|
|
nnoremap Lc :lclose<CR>
|
2019-12-30 15:16:15 +01:00
|
|
|
nnoremap [l :lprevious<CR>
|
|
|
|
nnoremap ]l :lnext<CR>
|
|
|
|
nnoremap [L :lfirst<CR>
|
|
|
|
nnoremap ]L :llast<CR>
|
2020-04-02 16:44:37 +02:00
|
|
|
nnoremap Ls :Grepper -nojump -noquickfix -query<SPACE>
|
|
|
|
nnoremap L* :Grepper -nojump -noquickfix -cword<CR>
|
2019-12-30 11:59:11 +01:00
|
|
|
nnoremap Lt :call ToggleLocationList()<CR>
|
2020-04-06 06:38:03 +02:00
|
|
|
" Preview tags
|
|
|
|
nnoremap pt :ptag <C-R><C-W><CR>
|
|
|
|
nnoremap [p :ptprevious<CR>
|
|
|
|
nnoremap ]p :ptnext<CR>
|
|
|
|
nnoremap po :ppop<CR>
|
|
|
|
nnoremap pc :pc<CR>
|
|
|
|
nnoremap pi :psearch <C-R><C-W><CR>
|
2020-04-06 17:26:36 +02:00
|
|
|
" Short cuts for setting fold methods
|
|
|
|
nnoremap zmi :set foldmethod=indent<CR>
|
|
|
|
nnoremap zmm :set foldmethod=manual<CR>
|
|
|
|
nnoremap zme :set foldmethod=expr<CR>
|
|
|
|
nnoremap zmk :set foldmethod=marker<CR>
|
|
|
|
nnoremap zms :set foldmethod=syntax<CR>
|
2019-10-30 09:53:15 +01:00
|
|
|
|
2017-02-18 12:30:11 +01:00
|
|
|
" Key Bindings to help with terminal mode
|
2019-11-23 16:20:03 +01:00
|
|
|
:tnoremap jk <C-\><C-n>
|
2017-10-19 11:12:12 +02:00
|
|
|
" Key bindings to move between window splits
|
2020-03-30 12:27:58 +02:00
|
|
|
for key in range(0, 9)
|
|
|
|
execute 'nnoremap <Space>'.key key.'<C-w>w'
|
|
|
|
endfor
|
2017-02-18 12:30:11 +01:00
|
|
|
|
2017-03-29 13:05:42 +02:00
|
|
|
" Disable Arrow Keys
|
|
|
|
inoremap <Up> <NOP>
|
|
|
|
inoremap <Down> <NOP>
|
|
|
|
inoremap <Left> <NOP>
|
|
|
|
inoremap <Right> <NOP>
|
|
|
|
noremap <Up> <NOP>
|
|
|
|
noremap <Down> <NOP>
|
|
|
|
noremap <Left> <NOP>
|
|
|
|
noremap <Right> <NOP>
|
|
|
|
|
2019-12-24 04:14:27 +01:00
|
|
|
" Whick key
|
2019-12-05 06:12:09 +01:00
|
|
|
nnoremap <silent> <Leader> :<C-U>WhichKey '<Space>'<CR>
|
2019-12-07 12:52:34 +01:00
|
|
|
nnoremap <silent> <LocalLeader> :<C-U>WhichKey ','<CR>
|
2019-12-05 06:12:09 +01:00
|
|
|
|
2019-12-24 04:14:27 +01:00
|
|
|
" Bindings for easy motion
|
|
|
|
" Character motions
|
2019-12-10 06:22:04 +01:00
|
|
|
map <Leader><Leader>c <Plug>(easymotion-bd-f)
|
|
|
|
nmap <Leader><Leader>c <Plug>(easymotion-overwin-f)
|
2019-12-24 04:14:27 +01:00
|
|
|
" Line motions
|
2019-12-10 06:22:04 +01:00
|
|
|
map <Leader><Leader>L <Plug>(easymotion-bd-jk)
|
|
|
|
nmap <Leader><Leader>L <Plug>(easymotion-overwin-line)
|
2019-12-24 04:14:27 +01:00
|
|
|
" Word motions
|
2019-12-10 06:22:04 +01:00
|
|
|
map <Leader><Leader>w <Plug>(easymotion-bd-w)
|
|
|
|
nmap <Leader><Leader>w <Plug>(easymotion-overwin-w)
|
2019-12-24 04:14:27 +01:00
|
|
|
" Line motion jump
|
2019-12-10 06:22:04 +01:00
|
|
|
map <Leader>l <Plug>(easymotion-lineforward)
|
|
|
|
map <Leader>j <Plug>(easymotion-j)
|
|
|
|
map <Leader>k <Plug>(easymotion-k)
|
|
|
|
map <Leader>h <Plug>(easymotion-linebackward)
|
2019-12-24 04:14:27 +01:00
|
|
|
" Incremental search + easymotion
|
|
|
|
noremap <silent><expr> / incsearch#go(<SID>incsearch_config())
|
|
|
|
noremap <silent><expr> ? incsearch#go(<SID>incsearch_config({'command': '?'}))
|
|
|
|
noremap <silent><expr> g/ incsearch#go(<SID>incsearch_config({'is_stay': 1}))
|
2020-04-22 05:39:06 +02:00
|
|
|
" Incremental search
|
|
|
|
map n <Plug>(incsearch-nohl-n)
|
|
|
|
map N <Plug>(incsearch-nohl-N)
|
|
|
|
map * <Plug>(incsearch-nohl-*)
|
|
|
|
map # <Plug>(incsearch-nohl-#)
|
|
|
|
map g* <Plug>(incsearch-nohl-g*)
|
|
|
|
map g# <Plug>(incsearch-nohl-g#)
|
2019-12-10 06:22:04 +01:00
|
|
|
|
2019-12-24 04:14:27 +01:00
|
|
|
" Tag helpers
|
2020-01-11 16:35:54 +01:00
|
|
|
nnoremap <C-\> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
|
|
|
|
nnoremap <A-]> :sp <CR>:exec("tag ".expand("<cword>"))<CR>
|
2019-12-23 06:54:19 +01:00
|
|
|
|
2020-03-01 15:59:53 +01:00
|
|
|
" Start interactive EasyAlign in visual mode (e.g. vipga)
|
|
|
|
xmap ga <Plug>(EasyAlign)
|
|
|
|
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
|
|
|
nmap ga <Plug>(EasyAlign)
|
|
|
|
|
2019-12-06 16:35:31 +01:00
|
|
|
command! -bang -nargs=* GGrep
|
2020-02-28 08:26:49 +01:00
|
|
|
\ call fzf#vim#grep(
|
|
|
|
\ 'git grep --line-number '.shellescape(<q-args>), 0,
|
|
|
|
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
|
2019-12-06 16:35:31 +01:00
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
" --------------------------- Autocmd groups ---------------------------------
|
2019-10-29 07:15:54 +01:00
|
|
|
augroup rainbow_lisp
|
2020-02-28 08:26:49 +01:00
|
|
|
autocmd!
|
|
|
|
autocmd FileType lisp,clojure,scheme RainbowParentheses
|
2019-10-29 07:15:54 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup terminal_job
|
2020-02-28 08:26:49 +01:00
|
|
|
au!
|
|
|
|
au TermOpen * startinsert
|
|
|
|
au TermOpen * setlocal listchars= nonumber norelativenumber
|
2019-12-04 08:08:00 +01:00
|
|
|
augroup END
|
|
|
|
|
2020-01-19 15:18:28 +01:00
|
|
|
augroup ResizeWindowsProportionally
|
2020-02-28 08:26:49 +01:00
|
|
|
au!
|
|
|
|
autocmd VimResized * :wincmd =
|
2020-01-19 15:18:28 +01:00
|
|
|
augroup END
|
2019-12-04 08:08:00 +01:00
|
|
|
|
|
|
|
" --------------------------- Plugin settings --------------------------------
|
2019-07-05 19:30:05 +02:00
|
|
|
" Let vim-gitgutter do its thing on large files
|
2019-11-05 07:18:13 +01:00
|
|
|
let g:gitgutter_max_signs=1000
|
2019-12-05 06:34:23 +01:00
|
|
|
let g:gitgutter_map_keys = 0
|
|
|
|
let g:gitgutter_highlight_linenrs = 1
|
|
|
|
let g:gitgutter_preview_win_floating = 1
|
|
|
|
let g:gitgutter_use_location_list = 1
|
|
|
|
let g:gitgutter_sign_added = '+a'
|
|
|
|
let g:gitgutter_sign_modified = '+m'
|
|
|
|
let g:gitgutter_sign_removed = '-r'
|
|
|
|
let g:gitgutter_sign_removed_first_line = '^^'
|
|
|
|
let g:gitgutter_sign_modified_removed = 'mr'
|
2019-11-05 07:18:13 +01:00
|
|
|
|
|
|
|
" Neomake
|
|
|
|
" When compilation is done, open the Location list or quickfix list
|
|
|
|
" Value of 2 preserves cursor position
|
|
|
|
let g:neomake_open_list = 2
|
2019-12-04 08:08:00 +01:00
|
|
|
let g:neomake_warning_sign = {'text': '?'}
|
2019-12-10 17:23:25 +01:00
|
|
|
let g:neomake_c_enabled_makers = ['gcc']
|
|
|
|
let g:neomake_c_gcc_maker = {
|
2020-02-28 08:26:49 +01:00
|
|
|
\ 'exe': 'gcc',
|
|
|
|
\ 'args': ['-Wall', '-Iinclude', '-Wextra', '-Weverything', '-pedantic', '-Wno-sign-conversion'],
|
|
|
|
\ }
|
2019-08-28 20:23:21 +02:00
|
|
|
|
2019-10-25 07:18:49 +02:00
|
|
|
" Automatically detect style file and apply style to formatting
|
|
|
|
let g:clang_format#detect_style_file = 1
|
2020-02-14 07:57:26 +01:00
|
|
|
" Fix tab behaviour while switching through completion options
|
2019-11-25 17:15:20 +01:00
|
|
|
let g:SuperTabDefaultCompletionType = "<c-n>"
|
|
|
|
" For workspace
|
|
|
|
let g:workspace_session_directory = $HOME . '/.vim/session/'
|
|
|
|
let g:workspace_undodir = $HOME . '/.vim/undodir'
|
|
|
|
let g:workspace_autosave = 0
|
2019-12-01 17:01:18 +01:00
|
|
|
let g:workspace_autosave_ignore = ['gitcommit', 'qf', 'tagbar']
|
2019-12-02 13:33:32 +01:00
|
|
|
let g:workspace_session_disable_on_args = 1
|
2019-12-24 04:20:36 +01:00
|
|
|
" Toggle quickfix/location list
|
2019-12-02 17:42:00 +01:00
|
|
|
let g:toggle_list_no_mappings = 1
|
2019-10-25 07:18:49 +02:00
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
let g:nvimgdb_config_override = {
|
2020-02-28 08:26:49 +01:00
|
|
|
\ 'key_next': 'n',
|
|
|
|
\ 'key_step': 's',
|
|
|
|
\ 'key_finish': 'f',
|
|
|
|
\ 'key_continue': 'c',
|
|
|
|
\ 'key_until': 'u',
|
|
|
|
\ 'key_breakpoint': 'b',
|
|
|
|
\ 'set_tkeymaps': "NvimGdbNoTKeymaps",
|
|
|
|
\ }
|
2019-10-30 10:29:21 +01:00
|
|
|
|
2019-12-05 06:12:09 +01:00
|
|
|
let g:mapleader = "\<Space>"
|
|
|
|
let g:maplocalleader = ','
|
|
|
|
let g:which_key_use_floating_win = 1
|
|
|
|
|
2019-12-15 11:44:53 +01:00
|
|
|
" For SLIMV
|
|
|
|
let g:lisp_rainbow=1
|
2019-12-28 09:06:00 +01:00
|
|
|
|
2020-01-13 10:00:48 +01:00
|
|
|
" FZF
|
|
|
|
let g:fzf_mru_no_sort = 1
|
2020-01-15 05:16:56 +01:00
|
|
|
let $FZF_DEFAULT_OPTS='--layout=reverse'
|
2020-04-03 13:02:59 +02:00
|
|
|
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.6 } }
|
2020-01-13 10:00:48 +01:00
|
|
|
|
2020-02-12 15:33:04 +01:00
|
|
|
" Disable providers we do not give a shit about
|
|
|
|
let g:loaded_python_provider = 0
|
|
|
|
let g:loaded_ruby_provider = 0
|
|
|
|
let g:loaded_perl_provider = 0
|
|
|
|
let g:loaded_node_provider = 0
|
2020-04-12 14:48:54 +02:00
|
|
|
let g:python3_host_prog = '/usr/bin/python3'
|
2020-02-12 15:33:04 +01:00
|
|
|
|
2020-02-16 13:23:49 +01:00
|
|
|
" Mergetool
|
|
|
|
let g:mergetool_layout = 'mr'
|
|
|
|
let g:mergetool_prefer_revision = 'unmodified'
|
|
|
|
|
2020-02-27 04:59:33 +01:00
|
|
|
" Floaterm
|
2020-03-02 14:39:27 +01:00
|
|
|
let g:floaterm_open_in_root = 0
|
2020-02-27 04:59:33 +01:00
|
|
|
let g:floaterm_position = 'center'
|
|
|
|
let g:floaterm_width = 0.8
|
|
|
|
let g:floaterm_height = 0.8
|
|
|
|
let g:floaterm_winblend = 0
|
|
|
|
let g:floaterm_borderchars = ['─', '│', '─', '│', '╭', '╮', '╯', '╰']
|
|
|
|
|
2020-04-02 16:44:37 +02:00
|
|
|
" Vim grepper
|
|
|
|
let g:grepper = {}
|
|
|
|
let g:grepper.tools = ['rg']
|
|
|
|
let g:grepper.quickfix = 1
|
|
|
|
let g:grepper.buffer = 0
|
|
|
|
let g:grepper.buffers = 0
|
|
|
|
let g:grepper.switch = 0
|
2020-04-04 09:34:13 +02:00
|
|
|
let g:grepper.append = 0
|
2020-04-02 16:44:37 +02:00
|
|
|
let g:grepper.prompt = 0
|
|
|
|
|
2020-04-22 05:39:06 +02:00
|
|
|
" Easymotion incsearch
|
|
|
|
let g:incsearch#auto_nohlsearch = 1
|
|
|
|
|
2020-04-22 07:20:31 +02:00
|
|
|
" Buftabline
|
|
|
|
let g:buftabline_plug_max = 0
|
|
|
|
let g:buftabline_numbers = 1
|
|
|
|
let g:buftabline_indicators = 1
|
|
|
|
|
2020-04-12 14:48:54 +02:00
|
|
|
" Deoplete
|
2020-04-21 12:30:48 +02:00
|
|
|
let g:deoplete#enable_at_startup = 0
|
2020-04-12 14:48:54 +02:00
|
|
|
let g:deoplete#sources#rust#disable_keymap = 1
|
|
|
|
let g:deoplete#sources#rust#racer_binary=expand('$HOME/.cargo/bin/racer')
|
|
|
|
let g:deoplete#sources#rust#rust_source_path=expand('$HOME/GitSources/rust/src')
|
|
|
|
let g:deoplete#sources = {}
|
|
|
|
call deoplete#custom#source('_', 'disabled_syntaxes', ['Comment', 'String'])
|
|
|
|
call deoplete#custom#option('sources', {
|
|
|
|
\ '_' : ['buffer', 'omni', 'around', 'file', 'member'],
|
|
|
|
\ 'haskell': ['tag', 'buffer', 'omni'],
|
|
|
|
\ 'c': ['tag', 'buffer'],
|
|
|
|
\ 'purescript': ['buffer', 'omni'],
|
|
|
|
\ 'rust': ['racer', 'buffer'],
|
|
|
|
\})
|
|
|
|
call deoplete#custom#source('omni', 'functions', {
|
|
|
|
\ 'purescript': 'PSCIDEComplete',
|
|
|
|
\})
|
|
|
|
call deoplete#custom#var('omni', 'input_patterns', {
|
|
|
|
\ 'purescript': '\w*',
|
|
|
|
\})
|
|
|
|
call deoplete#custom#option({
|
|
|
|
\ 'auto_complete_delay': 200,
|
|
|
|
\ 'auto_complete': v:true,
|
|
|
|
\ 'smart_case': v:true,
|
|
|
|
\ })
|
|
|
|
|
2020-01-15 05:16:56 +01:00
|
|
|
" ----------------------------- Functions ------------------------------------
|
2019-11-27 15:01:03 +01:00
|
|
|
function! NvimGdbNoTKeymaps()
|
2019-12-05 09:26:29 +01:00
|
|
|
tnoremap <silent> <buffer> <Esc> <C-\><C-n>
|
2019-11-27 15:01:03 +01:00
|
|
|
endfunction
|
2019-12-07 10:44:39 +01:00
|
|
|
|
2019-12-10 06:22:04 +01:00
|
|
|
function! s:incsearch_config(...) abort
|
2020-02-28 08:26:49 +01:00
|
|
|
return incsearch#util#deepextend(deepcopy({
|
|
|
|
\ 'modules': [incsearch#config#easymotion#module({'overwin': 1})],
|
|
|
|
\ 'keymap': {
|
|
|
|
\ "\<CR>": '<Over>(easymotion)'
|
|
|
|
\ },
|
|
|
|
\ 'is_expr': 0
|
|
|
|
\ }), get(a:, 1, {}))
|
2019-12-10 06:22:04 +01:00
|
|
|
endfunction
|