aboutsummaryrefslogtreecommitdiff
path: root/vimrc-old
diff options
context:
space:
mode:
authorMax Christian Pohle2018-10-29 18:02:40 +0100
committerMax Christian Pohle2018-10-29 18:02:40 +0100
commiteb2e7959987ebc405c7a03060f259655e13f01d0 (patch)
tree773e2b638c135fb9861567585f4ce82db252df98 /vimrc-old
parent6284983fedcbdc54874d6e657047994b292be480 (diff)
downloadvim-eb2e7959987ebc405c7a03060f259655e13f01d0.tar.bz2
vim-eb2e7959987ebc405c7a03060f259655e13f01d0.zip
Further cleaning finally done
Diffstat (limited to 'vimrc-old')
-rw-r--r--vimrc-old303
1 files changed, 0 insertions, 303 deletions
diff --git a/vimrc-old b/vimrc-old
deleted file mode 100644
index c5bd4e6..0000000
--- a/vimrc-old
+++ /dev/null
@@ -1,303 +0,0 @@
1" vi:columns=160:list:ts=2:sts=2:sw=2
2"================================================================================
3" Vundle: plugin manager...
4set nocompatible | " do not try to be vi, be vim (required by Vundle)
5filetype off | " Vundle needs this
6set rtp+=~/.vim/bundle/Vundle.vim | " set runtimepath (required by Vundle)
7call vundle#begin('~/.vim/bundle/') | " location where Vundle searches&installs plugins
8
9" Plugin dependant configurations...
10Plugin 'tpope/vim-sensible' | " a sane and modern default configuration
11Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin
12Plugin 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with '
13Plugin 'tpope/vim-repeat' | " lets . (dot) repeat plugin macros as well, specifically vim-surround
14Plugin 'tpope/vim-vinegar' | " Improves :Explore
15Plugin 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values)
16
17Plugin 'tpope/vim-vividchalk' | " dark theme
18Plugin 'nelstrom/vim-mac-classic-theme' | " light theme
19
20Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion
21Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use
22Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back
23Plugin 'jeaye/color_coded' | " semantic highlighting with vim
24Plugin 'terryma/vim-multiple-cursors' | " displays visual block mode as cursors
25Plugin 'taglist-plus' | " quick code navigator
26Plugin 'jdonaldson/vaxe' | " code completion for haxe
27Plugin 'sheerun/vim-polyglot' | " better syntax highlighting/indentation for multiple languages
28Plugin 'loremipsum' | " Sample text generator
29Plugin 'vim-airline/vim-airline' | " beautification of the mode line
30Plugin 'nathanaelkane/vim-indent-guides' | " shows indentation guidelines by pressing <leader>ig
31Plugin 'gregsexton/matchtag' | " highlights closing ML tags like braces
32Plugin 'indenthtml.vim' | " works better with mixed html/css/javascript
33Plugin 'easymotion/vim-easymotion' | " speed up navigation: try \\w or \\f, then one of the highlighted chars
34Plugin 'Shougo/vimproc.vim'
35Plugin 'Shougo/vimshell.vim'
36Plugin 'jeetsukumaran/vim-buffergator' | " switch buffers with \b or <\-Left> <\-Right>
37
38let g:airline_powerline_fonts = 1
39
40let Tlist_Compact_Format = 1 | "
41let Tlist_GainFocus_On_ToggleOpen = 1 | "
42let Tlist_Close_On_Select = 1 | "
43
44Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required)
45let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py' | " fallback, right one should be in the applications path
46let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?'
47let g:ycm_key_select_completion = '<Tab>' | " key completion key
48let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar
49let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar
50let g:ycm_collect_identifiers_from_tags_files = 1 | "
51let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode
52"let g:ycm_semantic_triggers = {'c' : ['(', ',']} | " add additional triggers (not recommend)
53
54let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle
55let html_use_css = 1 | " when using :TOhtml no font-tags will be used, but proper css
56let g:vim_markdown_folding_disabled=1 | " disable code folding with vimdiff (also see set nofoldenable)
57
58let g:netrw_liststyle=3 | " Explore mode: 3 shows a complete tree instead of the current directory
59let g:netrw_list_hide='^\..*' | " Explore mode: hide files starting with dot
60
61
62" speed up CTRL-P Menu...
63let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
64 \ --ignore .git
65 \ --ignore .svn
66 \ --ignore .hg
67 \ --ignore .DS_Store
68 \ --ignore "**/*.pyc"
69 \ -g ""'
70
71call vundle#end() | " required by Vundle
72filetype plugin indent on | " required by Vundle
73"================================================================================
74" custom config
75colorscheme mac_classic
76" colorscheme coderonline
77syntax enable
78
79set noswapfile | " noundofile, nobackup, nowritebackup
80set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory
81set directory=~/.vim/temp | "
82set undodir=~/.vim/temp | "
83
84set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth)
85set autoindent | " always set autoindenting on
86set autochdir | " change to the current files working dir (might break some plugins!)
87set copyindent | " copy the previous indentation on autoindenting
88set scrolloff=2 | " always keeps at least two lines visible (when seeking)
89" set selectmode=mouse | " avoid using select mode (only with mouse)
90set mousemodel=popup_setpos | " display a default right click menu for the selection (that is c&p is possible)
91set selection=exclusive | " includes last character of the selection into following command (like x or d)
92
93set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap
94set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap
95set diffopt+=vertical,iwhite,filler | " lets diff ignore white spaces
96set spell spelllang=en,de | " enable spell checker
97set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore)
98set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews
99set linebreak | " do not wrap in the middle of words
100set display+=lastline | " do not show the @ symbol in the end of a long line
101set showcmd | " displays status line messages while selecting (matrix size)
102set nofoldenable | " do not fold code automatically
103set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include
104set wildmenu wildmode=full | " wildmenu code completion
105set guifont="Droid Sans Mono for Powerline 10"
106
107" search...
108set ignorecase smartcase | " if search pattern contains uppercase then search is case sensitive
109set incsearch | " do incremental searching
110set showmatch matchtime=4 | " blinks matching braces
111
112set novisualbell | " don't beep
113set noerrorbells | " don't beep
114set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well)
115set number | " toggle line numbers
116set formatprg=par | " set external formatting program to par, use gwip to format with this
117set laststatus=2 | " this is required for airline
118set cmdheight=1 | " controls how many lines the command line has
119set relativenumber | " displays current lines line no as zero point from where relative numbers are getting counted
120set timeoutlen=500 | " time between keys e.g. 80i=
121set ttimeoutlen=10 | " set esc key timeout in ms
122
123set splitbelow | " open new windows below the current one (i find that more intuitive)
124
125if has("multi_byte")
126 set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below)
127 scriptencoding utf-8 | " tell vim that we are using utf-8 here
128 set showbreak+=› | " symbol used in the beginning of a wrapped line
129 set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars)
130 set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars)
131 set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars)
132 set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars)
133 set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars)
134endif
135
136if has("autocmd")
137 set modeline | " set variables specific to a file, like indentation by adding a comment
138 set modelines=3 | " how many lines in the beginning and end of the file can be mode lines?
139
140 augroup resCur | " make cursor appear in its previous position when reopening a file...
141 autocmd BufReadPost * call setpos(".", getpos("'\""))
142 augroup END
143
144 augroup PreviewOnBottom | " will open new windows below the current (only in insert mode, so that the preview window is drawn below)
145 autocmd InsertEnter * set splitbelow
146 autocmd InsertLeave * set splitbelow!
147 augroup END
148
149 augroup OmniFunc | " this will enable omnicomplete just in case this configuration runs somewhere, where YouCompleteMe is not compiled
150 if exists("+omnifunc")
151 autocmd Filetype *
152 \ if &omnifunc == "" |
153 \ setlocal omnifunc=syntaxcomplete#Complete |
154 \ setlocal completeopt=longest,menuone |
155 \ endif
156 autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
157 endif
158 augroup END
159
160 autocmd FileType text setlocal textwidth=78 | " text files: set 'textwidth' to 78
161 autocmd FileType gitcommit set tw=72 | " longer commit messages without auto line wrapping
162 autocmd FileType LaTeX let g:tex_flavor = "latex"| set conceallevel=1| set concealcursor=
163 autocmd BufNewFile,BufReadPost *.config set filetype=xml | " visual studio config file
164 autocmd BufNewFile,BufReadPost *.csproj set filetype=xml | " visual studio project file
165 autocmd BufNewFile,BufReadPost *.sln set filetype=xml | " visual studio solution file
166endif
167
168"================================================================================
169" gui stuff and appearance
170if &t_Co > 2
171 set hlsearch | " highlight all search matches
172 set cursorline | " highlight currently selected line
173endif
174
175
176if has("gui_running")
177 set mouse=a | " use mouse in gui-mode (which is default)
178 set mouseshape+=n:beam,v:beam | " display a text input cursor even in normal and selection mode
179 set guicursor=n-v-c:ver20-Cursor-blinkon500-blinkoff500 | " how the caret looks like
180 set guitablabel=%t | " do not display full path as tabname
181 set guioptions+=m | " menu bar
182 set guioptions-=T | " toolbar
183 set guioptions+=r | " right-hand scroll bar
184 set guioptions-=c | " use console dialogs instead of popups
185 set guioptions+=a | " autoselect: copy&paste using middleclick
186 set guioptions+=e | " add tab pages
187 set guioptions+=p | " use gui pointer callback for x11
188 set toolbariconsize=large | " make the icon toolbar as big as possible
189 "set columns=80 | " set initial window width (so that it fits the terminals)
190else
191 if &term =~? 'mlterm\|xterm\|screen'
192 set t_Co=256 | " fixes incompatibilities with our color scheme
193 endif
194 set mouse=nh | " limits mouse usage to normal mode and help files, so that middle click text insertion works in insert mode
195 set title | " set the terminal caption
196 set icon | " sets the terminal icon to vim
197 set ttyfast | " modern terminals are all fast in a way
198 "set titleold="vim ended" | " set terminal title after closing vim
199 "set titlestring="VIM-CONSOLE" | " set window title
200 "if has('mouse')
201 "endif
202endif
203
204
205"================================================================================
206" custom commands...
207"
208" assign selection keys (these i missed a lot)
209nmap <S-Left> vh| " shift-left selects to the left
210xmap <S-Left> h| " ^^
211nmap <S-Right> vl| " shift-right selects to the right
212xmap <S-Right> l| " ^^
213nmap <S-Up> vk| " shift-up selects like other text editors
214xmap <S-Up> k| " ^^
215nmap <S-Down> vj| " shift down selects like other text editors
216xmap <S-Down> j| " ^^
217nmap <Home> ^| " default homing in code editors is the first letter of a line
218xmap <Home> 0| " go to the beginning of the line
219xmap <S-Home> 0| " ^^
220xmap <Tab> >gv| " indent lines (and retain selection)
221xmap <S-Tab> <gv| " unindent lines (and retain selection)
222nmap <S-PageUp> VH| " selects predessing paragraph
223nmap <S-PageDown> VL| " selects following paragraph
224nmap <C-S-PageUp> V{| " selects predessing paragraph
225nmap <C-S-PageDown> V}| " selects following paragraph
226
227nmap <C-o> :24vs.<CR>| " means the same as :vsplit. and opens the :Exlore -window with a width of 24
228
229
230
231
232
233map <C-h> <C-w>h|map <C-j> <C-w>j| " window navigation shortcuts
234map <C-k> <C-w>k|map <C-l> <C-w>l| " window navigation shortcuts
235
236cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user
237
238" custom hotkeys...
239nnoremap <C-Tab> :tabnext<CR>| " lets one use CTRL+Tab to switch between tabs
240nnoremap <C-S-Tab> :tabprevious<CR>| " use CTRL+Shift+Tab to switch to preview tab
241
242nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines
243
244nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before
245nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line
246" function ExtendedHome()
247" let column = col('.')
248" normal! ^
249" if column == col('.')
250" normal! 0
251" endif
252" endfunction
253" noremap <silent> <Home> :call ExtendedHome()<CR>
254
255nnoremap <C-z> u
256
257
258"map <C-Right> el
259"map <C-left> hgel
260"vnoremap <C-S-Right> e
261"vnoremap <C-S-left> b
262
263
264" plugin hotkeys
265map <C-l> :TlistToggle<CR>| " bind TagList to Hotkey Ctrl+L
266inoremap <buffer> ( <C-X><C-o><C-p>(| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p)
267
268
269set makeprg=make\ test
270nnoremap <F5> :!make<CR>| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that)
271
272"================================================================================
273" deactivated on-demand commands (just in case one needs them one day)
274"
275" code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE
276" reacts on CTRL+P, CTRL+Space
277"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
278"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
279"inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
280"inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
281"inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
282"inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
283" set guiheadroom=0| " do not fill non-functional area of the empty editor with gtk background
284" map shift-right to visually select and so on
285"nnoremap <C-Right> El
286"nnoremap <S-Right> vl
287"nnoremap <S-Left> vj
288"nnoremap <S-Up> vk
289"nnoremap <S-Down> vj
290" noremap % v% " jump between braces and highlight
291"nnoremap <Home> ^
292"vmap <Home> ^
293"nnoremap <End> $
294"vmap <End> $
295"nnoremap <C-Tab> <C-PageDown>
296"nnoremap <C-S-Tab> <C-PageUp>
297":inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
298"inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>" " breaks cursor keys!
299" binding ESC can easily break cursor key movement on the console (tricky, because gvim works)
300"inoremap <C-Space> <C-x><C-o>
301"inoremap <C-@> <C-Space>
302"
303"map <Esc>OA k|map <Esc>OB j|map <Esc>OC l|map <Esc>OD h| " allow cursor keys in insert mode
..