diff options
author | Max Christian Pohle | 2015-10-15 09:50:47 +0200 |
---|---|---|
committer | Max Christian Pohle | 2015-10-15 09:50:47 +0200 |
commit | b9469a391087870d700253cc0fc915b08cdb3820 (patch) | |
tree | 902967957125071ee1fcacce80a467b7f80275ca | |
parent | 1239c1b8d6929d78cc29bce8bd8b3933a4aebb1b (diff) | |
parent | e4a3b3ce20fb6db3590b5065678e39817afe9083 (diff) | |
download | vim-karlmarks-b9469a391087870d700253cc0fc915b08cdb3820.tar.bz2 vim-karlmarks-b9469a391087870d700253cc0fc915b08cdb3820.zip |
Merge remote-tracking branch 'vim/master'
-rw-r--r-- | .vim/.gitignore | 7 | ||||
-rw-r--r-- | .vim/.gitmodules | 3 | ||||
-rw-r--r-- | .vim/colors/coderonline.vim | 142 | ||||
-rw-r--r-- | .vim/doc/INSTALL | 40 | ||||
-rw-r--r-- | .vim/doc/coderonline-vim.png | bin | 0 -> 195172 bytes | |||
-rw-r--r-- | .vim/doc/readme.md | 8 | ||||
-rw-r--r-- | .vim/doc/shortcuts.txt | 41 | ||||
-rw-r--r-- | .vim/favicon.ico | bin | 0 -> 32038 bytes | |||
-rw-r--r-- | .vim/gvim.desktop | 10 | ||||
-rw-r--r-- | .vim/indent/.keep | 1 | ||||
m--------- | .vim/plugins/Vundle.vim | 0 | ||||
-rw-r--r-- | .vim/spell/.keep | 1 | ||||
-rw-r--r-- | .vim/temp/.keep | 3 | ||||
-rw-r--r-- | .vim/vimrc | 223 |
14 files changed, 479 insertions, 0 deletions
diff --git a/.vim/.gitignore b/.vim/.gitignore new file mode 100644 index 0000000..93df1ba --- /dev/null +++ b/.vim/.gitignore | |||
@@ -0,0 +1,7 @@ | |||
1 | /temp/** | ||
2 | !temp/.keep | ||
3 | /intent/** | ||
4 | !indent/.keep | ||
5 | /spell/** | ||
6 | !spell/.keep | ||
7 | /systags | ||
diff --git a/.vim/.gitmodules b/.vim/.gitmodules new file mode 100644 index 0000000..57ae747 --- /dev/null +++ b/.vim/.gitmodules | |||
@@ -0,0 +1,3 @@ | |||
1 | [submodule "plugins/Vundle.vim"] | ||
2 | path = plugins/Vundle.vim | ||
3 | url = https://github.com/VundleVim/Vundle.vim.git | ||
diff --git a/.vim/colors/coderonline.vim b/.vim/colors/coderonline.vim new file mode 100644 index 0000000..eb8baa6 --- /dev/null +++ b/.vim/colors/coderonline.vim | |||
@@ -0,0 +1,142 @@ | |||
1 | " color theme for vim | ||
2 | " Maintainer: Max Christian Pohle <max@coderonline.de> | ||
3 | " Last Change: 07.09.2015 | ||
4 | " Web: http://max.coderonline.de/ | ||
5 | |||
6 | set background=dark | ||
7 | hi clear | ||
8 | if exists("syntax_on") | ||
9 | syntax reset | ||
10 | endif | ||
11 | let g:colors_name="coderonline" | ||
12 | |||
13 | |||
14 | set guifont=Andale\ Mono\ 12 | ||
15 | "set guifont=Liberation\ Mono\ Normal\ 14 | ||
16 | "set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 | ||
17 | "set guifont=Monospace\ 11 | ||
18 | "set guifont=DejaVu\ Sans\ Mono\ 11 | ||
19 | "set guifont=Liberation\ Mono\ for\ Powerline\ 11 | ||
20 | "set guifont=Envy\ Code\ R\ 11 | ||
21 | |||
22 | set number | ||
23 | set hls | ||
24 | |||
25 | highlight Menu gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black | ||
26 | highlight Scrollbar gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black | ||
27 | highlight Tooltip gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black | ||
28 | |||
29 | highlight Normal gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black | ||
30 | highlight! link NonText Normal | ||
31 | |||
32 | highlight Statement gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=#0000ff ctermfg=21 | ||
33 | highlight! link Boolean Statement | ||
34 | highlight! link Identifier Statement | ||
35 | |||
36 | highlight Type gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=DarkBlue ctermfg=darkblue | ||
37 | |||
38 | highlight Constant gui=none cterm=none term=none guibg=white ctermbg=white guifg=brown ctermfg=brown | ||
39 | highlight! link String Constant | ||
40 | highlight! link Number Constant | ||
41 | |||
42 | highlight Comment gui=none cterm=none term=none guibg=white ctermbg=white guifg=DarkGreen ctermfg=DarkGreen | ||
43 | highlight! link PreProc Comment | ||
44 | |||
45 | highlight StatusLine gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgrey | ||
46 | highlight! link StatusLineNC StatusLine | ||
47 | |||
48 | highlight LineNr gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black | ||
49 | highlight CursorLine gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray | ||
50 | " highlight! link CursorLine LineNr | ||
51 | " highlight! link CursorColumn LineNr | ||
52 | " highlight! link ColorColumn LineNr | ||
53 | |||
54 | " Cursor the character under the cursor | ||
55 | highlight Cursor gui=inverse cterm=inverse term=inverse guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black | ||
56 | highlight iCursor gui=underline cterm=underline term=underline | ||
57 | highlight! link CursorLineNr Cursor | ||
58 | highlight! link CursorIM Cursor | ||
59 | highlight! link Visual Cursor | ||
60 | highlight! link VirualNOS Cursor | ||
61 | " highlight! link MatchParen LineNr | ||
62 | highlight MatchParen guibg=yellow ctermbg=yellow | ||
63 | |||
64 | " WildMenu current match in 'wildmenu' completion | ||
65 | " Pmenu Popup menu: normal item. | ||
66 | " PmenuSel Popup menu: selected item. | ||
67 | " PmenuSbar Popup menu: scrollbar. | ||
68 | " PmenuThumb Popup menu: Thumb of the scrollbar. | ||
69 | highlight! link WildMenu Todo | ||
70 | highlight! link Popup LineNr | ||
71 | highlight! link PMenu Popup | ||
72 | highlight! link PMenuSel CursorLineNr | ||
73 | highlight! link PMenuSbar CursorLineNr | ||
74 | highlight! link PMenuThumb CursorLineNr | ||
75 | |||
76 | |||
77 | " Windows | ||
78 | highlight Title gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgray | ||
79 | highlight! link VertSplit Title | ||
80 | highlight! link StatusLine Title | ||
81 | highlight! link StatusLineNC Title | ||
82 | highlight! link TabLine Title | ||
83 | highlight! link TabLineFill TabLine | ||
84 | highlight! link TabLineSel TabLine | ||
85 | highlight TabLineSel gui=inverse cterm=inverse term=inverse | ||
86 | |||
87 | highlight cParen gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown | ||
88 | highlight cBlock gui=none cterm=none term=none guibg=white ctermbg=cyan guifg=orange ctermfg=brown | ||
89 | highlight vimParenSep gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown | ||
90 | |||
91 | highlight Special gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=178 | ||
92 | highlight! link SpecialKey Special | ||
93 | |||
94 | highlight Todo gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black | ||
95 | highlight! link ModeMsg Todo | ||
96 | highlight! link MoreMsg Todo | ||
97 | highlight! link ErrorMsg Todo | ||
98 | highlight! link Conceal Todo | ||
99 | highlight! link Directory Todo | ||
100 | |||
101 | highlight Question gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=black | ||
102 | highlight! link WarningMsg Question | ||
103 | |||
104 | highlight SpellBad gui=underline cterm=underline term=underline ctermbg=white | ||
105 | highlight! link SpellCap SpellBad | ||
106 | highlight! link SpellLocal Todo | ||
107 | highlight! link SpellRare Todo | ||
108 | " *hl-Conceal* | ||
109 | " *hl-DiffAdd* | ||
110 | " DiffAdd diff mode: Added line |diff.txt| | ||
111 | " *hl-DiffChange* | ||
112 | " DiffChange diff mode: Changed line |diff.txt| | ||
113 | " *hl-DiffDelete* | ||
114 | " DiffDelete diff mode: Deleted line |diff.txt| | ||
115 | " *hl-DiffText* | ||
116 | " DiffText diff mode: Changed text within a changed line |diff.txt| | ||
117 | " *hl-ErrorMsg* | ||
118 | " Folded line used for closed folds | ||
119 | " *hl-FoldColumn* | ||
120 | " FoldColumn 'foldcolumn' | ||
121 | " *hl-SignColumn* | ||
122 | " SignColumn column where |signs| are displayed | ||
123 | " *hl-IncSearch* | ||
124 | " IncSearch 'incsearch' highlighting; also used for the text replaced with | ||
125 | " ":s///c" | ||
126 | " *hl-LineNr* | ||
127 | " MatchParen The character under the cursor or just before it, if it | ||
128 | " is a paired bracket, and its match. |pi_paren.txt| | ||
129 | " | ||
130 | " *hl-ModeMsg* | ||
131 | " *hl-NonText* | ||
132 | " *hl-Search* | ||
133 | " Search Last search pattern highlighting (see 'hlsearch'). | ||
134 | " Also used for highlighting the current line in the quickfix | ||
135 | " window and similar items that need to stand out. | ||
136 | " *hl-SpecialKey* | ||
137 | " to show unprintable characters in the text, 'listchars'. | ||
138 | " Generally: text that is displayed differently from what it | ||
139 | " really is. | ||
140 | " *hl-SpellBad* | ||
141 | |||
142 | |||
diff --git a/.vim/doc/INSTALL b/.vim/doc/INSTALL new file mode 100644 index 0000000..14fb286 --- /dev/null +++ b/.vim/doc/INSTALL | |||
@@ -0,0 +1,40 @@ | |||
1 | # INSTALL | ||
2 | # this should briefly show you how to install this bundle | ||
3 | # | ||
4 | # step 1) | ||
5 | # download the current version using git | ||
6 | git clone http://git.entwicklerseite.de/vim .vim/ | ||
7 | |||
8 | # step 2) | ||
9 | # create a symbolic link to the downloaded vim.rc in you $HOME-directory | ||
10 | ln -s .vim/vimrc .vimrc | ||
11 | |||
12 | # step 3) | ||
13 | # get vim submodules, namely this is just vundle as this will download the rest by itsown | ||
14 | git submodule update --init --recursive | ||
15 | |||
16 | # step 4) | ||
17 | # fix errors caused by the different vim version you might be using and define the spell checkers language. Starting Vim will show you which lines are not supported on your vim installation so that you can fix them: | ||
18 | vim vimrc | ||
19 | |||
20 | # step 5) | ||
21 | # download spell file for you language | ||
22 | vim -c ":au! SpellFileMissing" | ||
23 | |||
24 | # step 6) | ||
25 | # build YouCompleteMe (if you plan to use it) | ||
26 | cd plugins/YouCompleteMe | ||
27 | python2 ./install.py --clang-completer | ||
28 | |||
29 | |||
30 | # step 7) | ||
31 | # create an entry in file managers right click menu 'open with' allowing you to open the file in a vim tab | ||
32 | mkdir -p .local/share/Thunar/sendto/ | ||
33 | cp ~/.vim/gvim-tab.desktop ~/.local/share/Thunar/sendto/ | ||
34 | |||
35 | # step 8) | ||
36 | # add gvim functionality to thunar, so that sendto can be used to open a file in an existing vim instance (as a tab in this case) | ||
37 | cp ~/.vim/gvim-tab.desktop ~/.local/share/applications/ | ||
38 | update-desktop-database ~/.local/share/applications/ | ||
39 | |||
40 | |||
diff --git a/.vim/doc/coderonline-vim.png b/.vim/doc/coderonline-vim.png new file mode 100644 index 0000000..ac76bff --- /dev/null +++ b/.vim/doc/coderonline-vim.png | |||
Binary files differ | |||
diff --git a/.vim/doc/readme.md b/.vim/doc/readme.md new file mode 100644 index 0000000..800c1a2 --- /dev/null +++ b/.vim/doc/readme.md | |||
@@ -0,0 +1,8 @@ | |||
1 | <h1>vim configuration</h1> | ||
2 | This is the configuration I am using. | ||
3 | |||
4 | |||
5 | <h2>coderonline.vim - colorscheme</h2> | ||
6 | <a href="/vim/plain/doc/coderonline-vim.png"> | ||
7 | <img src="/vim/plain/doc/coderonline-vim.png" width="720" alt="screenshot of vim" /> | ||
8 | </a> | ||
diff --git a/.vim/doc/shortcuts.txt b/.vim/doc/shortcuts.txt new file mode 100644 index 0000000..6b88797 --- /dev/null +++ b/.vim/doc/shortcuts.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | [normal mode] | ||
2 | f{char} - move cursor to the character {char} | ||
3 | |||
4 | [visual mode] - with selected lines | ||
5 | gq - formats text so that it fits in whatever :set textwidth was set | ||
6 | |||
7 | |||
8 | [commands] | ||
9 | :spell [word] - adds a word to the current dictionary (no mistake any more) | ||
10 | :set list - display non printable characters | ||
11 | :retab - replaces tabs with spaces | ||
12 | :set expandtab - in insert mode: replace tab with spaces | ||
13 | |||
14 | |||
15 | [navigation] | ||
16 | <CTRL-]> - look up the tag under the cursor (help links as well) | ||
17 | <CTRL-T> - return back from tag under the cursor | ||
18 | |||
19 | |||
20 | [macros] - record and play back a series of vim commands | ||
21 | qa - start (q) macro recording in register a (can be anything) | ||
22 | q - stop macro recording | ||
23 | @a - replay macro a | ||
24 | :'<,'>normal @a - apply a to every line in the current selection | ||
25 | |||
26 | [marker] | ||
27 | ma - set marker a-z (a in this case) | ||
28 | 'a - go to marker a | ||
29 | |||
30 | [windows] | ||
31 | <C-W>v - splits buffer vertically (screen uses |) | ||
32 | <C-W>s - splits buffer horizontally (same as screen) | ||
33 | <C-W>w - moves the cursor to the next window and back | ||
34 | <C-W>[dir] - moves the cursor in that direction (use hjkl or arrow keys) | ||
35 | |||
36 | |||
37 | [vimdiff] | ||
38 | do - get changes from other window into the current | ||
39 | dp - put changes from current window into the other | ||
40 | ]c - jump to the next change | ||
41 | [c - jump to the prevous change | ||
diff --git a/.vim/favicon.ico b/.vim/favicon.ico new file mode 100644 index 0000000..ca0b3c3 --- /dev/null +++ b/.vim/favicon.ico | |||
Binary files differ | |||
diff --git a/.vim/gvim.desktop b/.vim/gvim.desktop new file mode 100644 index 0000000..37c6e58 --- /dev/null +++ b/.vim/gvim.desktop | |||
@@ -0,0 +1,10 @@ | |||
1 | [Desktop Entry] | ||
2 | Name=Vi IMproved Tab | ||
3 | Comment=Open file in an existing instance of vi and in a new tab | ||
4 | MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; | ||
5 | Exec=gvim f -N --remote-tab %F | ||
6 | Icon=gvim | ||
7 | Type=Application | ||
8 | Terminal=false | ||
9 | X-XClassHintResName=VIM | ||
10 | Categories=Utility;TextEditor; | ||
diff --git a/.vim/indent/.keep b/.vim/indent/.keep new file mode 100644 index 0000000..f8e463a --- /dev/null +++ b/.vim/indent/.keep | |||
@@ -0,0 +1 @@ | |||
this directory gets used for custom indentation rules. file naming follows the extension of the files the indentation is for and the extension .vim. | |||
diff --git a/.vim/plugins/Vundle.vim b/.vim/plugins/Vundle.vim new file mode 160000 | |||
Subproject 0ee36b26e127cda512a8f2852a59e5a5f374c87 | |||
diff --git a/.vim/spell/.keep b/.vim/spell/.keep new file mode 100644 index 0000000..6d81f6e --- /dev/null +++ b/.vim/spell/.keep | |||
@@ -0,0 +1 @@ | |||
vim will automatically download spellchecker dictionaries to this directory | |||
diff --git a/.vim/temp/.keep b/.vim/temp/.keep new file mode 100644 index 0000000..3d99c12 --- /dev/null +++ b/.vim/temp/.keep | |||
@@ -0,0 +1,3 @@ | |||
1 | this directory is meant to store backups and undo files. it improves the vim | ||
2 | experience when working with fuse mounted file systems, because they can get | ||
3 | really slow when doing those things remotely | ||
diff --git a/.vim/vimrc b/.vim/vimrc new file mode 100644 index 0000000..5d3417b --- /dev/null +++ b/.vim/vimrc | |||
@@ -0,0 +1,223 @@ | |||
1 | " vi:columns=160:list:ts=2:sts=2:sw=2 | ||
2 | "================================================================================ | ||
3 | " Vundle: plugin manager... | ||
4 | set nocompatible | " do not try to be vi, be vim (required by Vundle) | ||
5 | filetype off | " Vundle needs this | ||
6 | set rtp+=~/.vim/plugins/Vundle.vim | " set runtimepath (required by Vundle) | ||
7 | call vundle#begin('~/.vim/plugins/') | " location where Vundle searches&installs plugins | ||
8 | |||
9 | " Plugin dependant configurations... | ||
10 | Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required) | ||
11 | Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use | ||
12 | Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back | ||
13 | Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin | ||
14 | |||
15 | Plugin 'taglist-plus' | " quick code navigator | ||
16 | let Tlist_Compact_Format = 1 | " | ||
17 | let Tlist_GainFocus_On_ToggleOpen = 1 | " | ||
18 | let Tlist_Close_On_Select = 1 | " | ||
19 | |||
20 | Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion | ||
21 | let g:ycm_global_ycm_extra_conf = '' | " fallback, right one should be in the applications path | ||
22 | let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' | ||
23 | let g:ycm_key_select_completion = '<Tab>' | " key completion key | ||
24 | let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar | ||
25 | let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar | ||
26 | let g:ycm_collect_identifiers_from_tags_files = 1 | " | ||
27 | let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode | ||
28 | "let g:ycm_semantic_triggers = {'c' : ['(', ',']} | " add additional triggers (not recommend) | ||
29 | |||
30 | let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle | ||
31 | let html_use_css = 1 | " when using :TOhtml no font-tags will be used, but proper css | ||
32 | |||
33 | call vundle#end() | " required by Vundle | ||
34 | filetype plugin indent on | " required by Vundle | ||
35 | behave mswin | ||
36 | "================================================================================ | ||
37 | " custom config | ||
38 | colorscheme coderonline | ||
39 | syntax enable | ||
40 | |||
41 | set noswapfile | " noundofile, nobackup, nowritebackup | ||
42 | set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory | ||
43 | set directory=~/.vim/temp | " | ||
44 | set undodir=~/.vim/temp | " | ||
45 | |||
46 | set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) | ||
47 | set autoindent | " always set autoindenting on | ||
48 | set copyindent | " copy the previous indentation on autoindenting | ||
49 | set scrolloff=2 | " always keeps at least two lines visible (when seeking) | ||
50 | set selectmode=mouse | " avoid using select mode (only with mouse) | ||
51 | set selection=exclusive | " includes last character of the selection into following command (like x or d) | ||
52 | |||
53 | set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap | ||
54 | set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap | ||
55 | set diffopt+=iwhite,filler | " lets diff ignore white spaces | ||
56 | set spell spelllang=en,de | " enable spell checker | ||
57 | set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore) | ||
58 | set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews | ||
59 | set linebreak | " do not wrap in the middle of words | ||
60 | set showcmd | " displays status line messages while selecting (matrix size) | ||
61 | set nofoldenable | " do not fold code automatically | ||
62 | set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include | ||
63 | set wildmenu wildmode=full | " wildmenu code completion | ||
64 | |||
65 | " search... | ||
66 | set ignorecase smartcase | " if search pattern contains uppercase then search is case sensitive | ||
67 | set incsearch | " do incremental searching | ||
68 | set showmatch matchtime=4 | " blinks matching braces | ||
69 | |||
70 | set novisualbell | " don't beep | ||
71 | set noerrorbells | " don't beep | ||
72 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | ||
73 | set number | " toggle line numbers | ||
74 | |||
75 | if has("multi_byte") | ||
76 | set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) | ||
77 | scriptencoding utf-8 | " tell vim that we are using utf-8 here | ||
78 | set showbreak+=› | " symbol used in the beginning of a wrapped line | ||
79 | set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars) | ||
80 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) | ||
81 | set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) | ||
82 | set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) | ||
83 | set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) | ||
84 | endif | ||
85 | |||
86 | if has("autocmd") | ||
87 | set modeline | " set variables specific to a file, like indentation by adding a comment | ||
88 | set modelines=3 | " how many lines in the beginning and end of the file can be mode lines? | ||
89 | |||
90 | augroup resCur | " make cursor appear in its previous position when reopening a file... | ||
91 | autocmd BufReadPost * call setpos(".", getpos("'\"")) | ||
92 | augroup END | ||
93 | |||
94 | augroup PreviewOnBottom | " will open new windows below the current (only in insert mode, so that the preview window is drawn below) | ||
95 | autocmd InsertEnter * set splitbelow | ||
96 | autocmd InsertLeave * set splitbelow! | ||
97 | augroup END | ||
98 | |||
99 | augroup OmniFunc | " this will enable omnicomplete just in case this configuration runs somewhere, where YouCompleteMe is not compiled | ||
100 | if exists("+omnifunc") | ||
101 | autocmd Filetype * | ||
102 | \ if &omnifunc == "" | | ||
103 | \ setlocal omnifunc=syntaxcomplete#Complete | | ||
104 | \ setlocal completeopt=longest,menuone | | ||
105 | \ endif | ||
106 | endif | ||
107 | augroup END | ||
108 | |||
109 | autocmd FileType text setlocal textwidth=78 | " text files: set 'textwidth' to 78 | ||
110 | autocmd FileType gitcommit set tw=72 | " longer commit messages without auto line wrapping | ||
111 | autocmd FileType LaTeX let g:tex_flavor = "latex"| set conceallevel=1| set concealcursor= | ||
112 | autocmd BufNewFile,BufReadPost *.config set filetype=xml | " visual studio config file | ||
113 | autocmd BufNewFile,BufReadPost *.csproj set filetype=xml | " visual studio project file | ||
114 | autocmd BufNewFile,BufReadPost *.sln set filetype=xml | " visual studio solution file | ||
115 | endif | ||
116 | |||
117 | "================================================================================ | ||
118 | " gui stuff and appearance | ||
119 | if &t_Co > 2 | ||
120 | set hlsearch | " highlight all search matches | ||
121 | set cursorline | " highlight currently selected line | ||
122 | endif | ||
123 | |||
124 | |||
125 | if has("gui_running") | ||
126 | set mouse=a | " use mouse in gui-mode (which is default) | ||
127 | set mouseshape+=n:beam,v:beam | " display a text input cursor even in normal and selection mode | ||
128 | set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like | ||
129 | set guitablabel=%t | " do not display full path as tabname | ||
130 | set guioptions+=m | " menu bar | ||
131 | set guioptions+=T | " toolbar | ||
132 | set guioptions+=r | " right-hand scroll bar | ||
133 | set guioptions-=c | " use console dialogs instead of popups | ||
134 | set guioptions+=a | " autoselect: copy&paste using middleclick | ||
135 | set guioptions+=e | " add tab pages | ||
136 | set guioptions+=p | " use gui pointer callback for x11 | ||
137 | set toolbariconsize=large | " make the icon toolbar as big as possible | ||
138 | "set columns=80 | " set initial window width (so that it fits the terminals) | ||
139 | else | ||
140 | if &term =~? 'mlterm\|xterm\|screen' | ||
141 | set t_Co=256 | " fixes incompatibilities with our color scheme | ||
142 | endif | ||
143 | set mouse=nh | " limits mouse usage to normal mode and help files, so that middle click text insertion works in insert mode | ||
144 | set title | " set the terminal caption | ||
145 | set icon | " sets the terminal icon to vim | ||
146 | set ttyfast | " modern terminals are all fast in a way | ||
147 | "set titleold="vim ended" | " set terminal title after closing vim | ||
148 | "set titlestring="VIM-CONSOLE" | " set window title | ||
149 | "if has('mouse') | ||
150 | "endif | ||
151 | endif | ||
152 | |||
153 | |||
154 | "================================================================================ | ||
155 | " custom commands... | ||
156 | map <C-h> <C-w>h|map <C-j> <C-w>j| " window navigation shortcuts | ||
157 | map <C-k> <C-w>k|map <C-l> <C-w>l| " window navigation shortcuts | ||
158 | |||
159 | cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user | ||
160 | |||
161 | " custom hotkeys... | ||
162 | nnoremap <C-Tab> :tabnext<CR>| " lets one use CTRL+Tab to switch between tabs | ||
163 | nnoremap <C-S-Tab> :tabprevious<CR>| " use CTRL+Shift+Tab to switch to preview tab | ||
164 | |||
165 | nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines | ||
166 | |||
167 | nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before | ||
168 | nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line | ||
169 | function ExtendedHome() | ||
170 | let column = col('.') | ||
171 | normal! ^ | ||
172 | if column == col('.') | ||
173 | normal! 0 | ||
174 | endif | ||
175 | endfunction | ||
176 | noremap <Home> ^ | ||
177 | noremap <silent> <Home> :call ExtendedHome()<CR> | ||
178 | |||
179 | nnoremap <C-z> u | ||
180 | |||
181 | |||
182 | |||
183 | " plugin hotkeys | ||
184 | map <C-l> :TlistToggle<CR>| " bind TagList to Hotkey Ctrl+L | ||
185 | inoremap <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) | ||
186 | |||
187 | |||
188 | set makeprg=make\ test | ||
189 | nnoremap <F5> :!make<CR>| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that) | ||
190 | |||
191 | |||
192 | "================================================================================ | ||
193 | " deactivated on-demand commands (just in case one needs them one day) | ||
194 | " | ||
195 | " code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE | ||
196 | " reacts on CTRL+P, CTRL+Space | ||
197 | "inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" | ||
198 | "inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" | ||
199 | "inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>" | ||
200 | "inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>" | ||
201 | "inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>" | ||
202 | "inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>" | ||
203 | " set guiheadroom=0| " do not fill non-functional area of the empty editor with gtk background | ||
204 | " map shift-right to visually select and so on | ||
205 | "nnoremap <C-Right> El | ||
206 | "nnoremap <S-Right> vl | ||
207 | "nnoremap <S-Left> vj | ||
208 | "nnoremap <S-Up> vk | ||
209 | "nnoremap <S-Down> vj | ||
210 | " noremap % v% " jump between braces and highlight | ||
211 | "nnoremap <Home> ^ | ||
212 | "vmap <Home> ^ | ||
213 | "nnoremap <End> $ | ||
214 | "vmap <End> $ | ||
215 | "nnoremap <C-Tab> <C-PageDown> | ||
216 | "nnoremap <C-S-Tab> <C-PageUp> | ||
217 | ":inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" | ||
218 | "map <Esc>OA k|map <Esc>OB j|map <Esc>OC l|map <Esc>OD h| " allow cursor keys in insert mode | ||
219 | "inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>" " breaks cursor keys! | ||
220 | " binding ESC can easily break cursor key movement on the console (tricky, because gvim works) | ||
221 | "inoremap <C-Space> <C-x><C-o> | ||
222 | "inoremap <C-@> <C-Space> | ||
223 | " | ||