-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
206 lines (166 loc) · 5.62 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'bling/vim-airline'
Plugin 'chriskempson/base16-vim'
Plugin 'honza/vim-snippets'
" Haskell plugins
Plugin 'enomsg/vim-haskellConcealPlus'
Plugin 'lukerandall/haskellmode-vim'
"Plugin 'eagletmt/ghcmod-vim'
Plugin 'eagletmt/neco-ghc'
" Terraform
Plugin 'hashivim/vim-terraform'
Plugin 'juliosueiras/vim-terraform-completion'
" Groovy/Jenkins
Plugin 'vim-scripts/groovy.vim'
" Ruby
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-cucumber'
Plugin 'junegunn/vim-easy-align'
Plugin 'jceb/vim-orgmode'
Plugin 'majutsushi/tagbar'
Plugin 'rking/ag.vim'
Plugin 'sirver/ultisnips'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/syntastic'
Plugin 'Shougo/unite.vim'
Plugin 'Shougo/vimproc'
Plugin 'sjl/gundo.vim'
"Plugin 'terryma/vim-multiple-cursors'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-ragtag'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-sleuth'
Plugin 'Valloric/YouCompleteMe'
Plugin 'vim-scripts/Align'
Plugin 'vim-scripts/VisIncr'
Plugin 'vimwiki/vimwiki'
Plugin 'vim-pandoc/vim-pandoc'
Plugin 'vim-pandoc/vim-pandoc-syntax'
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"This sets 256 colours as options in Vim.
"
if !exists('g:colors_name') || g:colors_name != 'base16-eighties'
set t_Co=256
let base16colorspace=256
set background=dark
colorscheme base16-eighties
endif
"This sets the number of items to save in the history
set history=1000
"This maps maps turning on and off spell checking with the F12 key
map <leader>s :set spell!<cr>
"Turn on spell checking with English dictionary
set spell
set spelllang=en_gb
set spellsuggest=9 "show only 9 suggestions for misspelled words
" Use incremental search, begins highlighting matches as you type.
set incsearch
" Enable the use of the mouse for visual mode editing.
set mouse=a
" so that the mouse works in tmux
set ttymouse=xterm2
" In visual mode when you press * or # to search for the current selection
vnoremap <silent> * :call VisualSearch('f')<CR>
vnoremap <silent> # :call VisualSearch('b')<CR>
" This is the actual Visual Search function.
function! VisualSearch(direction) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", '\\/.*$^~[]')
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'b'
execute "normal ?" . l:pattern . "^M"
elseif a:direction == 'gv'
call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.')
elseif a:direction == 'f'
execute "normal /" . l:pattern . "^M"
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
" This enables automatic indentation as you type.
filetype indent on
syntax on
filetype indent plugin on
set tabstop=8
set expandtab
set softtabstop=4
set shiftwidth=4
filetype indent on
"line numbering
set number
" ctrl+n to open up nertree...
map <C-n> :NERDTreeToggle<CR>
let NERDTreeIgnore = ['\.pyc$','\.hi$','\.o$','^.pytest_cache$', '^.git$']
let NERDTreeShowHidden=1
" indent and break marker on linewrap
set breakindent
set showbreak=\|..
" Ensure that the air/(power) line is visible on startup
set laststatus=2
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
" Trigger configuration. Do not use <tab> if you use
" https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsJumpForwardTrigger="<c-k>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" line highlighting when in insert mode.
hi Cursor ctermfg=red ctermbg=black
au InsertEnter * hi CursorLineNr ctermfg=red
au InsertLeave * hi CursorLineNr ctermfg=yellow
au InsertEnter * hi CursorLine cterm=none
au InsertEnter * set cursorline
au InsertLeave * set nocursorline
" XML folding
let g:xml_syntax_folding=1
au FileType xml setlocal foldmethod=syntax
map <leader>t "=strftime("%d/%m/%y %H:%M - ")<CR>Pa
nmap <C-b> :TagbarToggle<CR>
" haskellmode settings
let g:haddock_browser="/usr/bin/firefox"
au BufEnter *.hs compiler ghc
" Use neco-ghc as the backend for YCM completion.
setlocal omnifunc=necoghc#omnifunc
let g:ycm_semantic_triggers = {'haskell' : ['.']}
map <leader>s :%!stylish-haskell<CR>
" 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)
" Terraform indentation
let g:terraform_align=1
"Groovy highlighting in Jenkinsfile
au BufNewFile,BufRead Jenkinsfile setf groovy
" Hide Info(Preview) window after completions
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
" Enable terraform plan to be include in filter
let g:syntastic_terraform_tffilter_plan = 1
" Remap split switching commands
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>