aboutsummaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorMax Christian Pohle2016-11-05 22:14:01 +0100
committerMax Christian Pohle2016-11-05 22:14:01 +0100
commit4eaae3ff84995bce605f4c3553ad511a179d0c4b (patch)
tree7be7c81c73df5ab957340e71710b57b0bfe8d021 /vimrc
parent30b7055bf6ce68999059154058c2db74eb01a445 (diff)
downloadvim-4eaae3ff84995bce605f4c3553ad511a179d0c4b.tar.bz2
vim-4eaae3ff84995bce605f4c3553ad511a179d0c4b.zip
Added ikeymap: <leader><leader> for autosnipets
<leader><leader> lists all possible completions, <leader><tab> automatically inserts first snippet. This feature depends on the filetype (set ft). The filetype can have two values simultaneously, in which case the separator is a dot, like in html.django or html.css.
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc86
1 files changed, 53 insertions, 33 deletions
diff --git a/vimrc b/vimrc
index c98cac6..5ab571a 100644
--- a/vimrc
+++ b/vimrc
@@ -4,6 +4,7 @@ call plug#begin()
4Plug 'tpope/vim-sensible' | " a sane and modern default configuration 4Plug 'tpope/vim-sensible' | " a sane and modern default configuration
5Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' 5Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with '
6Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin 6Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin
7Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/=
7Plug 'mhinz/vim-signify' | " show changes in the clutter bar 8Plug 'mhinz/vim-signify' | " show changes in the clutter bar
8 9
9 10
@@ -64,12 +65,12 @@ let g:airline_theme='base16' | " specifies which colors
64" Additional: ========================================. 65" Additional: ========================================.
65Plug 'sheerun/vim-polyglot' " better syntax highlighting/indentation for multiple languages 66Plug 'sheerun/vim-polyglot' " better syntax highlighting/indentation for multiple languages
66Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more 67Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more
67let g:tagbar_autoclose = 1 68let g:tagbar_autoclose = 1
68let g:tagbar_autofocus = 1 69let g:tagbar_autofocus = 1
69let g:tagbar_autoshowtag = 1 70let g:tagbar_autoshowtag = 1
70let g:tagbar_compact = 0 71let g:tagbar_compact = 0
71let g:tagbar_indent = 0 72let g:tagbar_indent = 0
72let g:tagbar_foldlevel = 99 73let g:tagbar_foldlevel = 99
73nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L 74nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L
74 75
75 76
@@ -84,7 +85,9 @@ let g:ycm_min_num_of_chars_for_completion = 1
84let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword 85let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword
85let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure 86let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure
86let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar 87let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar
87 88" disable <tab>-key for YCM so that it can be used with ultisnips
89" let g:ycm_key_list_select_completion=[]
90" let g:ycm_key_list_previous_completion=[]
88 91
89 92
90Plug 'scrooloose/syntastic' 93Plug 'scrooloose/syntastic'
@@ -92,36 +95,40 @@ set statusline+=%#warningmsg#
92set statusline+=%{SyntasticStatuslineFlag()} 95set statusline+=%{SyntasticStatuslineFlag()}
93set statusline+=%* 96set statusline+=%*
94set signcolumn=yes " always show the column 97set signcolumn=yes " always show the column
95let g:LatexBox_latexmk_preview_continuously = 1 98let g:LatexBox_latexmk_preview_continuously = 1
96let g:LatexBox_viewer = "evince" 99let g:LatexBox_viewer = "evince"
97let g:syntastic_always_populate_loc_list = 1 100let g:syntastic_always_populate_loc_list = 1
98let g:syntastic_auto_loc_list = 0 101let g:syntastic_auto_loc_list = 0
99let g:syntastic_check_on_open = 1 102let g:syntastic_check_on_open = 1
100let g:syntastic_check_on_wq = 0 103let g:syntastic_check_on_wq = 0
101let g:syntastic_quiet_messages = {"type":"style"} " filter (=do not display) style/formatting errors and warnings 104let g:syntastic_quiet_messages = {"type":"style"} " filter ( = do not display) style/formatting errors and warnings
102" Syntastic 105" Syntastic
103let g:syntastic_error_symbol = '✖' 106let g:syntastic_error_symbol = '✖'
104let g:syntastic_style_error_symbol = '✗' 107let g:syntastic_style_error_symbol = '✗'
105let g:syntastic_warning_symbol = '➔' 108let g:syntastic_warning_symbol = '➔'
106let g:syntastic_style_warning_symbol = '≈' 109let g:syntastic_style_warning_symbol = '≈'
107 110
108Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures 111Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures
109let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe 112let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe
110let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi 113let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi
111let g:jedi#show_call_signatures_delay = 0 114let g:jedi#show_call_signatures_delay = 0
112let g:jedi#auto_vim_configure = 0 115let g:jedi#auto_vim_configure = 0
113let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 116let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163
114" autocmd FileType python jedi.preload_module('os', 'sys', 'math') 117" autocmd FileType python jedi.preload_module('os', 'sys', 'math')
115" let g:pymode_options_max_line_length = 120 118" let g:pymode_options_max_line_length = 120
116" let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' 119" let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301'
117 120
118Plug 'honza/vim-snippets' " dependency of ultisnips (see below) 121Plug 'honza/vim-snippets' " dependency of ultisnips (see below)
119Plug 'SirVer/ultisnips' " replaces loremipsum (and many more) 122Plug 'SirVer/ultisnips' " replaces loremipsum (and many more)
120let g:UltiSnipsExpandTrigger = '<C-j>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. 123"let g:UltiSnipsExpandTrigger = '<C-j>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
121let g:UltiSnipsJumpForwardTrigger = '<C-j>'| " \ 124"let g:UltiSnipsJumpForwardTrigger = '<C-j>'| " \
122let g:UltiSnipsJumpBackwardTrigger = '<C-k>'| " \ 125"let g:UltiSnipsJumpBackwardTrigger = '<C-k>'| " \
123" let g:UltiSnipsListSnippets = '<c-s-tab>'| " YouCompleteMe includes those, so this isn't necessary 126"let g:UltiSnipsListSnippets = '<C-`>'| " YouCompleteMe includes those, so this isn't necessary
124" let g:UltiSnipsEditSplit = 'vertical' 127let g:UltiSnipsExpandTrigger = '<leader><tab>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
128let g:UltiSnipsJumpForwardTrigger = '<PageDown>'| " \
129let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \
130let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary
131" let g:UltiSnipsEditSplit = 'vertical'
125 132
126 133
127" Disabled ===========================================. 134" Disabled ===========================================.
@@ -151,10 +158,12 @@ inoremap
151 \ <C-Backspace> 158 \ <C-Backspace>
152 \ <C-W> 159 \ <C-W>
153 160
161noremap <silent> <F5> :make<CR>
162
154 163
155 164
156" settings ============================================. 165" settings ============================================.
157" set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here 166set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here
158" set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END 167" set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END
159" set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text 168" set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text
160set breakindent | " Every wrapped line will continue visually indented 169set breakindent | " Every wrapped line will continue visually indented
@@ -174,7 +183,7 @@ set mouse=a | " also supported by vim, should be default
174set nocursorcolumn | " turn visual cursor column off (improves performance) 183set nocursorcolumn | " turn visual cursor column off (improves performance)
175set nocursorline | " turn visual cursor line off (improves performance) 184set nocursorline | " turn visual cursor line off (improves performance)
176set nofoldenable | " disable code folding. I hate code folding 185set nofoldenable | " disable code folding. I hate code folding
177set norelativenumber | " we deactivate relative numbers, but have them mentioned here so we won't forget they existed 186set relativenumber | " relative line numbers can speed up navigation
178set noshowmode | " because we are using some powerline derivat 187set noshowmode | " because we are using some powerline derivat
179set nostartofline | " when scrolling: do not move the cursor to column 1 188set nostartofline | " when scrolling: do not move the cursor to column 1
180set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals 189set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals
@@ -185,7 +194,7 @@ set redrawtime=400 | " The time in milliseconds for redrawing the dis
185set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge 194set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge
186set spell spelllang=en,de | " enable spell checker 195set spell spelllang=en,de | " enable spell checker
187set splitbelow | " open new windows below the current one (i find that more intuitive) 196set splitbelow | " open new windows below the current one (i find that more intuitive)
188set t_Co=256 | " required on some ssh sessions 197" set t_Co=256 | " required on some ssh sessions
189set textwidth=100 | " line length (80 used to be default, but...) 198set textwidth=100 | " line length (80 used to be default, but...)
190set thesaurus+=/home/max/.vim/thesaurus/php.txt 199set thesaurus+=/home/max/.vim/thesaurus/php.txt
191set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) 200set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth)
@@ -224,7 +233,7 @@ if bufname('%') == ''
224 set bufhidden=wipe 233 set bufhidden=wipe
225endif 234endif
226 235
227" noautocmd 236noautocmd
228 237
229if has("autocmd") 238if has("autocmd")
230 set modeline | " set variables specific to a file, like indentation by adding a comment 239 set modeline | " set variables specific to a file, like indentation by adding a comment
@@ -283,6 +292,13 @@ if has("autocmd")
283 autocmd FileType vim setlocal keywordprg=:help |. 292 autocmd FileType vim setlocal keywordprg=:help |.
284 augroup END 293 augroup END
285 294
295
296 augroup ChangeCursor
297 autocmd VimEnter * let &t_EI .= "\<Esc>[0 q"
298 autocmd VimEnter * let &t_SI = "\<Esc>]12;white\x7"
299 autocmd VimLeave * silent !echo -ne "\033]112\007"
300 augroup END
301
286 "set omnifunc=syntaxcomplete#Complete 302 "set omnifunc=syntaxcomplete#Complete
287 " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main 303 " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main
288 " Enable omni completion. 304 " Enable omni completion.
@@ -303,7 +319,11 @@ endif
303 319
304 320
305let base16colorspace=256 321let base16colorspace=256
306colorscheme base16-phd 322if filereadable(expand("~/.vimrc_background"))
323 source ~/.vimrc_background
324else
325 colorscheme base16-phd
326endif
307" colorscheme base16-embers 327" colorscheme base16-embers
308" colorscheme base16-flat 328" colorscheme base16-flat
309" colorscheme base16-summerfruit-dark 329" colorscheme base16-summerfruit-dark
..