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 --------------------------------------
|
2019-11-05 07:18:13 +01:00
|
|
|
" Automatically match structures as you type
|
|
|
|
Plug 'tpope/vim-endwise'
|
2019-12-05 10:37:11 +01:00
|
|
|
Plug 'jiangmiao/auto-pairs'
|
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-09 04:47:30 +01:00
|
|
|
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
|
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
|
|
|
|
Plug 'thirtythreeforty/lessspace.vim'
|
|
|
|
" Status bar mods
|
2019-12-04 03:29:57 +01:00
|
|
|
Plug 'vim-airline/vim-airline'
|
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
|
2019-12-06 04:50:09 +01:00
|
|
|
Plug 'sickill/vim-monokai'
|
2019-12-06 06:01:46 +01:00
|
|
|
Plug 'justinmk/vim-syntax-extra'
|
|
|
|
Plug 'octol/vim-cpp-enhanced-highlight'
|
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'
|
2019-01-25 06:19:07 +01:00
|
|
|
" For git support
|
2019-12-05 06:34:23 +01:00
|
|
|
Plug 'airblade/vim-gitgutter'
|
2019-07-05 19:30:05 +02:00
|
|
|
Plug 'tpope/vim-fugitive'
|
|
|
|
Plug 'junegunn/gv.vim'
|
2019-06-27 18:36:14 +02:00
|
|
|
Plug 'rhysd/git-messenger.vim'
|
2019-07-05 19:30:05 +02:00
|
|
|
Plug 'christoomey/vim-conflicted'
|
2019-10-28 09:08:01 +01:00
|
|
|
Plug 'rbong/vim-flog'
|
2019-01-27 18:19:26 +01:00
|
|
|
" For tmux yank
|
|
|
|
Plug 'vim-utils/vim-husk'
|
2019-09-25 05:34:51 +02:00
|
|
|
" Tags
|
2019-12-02 15:24:02 +01:00
|
|
|
Plug 'sk1418/QFGrep'
|
2019-12-03 10:30:29 +01:00
|
|
|
Plug 'steffanc/cscopemaps.vim', { 'for': 'c' }
|
2019-11-25 09:50:08 +01:00
|
|
|
Plug 'deoplete-plugins/deoplete-tag'
|
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
|
|
|
" Lisp
|
2019-12-03 10:30:29 +01:00
|
|
|
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' ] }
|
2019-12-15 11:44:53 +01:00
|
|
|
Plug 'kovisoft/slimv', { 'for': [ 'scheme', 'lisp', 'clojure' ] }
|
2019-02-12 09:23:56 +01:00
|
|
|
" Haskell
|
2019-11-01 17:51:35 +01:00
|
|
|
Plug 'ekmett/haskell-vim', { 'for': [ 'haskell', 'cabal' ] }
|
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'
|
2019-12-03 10:30:29 +01:00
|
|
|
Plug 'zenzike/vim-haskell-unicode', { 'for': 'haskell' }
|
2019-10-24 18:21:54 +02:00
|
|
|
" For Nix
|
|
|
|
Plug 'LnL7/vim-nix', { 'for': 'nix' }
|
2019-02-14 10:00:24 +01:00
|
|
|
" For autocompletion
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
2019-11-24 16:36:04 +01:00
|
|
|
" For Python
|
2019-12-10 07:59:13 +01:00
|
|
|
Plug 'davidhalter/jedi-vim', { 'for': 'python' }
|
2019-12-03 10:30:29 +01:00
|
|
|
Plug 'zchee/deoplete-jedi', { 'for': 'python' }
|
|
|
|
Plug 'numirias/semshi', { 'for': 'python', 'do': ':UpdateRemotePlugins' }
|
2019-03-06 16:36:57 +01:00
|
|
|
" Autocomplete for Rust
|
2019-12-03 10:30:29 +01:00
|
|
|
Plug 'sebastianmarkow/deoplete-rust', { 'for': 'rust' }
|
2019-10-24 18:21:54 +02:00
|
|
|
Plug 'cespare/vim-toml', { 'for': 'rust' }
|
|
|
|
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
|
2019-11-04 15:15:41 +01:00
|
|
|
Plug 'mhinz/vim-crates'
|
2019-12-08 13:21:33 +01:00
|
|
|
" Snippets
|
|
|
|
Plug 'SirVer/ultisnips'
|
|
|
|
Plug 'honza/vim-snippets'
|
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-runtime', { 'for': 'erlang' }
|
|
|
|
Plug 'vim-erlang/vim-erlang-omnicomplete', { 'for': 'erlang' }
|
|
|
|
Plug 'vim-erlang/vim-erlang-compiler', { 'for': 'erlang' }
|
2019-12-10 11:08:30 +01:00
|
|
|
" Purescript
|
2019-12-30 12:01:52 +01:00
|
|
|
Plug 'purescript-contrib/purescript-vim', { 'for': 'purescript' }
|
|
|
|
Plug 'frigoeu/psc-ide-vim', { 'for': 'purescript' }
|
2019-12-11 17:33:32 +01:00
|
|
|
" Neo/Async stuff
|
|
|
|
Plug 'sbdchd/neoformat'
|
|
|
|
Plug 'neomake/neomake'
|
2019-06-30 19:13:19 +02:00
|
|
|
" Miscellaneous
|
|
|
|
Plug 'tpope/vim-surround'
|
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 11:59:11 +01:00
|
|
|
Plug 'tpope/vim-unimpaired'
|
2019-12-30 12:59:20 +01:00
|
|
|
Plug 'tpope/vim-vinegar'
|
2019-12-01 17:01:18 +01:00
|
|
|
Plug 'editorconfig/editorconfig-vim'
|
2019-10-24 18:21:54 +02:00
|
|
|
Plug 'igankevich/mesonic'
|
2019-11-20 10:54:19 +01:00
|
|
|
Plug 'stefandtw/quickfix-reflector.vim'
|
2019-12-24 04:20:36 +01:00
|
|
|
Plug 'psliwka/vim-smoothie'
|
2019-12-01 17:01:18 +01:00
|
|
|
Plug 'lifecrisis/vim-difforig'
|
|
|
|
Plug 'dag/vim-fish'
|
|
|
|
Plug 'pbrisbin/vim-syntax-shakespeare'
|
|
|
|
Plug 'lifepillar/pgsql.vim'
|
|
|
|
Plug 'mbbill/undotree'
|
2019-12-02 17:42:00 +01:00
|
|
|
Plug 'milkypostman/vim-togglelist'
|
2019-12-04 06:12:45 +01:00
|
|
|
Plug 'jpalardy/vim-slime'
|
2019-12-05 06:12:09 +01:00
|
|
|
Plug 'liuchengxu/vim-which-key'
|
2019-12-07 10:38:10 +01:00
|
|
|
Plug 'jceb/vim-orgmode'
|
2019-12-09 05:16:29 +01:00
|
|
|
Plug 'wellle/targets.vim'
|
2019-12-23 18:02:42 +01:00
|
|
|
Plug 'godlygeek/tabular'
|
|
|
|
Plug 'Yggdroot/indentLine'
|
2019-12-29 11:25:04 +01:00
|
|
|
Plug 'HiPhish/awk-ward.nvim'
|
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
|
|
|
|
set updatetime=500 " Let plugins show effects after 500ms
|
|
|
|
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 number " Show the line numbers on the left side.
|
|
|
|
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.
|
2018-10-26 17:16:21 +02:00
|
|
|
set softtabstop=4 " Finetunes the amount of white space to be added.
|
2017-02-14 20:51:44 +01:00
|
|
|
set tabstop=4 " Render TABs using this many spaces.
|
2017-02-18 12:30:11 +01:00
|
|
|
set shiftwidth=4 " Indentation amount for < and > commands.
|
2018-10-26 17:16:21 +02:00
|
|
|
set smarttab " Indent with tabs, align with spaces.
|
|
|
|
set expandtab " When on, uses space instead of tabs.
|
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 foldmethod=syntax " Create folds based on files syntax
|
|
|
|
set nofoldenable " Open folds by default
|
|
|
|
|
|
|
|
" 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
|
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
|
2019-12-03 13:42:36 +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
|
2017-02-14 20:51:44 +01:00
|
|
|
|
2019-09-25 05:34:51 +02:00
|
|
|
" Theme
|
2019-12-06 04:50:09 +01:00
|
|
|
colorscheme monokai
|
2019-12-05 17:49:30 +01:00
|
|
|
set background=dark
|
2018-10-14 15:40:12 +02:00
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
" --------------------------- Key Bindings -----------------------------------
|
2017-02-14 20:51:44 +01:00
|
|
|
" Use <C-L> to clear the highlighting of :set hlsearch.
|
|
|
|
if maparg('<C-L>', 'n') ==# ''
|
|
|
|
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
|
|
|
|
endif
|
|
|
|
|
2019-11-20 07:14:47 +01:00
|
|
|
" Remap escape keys to something usable on home row
|
|
|
|
inoremap jk <Esc>
|
|
|
|
cnoremap jk <C-C>
|
|
|
|
inoremap <Esc> <Nop>
|
2019-11-22 12:47:34 +01:00
|
|
|
cnoremap <Esc> <Nop>
|
2019-11-18 06:15:12 +01:00
|
|
|
" Use ; for commands.
|
|
|
|
nnoremap ; :
|
|
|
|
" 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
|
2019-12-30 11:59:11 +01:00
|
|
|
nnoremap ff :GFiles<CR>
|
|
|
|
nnoremap f? :GFiles?<CR>
|
|
|
|
nnoremap fF :Files<CR>
|
|
|
|
nnoremap fb :Buffers<CR>
|
|
|
|
nnoremap fL :Lines<CR>
|
|
|
|
nnoremap fl :BLines<CR>
|
|
|
|
nnoremap ft :BTags<CR>
|
|
|
|
nnoremap fT :Tags<CR>
|
|
|
|
nnoremap fc :BCommits<CR>
|
|
|
|
nnoremap fC :Commits<CR>
|
|
|
|
nnoremap fch :History:<CR>
|
|
|
|
nnoremap fsh :History/<CR>
|
|
|
|
nnoremap fm :Commands<CR>
|
|
|
|
nnoremap fo :Locate<SPACE>
|
|
|
|
nnoremap fk :Maps<CR>
|
|
|
|
nnoremap f/ :Rg<CR>
|
|
|
|
nnoremap * :exe ':Rg ' . expand('<cword>')<CR>
|
2019-12-02 12:22:42 +01:00
|
|
|
" Quick buffer switching
|
2019-11-16 16:06:31 +01:00
|
|
|
nnoremap <Leader>b :ls<CR>:b<Space>
|
2019-12-01 17:01:18 +01:00
|
|
|
" Undo tree
|
|
|
|
nnoremap <Leader>u :UndotreeToggle<CR>
|
2019-08-12 07:06:10 +02:00
|
|
|
" Save
|
2019-12-30 12:15:21 +01:00
|
|
|
nnoremap 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>
|
2019-11-18 06:43:27 +01:00
|
|
|
" Manage window splitting
|
2019-12-30 12:15:21 +01:00
|
|
|
nnoremap sh <Esc>:sp<CR>
|
|
|
|
nnoremap sv <Esc>:vsp<CR>
|
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-04 06:49:18 +01:00
|
|
|
" Terminal
|
2019-10-30 08:56:55 +01:00
|
|
|
nnoremap <Leader>te :vsp<CR> :terminal<CR>
|
2019-12-04 06:12:45 +01:00
|
|
|
nnoremap <Leader>tc :SlimeConfig<CR>
|
|
|
|
xmap <Leader>ts <Plug>SlimeRegionSend
|
|
|
|
nmap <Leader>ts <Plug>SlimeParagraphSend
|
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>
|
|
|
|
nnoremap <Leader>gf :exe ':Ggrep ' . expand('<cword>')<CR>
|
|
|
|
nnoremap <Leader>gF :Ggrep<SPACE>
|
2019-12-06 17:51:52 +01:00
|
|
|
nnoremap <Leader>gg :GGrep<SPACE>
|
2019-11-05 07:18:13 +01:00
|
|
|
" For gitgutter
|
2019-12-30 11:59:11 +01:00
|
|
|
nnoremap un :GitGutterNextHunk<CR>
|
|
|
|
nnoremap up :GitGutterPrevHunk<CR>
|
|
|
|
nnoremap us :GitGutterStageHunk<CR>
|
|
|
|
nnoremap ud :GitGutterUndoHunk<CR>
|
|
|
|
nnoremap ur :GitGutterPreviewHunk<CR>
|
|
|
|
nnoremap uq :GitGutterQuickFix<CR>
|
|
|
|
nnoremap uf :GitGutterFold<CR>
|
2019-12-11 17:33:32 +01:00
|
|
|
" For Neomake/Neoformat
|
2019-12-30 11:59:11 +01:00
|
|
|
nnoremap nm :Neomake<CR>
|
|
|
|
nnoremap nc :NeomakeClean<CR>
|
|
|
|
nnoremap ns :NeomakeSh<SPACE>
|
|
|
|
nnoremap njl :NeomakeListJobs<CR>
|
|
|
|
nnoremap nja :NeomakeCancelJobs<CR>
|
|
|
|
nnoremap njc :NeomakeCancelJob<SPACE>
|
|
|
|
nnoremap nf :Neoformat<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>
|
|
|
|
nnoremap qs :vimgrep<SPACE>
|
|
|
|
nnoremap qt :call ToggleQuickfixList()<CR>
|
|
|
|
nnoremap Lo :lopen<CR>
|
|
|
|
nnoremap Lc :lclose<CR>
|
|
|
|
nnoremap Ls :lvimgrep<SPACE>
|
|
|
|
nnoremap Lt :call ToggleLocationList()<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
|
2019-11-05 07:18:13 +01:00
|
|
|
nnoremap gh <C-w>h
|
|
|
|
nnoremap gj <C-w>j
|
|
|
|
nnoremap gk <C-w>k
|
|
|
|
nnoremap gl <C-w>l
|
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}))
|
2019-12-10 06:22:04 +01:00
|
|
|
|
2019-12-24 04:14:27 +01:00
|
|
|
" Tag helpers
|
2019-12-23 06:54:19 +01:00
|
|
|
map <C-\> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
|
|
|
|
map <A-]> :sp <CR>:exec("tag ".expand("<cword>"))<CR>
|
|
|
|
|
2019-12-24 04:14:27 +01:00
|
|
|
" Tabular helpers
|
|
|
|
vmap a= :Tabularize /=<CR>
|
|
|
|
vmap a; :Tabularize /::<CR>
|
|
|
|
vmap a- :Tabularize /-><CR>
|
|
|
|
vmap a: :Tabularize /:r1c1l0<CR>
|
|
|
|
|
2019-12-06 16:35:31 +01:00
|
|
|
command! -bang -nargs=* GGrep
|
|
|
|
\ 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-04 08:08:00 +01:00
|
|
|
" --------------------------- Autocmd groups ---------------------------------
|
2019-12-10 04:15:33 +01:00
|
|
|
augroup vimplug_maps
|
|
|
|
au!
|
2019-12-30 11:59:11 +01:00
|
|
|
au FileType vim nmap pg :PlugUpgrade<CR>
|
|
|
|
au FileType vim nmap pd :PlugUpdate<CR>
|
|
|
|
au FileType vim nmap pc :PlugClean<CR>
|
2019-12-30 12:37:11 +01:00
|
|
|
au FileType vim nmap pr :so %<CR>
|
2019-12-10 04:15:33 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup haskell_maps
|
2019-12-05 09:55:46 +01:00
|
|
|
au!
|
2019-12-24 09:27:05 +01:00
|
|
|
au FileType haskell nmap <LocalLeader>t :NeomakeSh stack exec -- fast-tags -R .<CR>
|
|
|
|
au FileType haskell nmap <LocalLeader>g :Ghcid<CR>
|
|
|
|
au FileType haskell nmap <LocalLeader>k :GhcidKill<CR>
|
|
|
|
au FileType haskell nmap <LocalLeader>c :HoogleClose<CR>
|
|
|
|
au FileType haskell nmap <LocalLeader>o :exe ':Hoogle ' . expand('<cword>')<CR>
|
|
|
|
au FileType haskell nmap <LocalLeader>i :exe ':HoogleInfo ' . expand('<cword>')<CR>
|
2019-12-23 06:18:42 +01:00
|
|
|
au FileType haskell setlocal keywordprg=:Hoogle
|
2019-12-05 09:55:46 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-28 09:06:00 +01:00
|
|
|
augroup purescript_maps
|
2019-12-10 11:08:30 +01:00
|
|
|
au!
|
2019-12-28 06:58:26 +01:00
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>L :Plist<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>l :Pload<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>r :Prebuild<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>f :PaddClause<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>T :PaddType<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>a :Papply<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>c :Pcase<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>i :Pimport<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>q :PaddImportQualifications<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>g :Pgoto<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>p :Pursuit<CR>
|
|
|
|
au FileType purescript nmap <buffer> <silent> <LocalLeader>t :Ptype<CR>
|
|
|
|
au FileType purescript au BufWritePost <buffer> Prebuild
|
2019-12-30 12:01:52 +01:00
|
|
|
au FileType purescript setlocal keywordprg=:Pursuit
|
2019-12-10 11:08:30 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup c_maps
|
2019-12-05 09:55:46 +01:00
|
|
|
au!
|
2019-12-24 09:27:05 +01:00
|
|
|
au FileType c nmap <LocalLeader>ct :NeomakeSh ctags -R .<CR>
|
|
|
|
au FileType c nmap <LocalLeader>cu :NeomakeSh cscope -bqR<CR>
|
|
|
|
au FileType c nmap <LocalLeader>cr :cs reset<CR>
|
2019-12-05 09:55:46 +01:00
|
|
|
|
2019-12-24 09:27:05 +01:00
|
|
|
au FileType c nmap <silent> <LocalLeader>s :call Cscope('0', expand('<cword>'))<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader>g :call Cscope('1', expand('<cword>'))<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader>d :call Cscope('2', expand('<cword>'))<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader>c :call Cscope('3', expand('<cword>'))<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader>t :call Cscope('4', expand('<cword>'))<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader>e :call Cscope('6', expand('<cword>'))<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader>f :call Cscope('7', expand('<cword>'))<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader>i :call Cscope('8', expand('<cword>'))<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader>a :call Cscope('9', expand('<cword>'))<CR>
|
2019-12-12 15:11:53 +01:00
|
|
|
|
2019-12-24 09:27:05 +01:00
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>s :call CscopeQuery('0')<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>g :call CscopeQuery('1')<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>d :call CscopeQuery('2')<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>c :call CscopeQuery('3')<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>t :call CscopeQuery('4')<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>e :call CscopeQuery('6')<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>f :call CscopeQuery('7')<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>i :call CscopeQuery('8')<CR>
|
|
|
|
au FileType c nmap <silent> <LocalLeader><LocalLeader>a :call CscopeQuery('9')<CR>
|
2019-12-05 09:55:46 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup rust_maps
|
2019-12-05 09:55:46 +01:00
|
|
|
au!
|
2019-12-23 06:54:19 +01:00
|
|
|
au FileType rust nmap <buffer> gd <plug>DeopleteRustGoToDefinitionDefault
|
|
|
|
au FileType rust nmap <buffer> K <plug>DeopleteRustShowDocumentation
|
|
|
|
au FileType rust nmap <buffer> gv <plug>DeopleteRustGoToDefinitionVSplit
|
2019-12-30 11:59:11 +01:00
|
|
|
au FileType rust nmap <buffer> g- <plug>DeopleteRustGoToDefinitionSplit
|
2019-12-23 06:54:19 +01:00
|
|
|
au FileType rust nmap <buffer> gt <plug>DeopleteRustGoToDefinitionTab
|
2019-12-30 12:37:11 +01:00
|
|
|
" Taken from http://seenaburns.com/vim-setup-for-rust/
|
|
|
|
" Neomake
|
|
|
|
" Gross hack to stop Neomake running when exitting because it creates a zombie cargo check process
|
|
|
|
" which holds the lock and never exits. But then, if you only have QuitPre, closing one pane will
|
|
|
|
" disable neomake, so BufEnter reenables when you enter another buffer.
|
|
|
|
let s:quitting = 0
|
|
|
|
au FileType rust au QuitPre let s:quitting = 1
|
|
|
|
au FileType rust au BufEnter let s:quitting = 0
|
|
|
|
au FileType rust au BufWritePost if ! s:quitting | Neomake | else | echom "Neomake disabled" | endif
|
2019-09-24 17:15:37 +02:00
|
|
|
augroup END
|
|
|
|
|
2019-10-29 07:15:54 +01:00
|
|
|
augroup rainbow_lisp
|
2019-12-05 09:55:46 +01:00
|
|
|
autocmd!
|
|
|
|
autocmd FileType lisp,clojure,scheme RainbowParentheses
|
2019-10-29 07:15:54 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-01 17:01:18 +01:00
|
|
|
" Toggles search highlighting off/on according to current mode. Source: http://blog.sanctum.geek.nz/vim-search-highlighting/
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup toggle_search
|
2019-12-01 17:01:18 +01:00
|
|
|
autocmd!
|
|
|
|
autocmd InsertEnter * setlocal nohlsearch
|
|
|
|
autocmd InsertLeave * setlocal hlsearch
|
|
|
|
augroup END
|
|
|
|
|
2019-12-03 13:42:36 +01:00
|
|
|
" Close QF window if it is last window
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup quickfix_close
|
2019-12-05 09:55:46 +01:00
|
|
|
au!
|
|
|
|
au WinEnter * if winnr('$') == 1 && &buftype == "quickfix"|q|endif
|
2019-12-03 13:42:36 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup terminal_job
|
2019-12-05 09:55:46 +01:00
|
|
|
au!
|
|
|
|
au TermOpen * setlocal statusline=%{b:terminal_job_id}
|
2019-12-04 08:08:00 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup indentation_defaults
|
|
|
|
au!
|
|
|
|
au BufRead,BufNewFile *.c set noexpandtab
|
|
|
|
au BufRead,BufNewFile *.h set noexpandtab
|
|
|
|
au BufRead,BufNewFile Makefile* set noexpandtab
|
|
|
|
au BufNewFile,BufRead *.vim setlocal noet ts=4 sw=4 sts=4
|
|
|
|
au BufNewFile,BufRead *.txt setlocal noet ts=4 sw=4
|
2019-12-28 06:59:08 +01:00
|
|
|
au BufNewFile,BufRead *.lua setlocal noet ts=4 sw=4 sts=4
|
|
|
|
au BufNewFile,BufRead *.py setlocal tabstop=4 softtabstop=4 shiftwidth=4 textwidth=80 smarttab expandtab
|
|
|
|
au BufRead,BufNewFile */gst-*/*.[ch] set et sw=2
|
|
|
|
au BufRead,BufNewFile */gstreamer-*/*.[ch] set et sw=2
|
|
|
|
au BufRead,BufNewFile */pulseaudio/*.[ch] set et sw=4 tw=128
|
|
|
|
au BufRead,BufNewFile *.purs set et sw=2 sts=2 si
|
|
|
|
au FileType fstab,systemd set noexpandtab
|
|
|
|
au FileType gitconfig,sh,toml set noexpandtab
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup END
|
|
|
|
|
|
|
|
augroup spell_check
|
|
|
|
au!
|
2019-12-21 15:54:16 +01:00
|
|
|
autocmd FileType gitcommit setlocal spell textwidth=72
|
2019-12-09 14:46:59 +01:00
|
|
|
autocmd BufRead,BufNewFile *.md,*.txt setlocal spell
|
2019-12-08 07:54:17 +01:00
|
|
|
augroup END
|
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
" Automatically resize the window
|
|
|
|
autocmd VimResized * wincmd =
|
|
|
|
|
|
|
|
" --------------------------- Plugin settings --------------------------------
|
2019-09-25 05:34:51 +02:00
|
|
|
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
|
|
|
|
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
|
|
|
|
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
|
|
|
|
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
|
|
|
|
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
|
|
|
|
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
|
|
|
|
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
|
|
|
|
|
2019-10-24 18:21:54 +02:00
|
|
|
let g:haskell_classic_highlighting = 0
|
2019-09-25 05:34:51 +02:00
|
|
|
let g:haskell_indent_if = 3
|
|
|
|
let g:haskell_indent_case = 2
|
|
|
|
let g:haskell_indent_let = 4
|
|
|
|
let g:haskell_indent_where = 6
|
|
|
|
let g:haskell_indent_before_where = 2
|
|
|
|
let g:haskell_indent_after_bare_where = 2
|
|
|
|
let g:haskell_indent_do = 3
|
|
|
|
let g:haskell_indent_in = 1
|
|
|
|
let g:haskell_indent_guard = 2
|
|
|
|
let g:haskell_indent_case_alternative = 1
|
|
|
|
let g:cabal_indent_section = 2
|
2019-11-04 05:42:38 +01:00
|
|
|
let g:ghcid_command = 'stack exec -- ghcid'
|
2019-11-04 06:59:31 +01:00
|
|
|
let g:hoogle_search_bin = 'stack exec -- hoogle'
|
2019-11-19 16:08:00 +01:00
|
|
|
let g:hoogle_search_count = 30
|
2019-09-25 05:34:51 +02:00
|
|
|
|
2019-02-14 10:00:24 +01:00
|
|
|
" Use deoplete
|
|
|
|
let g:deoplete#enable_at_startup = 1
|
2019-09-24 17:15:37 +02:00
|
|
|
let g:deoplete#sources = {}
|
|
|
|
call deoplete#custom#source('_',
|
|
|
|
\ 'disabled_syntaxes', ['Comment', 'String'])
|
|
|
|
call deoplete#custom#option('sources', {
|
2019-12-06 09:35:03 +01:00
|
|
|
\ '_' : ['buffer', 'tag', 'around', 'file', 'member'],
|
|
|
|
\ 'rust': ['racer'],
|
2019-12-28 09:06:00 +01:00
|
|
|
\ 'purescript': ['buffer', 'omni'],
|
2019-12-06 09:35:03 +01:00
|
|
|
\})
|
2019-12-28 09:06:00 +01:00
|
|
|
call deoplete#custom#source('omni', 'functions', {
|
|
|
|
\ 'purescript': 'PSCIDEComplete',
|
|
|
|
\})
|
|
|
|
call deoplete#custom#var('omni', 'input_patterns', {
|
|
|
|
\ 'purescript': '\w*',
|
|
|
|
\})
|
2019-12-06 09:35:03 +01:00
|
|
|
call deoplete#custom#option({
|
|
|
|
\ 'auto_complete_delay': 200,
|
|
|
|
\ 'auto_complete': v:true,
|
|
|
|
\ 'smart_case': v:true,
|
|
|
|
\ })
|
2019-09-24 17:15:37 +02:00
|
|
|
let g:deoplete#sources#rust#disable_keymap = 1
|
2019-09-25 05:34:51 +02:00
|
|
|
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')
|
2019-12-01 17:30:38 +01:00
|
|
|
let g:rustfmt_autosave = 1
|
2017-02-18 12:30:11 +01:00
|
|
|
|
2019-07-04 18:13:19 +02:00
|
|
|
" Use airline
|
2019-12-04 03:29:57 +01:00
|
|
|
let g:airline#extensions#tabline#enabled = 1
|
2017-02-14 20:51:44 +01:00
|
|
|
let g:airline#extensions#tabline#fnamemod = ':t'
|
|
|
|
let g:airline#extensions#tabline#left_sep = ' '
|
|
|
|
let g:airline#extensions#tabline#left_alt_sep = '|'
|
|
|
|
let g:airline#extensions#tabline#right_sep = ' '
|
|
|
|
let g:airline#extensions#tabline#right_alt_sep = '|'
|
2019-12-04 03:29:57 +01:00
|
|
|
let g:airline#extensions#tabline#formatter = 'default'
|
2017-02-14 20:51:44 +01:00
|
|
|
let g:airline_left_sep = ' '
|
|
|
|
let g:airline_left_alt_sep = '|'
|
|
|
|
let g:airline_right_sep = ' '
|
|
|
|
let g:airline_right_alt_sep = '|'
|
2019-11-16 16:06:31 +01:00
|
|
|
let g:airline#extensions#tabline#buffer_nr_show = 1
|
2019-02-11 16:26:11 +01:00
|
|
|
|
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
|
|
|
|
" compile when I open a file, change text, leave insert mode, etc ...
|
|
|
|
call neomake#configure#automake({
|
|
|
|
\ 'TextChanged': {},
|
|
|
|
\ 'InsertLeave': {},
|
|
|
|
\ 'BufWritePost': {},
|
|
|
|
\ })
|
|
|
|
" 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 = {
|
|
|
|
\ '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
|
2019-10-30 15:12:51 +01:00
|
|
|
" Additional trigger not required with deoplete
|
|
|
|
let g:tmuxcomplete#trigger = ''
|
2019-11-25 17:15:20 +01:00
|
|
|
" Required for vimtex
|
|
|
|
let g:vimtex_compiler_progname = 'nvr'
|
|
|
|
" Fix deoplete's tab behaviour
|
|
|
|
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-12-04 06:12:45 +01:00
|
|
|
" Slime
|
|
|
|
let g:slime_target = "neovim"
|
|
|
|
let g:slime_no_mappings = 1
|
|
|
|
let g:slime_python_ipython = 1
|
|
|
|
let g:slime_dont_ask_default = 1
|
|
|
|
let g:slime_preserve_curpos = 0
|
2019-10-25 07:18:49 +02:00
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
let g:nvimgdb_config_override = {
|
|
|
|
\ '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-06 06:01:46 +01:00
|
|
|
let g:cpp_class_scope_highlight = 1
|
|
|
|
let g:cpp_member_variable_highlight = 1
|
|
|
|
let g:cpp_class_decl_highlight = 1
|
|
|
|
let g:cpp_posix_standard = 1
|
|
|
|
let g:cpp_concepts_highlight = 1
|
|
|
|
|
2019-12-08 13:21:33 +01:00
|
|
|
let g:UltiSnipsExpandTrigger="<Tab>"
|
|
|
|
let g:UltiSnipsJumpForwardTrigger="<C-b>"
|
|
|
|
let g:UltiSnipsJumpBackwardTrigger="<C-z>"
|
|
|
|
let g:UltiSnipsEditSplit="vertical"
|
|
|
|
|
2019-12-23 06:54:19 +01:00
|
|
|
let g:jedi#goto_command = "gt"
|
|
|
|
let g:jedi#goto_assignments_command = "ga"
|
|
|
|
let g:jedi#goto_definitions_command = "gd"
|
|
|
|
let g:jedi#documentation_command = "K"
|
|
|
|
let g:jedi#usages_command = "gu"
|
2019-12-10 07:59:13 +01:00
|
|
|
let g:jedi#completions_command = "<Tab>"
|
2019-12-23 06:54:19 +01:00
|
|
|
let g:jedi#rename_command = "gr"
|
2019-12-10 07:59:13 +01:00
|
|
|
|
|
|
|
let g:jedi#auto_initialization = 1
|
|
|
|
let g:jedi#auto_vim_configuration = 0
|
|
|
|
let g:jedi#use_tabs_not_buffers = 1
|
|
|
|
let g:jedi#popup_on_dot = 1
|
|
|
|
let g:jedi#popup_select_first = 0
|
|
|
|
let g:jedi#smart_auto_mappings = 0
|
|
|
|
let g:jedi#show_call_signatures = "1"
|
|
|
|
let g:jedi#show_call_signatures_delay = 0
|
|
|
|
let g:jedi#show_call_signatures_modes = 'i'
|
|
|
|
let g:jedi#enable_speed_debugging = 0
|
|
|
|
let g:jedi#completions_enabled = 0
|
|
|
|
|
2019-12-11 04:05:19 +01:00
|
|
|
let g:netrw_banner = 0
|
|
|
|
let g:netrw_liststyle = 3
|
|
|
|
let g:netrw_browse_split = 4
|
|
|
|
let g:netrw_altv = 1
|
|
|
|
let g:netrw_winsize = 10
|
2019-12-12 15:11:53 +01:00
|
|
|
|
2019-12-15 11:44:53 +01:00
|
|
|
" For SLIMV
|
|
|
|
let g:lisp_rainbow=1
|
|
|
|
|
2019-12-28 09:06:00 +01:00
|
|
|
" For Purescript
|
|
|
|
let g:psc_ide_auto_imports = 1
|
|
|
|
|
2019-12-04 08:08:00 +01:00
|
|
|
" ----------------------------- Functions ------------------------------------
|
2019-12-12 15:11:53 +01:00
|
|
|
function! Cscope(option, query)
|
|
|
|
let color = '{ x = $1; $1 = ""; z = $3; $3 = ""; printf "\033[34m%s\033[0m:\033[31m%s\033[0m\011\033[37m%s\033[0m\n", x,z,$0; }'
|
|
|
|
let opts = {
|
|
|
|
\ 'source': "cscope -dL" . a:option . " " . a:query . " | awk '" . color . "'",
|
|
|
|
\ 'options': ['--ansi', '--prompt', '> ',
|
|
|
|
\ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
|
|
|
|
\ '--color', 'info:144,prompt:161,spinner:135,pointer:135,marker:118',
|
|
|
|
\ '--color', 'fg:252,bg:233,hl:67,fg+:252,bg+:235,hl+:81'],
|
|
|
|
\ 'down': '40%'
|
|
|
|
\ }
|
|
|
|
function! opts.sink(lines)
|
|
|
|
let data = split(a:lines)
|
|
|
|
let file = split(data[0], ":")
|
|
|
|
execute 'e ' . '+' . file[1] . ' ' . file[0]
|
|
|
|
endfunction
|
|
|
|
call fzf#run(opts)
|
2019-10-30 18:12:33 +01:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! CscopeQuery(option)
|
2019-12-12 15:11:53 +01:00
|
|
|
call inputsave()
|
|
|
|
if a:option == '0'
|
|
|
|
let query = input('C Symbol: ')
|
|
|
|
elseif a:option == '1'
|
|
|
|
let query = input('Definition: ')
|
|
|
|
elseif a:option == '2'
|
|
|
|
let query = input('Functions called by: ')
|
|
|
|
elseif a:option == '3'
|
|
|
|
let query = input('Functions calling: ')
|
|
|
|
elseif a:option == '4'
|
|
|
|
let query = input('Text: ')
|
|
|
|
elseif a:option == '6'
|
|
|
|
let query = input('Egrep: ')
|
|
|
|
elseif a:option == '7'
|
|
|
|
let query = input('File: ')
|
|
|
|
elseif a:option == '8'
|
|
|
|
let query = input('Files #including: ')
|
|
|
|
elseif a:option == '9'
|
|
|
|
let query = input('Assignments to: ')
|
|
|
|
else
|
|
|
|
echo "Invalid option!"
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
call inputrestore()
|
|
|
|
if query != ""
|
|
|
|
call Cscope(a:option, query)
|
|
|
|
else
|
|
|
|
echom "Cancelled Search!"
|
|
|
|
endif
|
2019-10-30 18:12:33 +01:00
|
|
|
endfunction
|
|
|
|
|
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
|
|
|
|
|
|
|
let $FZF_DEFAULT_OPTS='--layout=reverse'
|
|
|
|
let g:fzf_layout = { 'window': 'call FloatingFZF()' }
|
|
|
|
function! FloatingFZF()
|
|
|
|
let buf = nvim_create_buf(v:false, v:true)
|
|
|
|
let height = float2nr(&lines * 0.4)
|
|
|
|
let width = float2nr(&columns * 0.8)
|
|
|
|
let horizontal = float2nr((&columns - width) / 2)
|
|
|
|
let vertical = float2nr((&columns - width) / 2)
|
|
|
|
|
|
|
|
let opts = {
|
|
|
|
\ 'relative': 'editor',
|
|
|
|
\ 'row': vertical,
|
|
|
|
\ 'col': horizontal,
|
|
|
|
\ 'width': width,
|
|
|
|
\ 'height': height
|
|
|
|
\ }
|
|
|
|
|
|
|
|
" open the new window, floating, and enter to it
|
|
|
|
call nvim_open_win(buf, v:true, opts)
|
|
|
|
endfunction
|
2019-12-10 06:22:04 +01:00
|
|
|
|
|
|
|
function! s:incsearch_config(...) abort
|
|
|
|
return incsearch#util#deepextend(deepcopy({
|
|
|
|
\ 'modules': [incsearch#config#easymotion#module({'overwin': 1})],
|
|
|
|
\ 'keymap': {
|
|
|
|
\ "\<CR>": '<Over>(easymotion)'
|
|
|
|
\ },
|
|
|
|
\ 'is_expr': 0
|
|
|
|
\ }), get(a:, 1, {}))
|
|
|
|
endfunction
|