diff options
70 files changed, 1330 insertions, 2849 deletions
@@ -0,0 +1,9 @@ | |||
1 | " vim: tabstop=2 softtabstop=2 shiftwidth=2 | ||
2 | set tabstop=2 | ||
3 | set softtabstop=2 | ||
4 | set shiftwidth=2 | ||
5 | |||
6 | |||
7 | |||
8 | |||
9 | |||
@@ -5,3 +5,5 @@ | |||
5 | /spell/** | 5 | /spell/** |
6 | !spell/.keep | 6 | !spell/.keep |
7 | /systags | 7 | /systags |
8 | /pack/max/** | ||
9 | shada.file | ||
diff --git a/.gitmodules b/.gitmodules index 605d959..b939c33 100644 --- a/.gitmodules +++ b/.gitmodules | |||
@@ -1,3 +1,81 @@ | |||
1 | [submodule "autoload"] | 1 | [submodule "pack/submodules/vim-recently-used"] |
2 | path = autoload | 2 | path = pack/submodules/start/vim-recently-used |
3 | url = https://github.com/junegunn/vim-plug | 3 | url = https://git.entwicklerseite.de/vim-recently-used |
4 | [submodule "pack/submodules/vim-karlmarks"] | ||
5 | path = pack/submodules/start/vim-karlmarks | ||
6 | url = http://git.entwicklerseite.de/vim-karlmarks | ||
7 | [submodule "pack/submodules/vim-fancy-line"] | ||
8 | path = pack/submodules/start/vim-fancy-line | ||
9 | url = https://github.com/coderonline/vim-fancy-line | ||
10 | [submodule "pack/submodules/vim-mercenary"] | ||
11 | path = pack/submodules/start/vim-mercenary | ||
12 | url = https://github.com/jlfwong/vim-mercenary | ||
13 | [submodule "pack/submodules/start/vim-colorscheme-papercolor"] | ||
14 | path = pack/all/start/vim-colorscheme-papercolor | ||
15 | url = https://github.com/NLKNguyen/papercolor-theme.git | ||
16 | [submodule "pack/submodules/start/vim-YouCompleteMe"] | ||
17 | path = pack/submodules/opt/vim-youcompleteme | ||
18 | url = https://github.com/Valloric/YouCompleteMe.git | ||
19 | [submodule "pack/submodules/start/nvim-colorizer"] | ||
20 | path = pack/nvim/start/nvim-colorizer | ||
21 | url = https://github.com/norcalli/nvim-colorizer.lua | ||
22 | [submodule "pack/submodules/start/nvim-cmp"] | ||
23 | path = pack/nvim/start/nvim-cmp | ||
24 | url = https://github.com/hrsh7th/nvim-cmp | ||
25 | [submodule "pack/submodules/start/nvim-cmp-nvim-lsp"] | ||
26 | path = pack/nvim/start/nvim-cmp-nvim-lsp | ||
27 | url = https://github.com/hrsh7th/cmp-nvim-lsp | ||
28 | [submodule "pack/submodules/start/nvim-vsnip"] | ||
29 | path = pack/nvim/start/nvim-vsnip | ||
30 | url = https://github.com/hrsh7th/vim-vsnip | ||
31 | [submodule "pack/submodules/start/vim-recently-used"] | ||
32 | path = pack/all/start/vim-recently-used | ||
33 | url = https://git.entwicklerseite.de/vim-recently-used | ||
34 | [submodule "pack/submodules/start/vim-karlmarks"] | ||
35 | path = pack/all/start/vim-karlmarks | ||
36 | url = http://git.entwicklerseite.de/vim-karlmarks | ||
37 | [submodule "pack/submodules/start/vim-fancy-line"] | ||
38 | path = pack/all/start/vim-fancy-line | ||
39 | url = https://github.com/coderonline/vim-fancy-line | ||
40 | [submodule "pack/submodules/start/vim-mercenary"] | ||
41 | path = pack/all/start/vim-mercenary | ||
42 | url = https://github.com/jlfwong/vim-mercenary | ||
43 | [submodule "pack/submodules/opt/vim-youcompleteme"] | ||
44 | path = pack/vim/opt/vim-youcompleteme | ||
45 | url = https://github.com/Valloric/YouCompleteMe.git | ||
46 | [submodule "pack/nvim/start/nvim-cmp-buffer"] | ||
47 | path = pack/nvim/start/nvim-cmp-buffer | ||
48 | url = https://github.com/hrsh7th/cmp-buffer | ||
49 | [submodule "pack/nvim/start/nvim-cmp-lsp-signature-help"] | ||
50 | path = pack/nvim/start/nvim-cmp-lsp-signature-help | ||
51 | url = https://github.com/hrsh7th/cmp-nvim-lsp-signature-help | ||
52 | [submodule "pack/all/start/vim-editorconfig"] | ||
53 | path = pack/all/start/vim-editorconfig | ||
54 | url = https://github.com/cxw42/editorconfig-vim | ||
55 | [submodule "pack/nvim/start/nvim-treesitter"] | ||
56 | path = pack/nvim/start/nvim-treesitter | ||
57 | url = https://github.com/nvim-treesitter/nvim-treesitter | ||
58 | [submodule "pack/all/start/fzf.vim"] | ||
59 | path = pack/all/start/fzf.vim | ||
60 | url = https://github.com/junegunn/fzf.vim | ||
61 | [submodule "pack/all/start/fzf"] | ||
62 | path = pack/all/start/fzf | ||
63 | url = https://github.com/junegunn/fzf | ||
64 | [submodule "pack/nvim/start/nvim-telescope"] | ||
65 | path = pack/nvim/start/nvim-telescope | ||
66 | url = https://github.com/nvim-telescope/telescope.nvim | ||
67 | [submodule "pack/nvim/start/nvim-plenary"] | ||
68 | path = pack/nvim/start/nvim-plenary | ||
69 | url = https://github.com/nvim-lua/plenary.nvim | ||
70 | [submodule "pack/nvim/start/nvim-lua-language-server"] | ||
71 | path = pack/nvim/start/nvim-lua-language-server | ||
72 | url = https://github.com/LuaLS/lua-language-server | ||
73 | [submodule "pack/nvim/start/nvim-lspconfig"] | ||
74 | path = pack/nvim/start/nvim-lspconfig | ||
75 | url = https://github.com/neovim/nvim-lspconfig | ||
76 | [submodule "pack/nvim/start/nvim-lsp"] | ||
77 | path = pack/nvim/start/nvim-lsp | ||
78 | url = https://github.com/prabirshrestha/vim-lsp | ||
79 | [submodule "pack/all/start/vim-under-the-cursor"] | ||
80 | path = pack/all/start/vim-under-the-cursor | ||
81 | url = https://github.com/coderonline/vim-under-the-cursor | ||
diff --git a/CursorHold-example.vim b/CursorHold-example.vim deleted file mode 100644 index ae55396..0000000 --- a/CursorHold-example.vim +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | au! CursorHold *.[ch] nested call PreviewWord() | ||
2 | func PreviewWord() | ||
3 | if &previewwindow " don't do this in the preview window | ||
4 | return | ||
5 | endif | ||
6 | let w = expand("<cword>") " get the word under cursor | ||
7 | if w =~ '\a' " if the word contains a letter | ||
8 | |||
9 | " Delete any existing highlight before showing another tag | ||
10 | silent! wincmd P " jump to preview window | ||
11 | if &previewwindow " if we really get there... | ||
12 | match none " delete existing highlight | ||
13 | wincmd p " back to old window | ||
14 | endif | ||
15 | |||
16 | " Try displaying a matching tag for the word under the cursor | ||
17 | try | ||
18 | exe "ptag " . w | ||
19 | catch | ||
20 | return | ||
21 | endtry | ||
22 | |||
23 | silent! wincmd P " jump to preview window | ||
24 | if &previewwindow " if we really get there... | ||
25 | if has("folding") | ||
26 | silent! .foldopen " don't want a closed fold | ||
27 | endif | ||
28 | call search("$", "b") " to end of previous line | ||
29 | let w = substitute(w, '\\', '\\\\', "") | ||
30 | call search('\<\V' . w . '\>') " position cursor on match | ||
31 | " Add a match highlight to the word at this position | ||
32 | hi previewWord term=bold ctermbg=green guibg=green | ||
33 | exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"' | ||
34 | wincmd p " back to old window | ||
35 | endif | ||
36 | endif | ||
37 | endfun | ||
diff --git a/README.md b/README.md new file mode 100755 index 0000000..0d4f81b --- /dev/null +++ b/README.md | |||
@@ -0,0 +1,302 @@ | |||
1 | # Installation | ||
2 | |||
3 | git clone http://git.entwicklerseite.de/vim ~/.config/nvim/ | ||
4 | ln -s ~/.config/nvim ~/.vim | ||
5 | |||
6 | # Overview | ||
7 | |||
8 | - `init.lua` :: my every day neovim config. It sources my vimrc (see below) | ||
9 | |||
10 | - `init-mini.lua` :: if you want to start from scratch this is a good start. It | ||
11 | sets up nvim with a language server to support the creation of a new config. | ||
12 | |||
13 | - `vimrc` :: commented version of a vimrc with sane defaults | ||
14 | |||
15 | - `gvimrc` :: configures the gui of gvim and sources the vimrc | ||
16 | |||
17 | |||
18 | ``` | ||
19 | . | ||
20 | ├── after | ||
21 | │ ├── ftdetect | ||
22 | │ │ └── log.vim | ||
23 | │ ├── ftplugin | ||
24 | │ │ └── python.vim | ||
25 | │ ├── indent | ||
26 | │ │ ├── html5.vim | ||
27 | │ │ ├── php.vim | ||
28 | │ │ └── yaml.vim | ||
29 | │ └── syntax | ||
30 | │ ├── c.vim | ||
31 | │ ├── log.vim | ||
32 | │ └── markdown.vim | ||
33 | ├── gvimrc | ||
34 | ├── init-mini.lua | ||
35 | ├── init.lua | ||
36 | ├── README.md | ||
37 | └── vimrc | ||
38 | ``` | ||
39 | |||
40 | |||
41 | # Cheat sheet | ||
42 | For different working scenarios. | ||
43 | |||
44 | ## vim | ||
45 | |||
46 | - use `<C-d>` to expand autocompletion on the `:` command line. That works for | ||
47 | example for `:setfiletype <C-d>` to show all available filetypes. | ||
48 | |||
49 | - use `gw` or `gq` in visual mode to break selected text at the current | ||
50 | textwidth (configured with `set textwidth=80` for example) | ||
51 | |||
52 | |||
53 | ## general | ||
54 | |||
55 | :viusage = summary of all keyboard shortcuts | ||
56 | :options = shows currently :set options (with descriptions) | ||
57 | leader key = usually set to backslash expects a quick command | ||
58 | |||
59 | ### normal mode | ||
60 | |||
61 | f{char} = move cursor to the character {char} | ||
62 | gf = open file under cursor | ||
63 | <C-w>gf = open file under cursor in a tab | ||
64 | <C-w>] = jump to the tag under the cursor in a new window | ||
65 | <C-t> = jump back from where that ^ brought you | ||
66 | K = keyword lookup for the word under the cursor (see :help kp) | ||
67 | w = next word | ||
68 | e = end of word (=inner word) | ||
69 | |||
70 | @see: :h text-objects | ||
71 | ci' = change between single quote | ||
72 | ci" = change between double quote | ||
73 | ci( = change between brace | ||
74 | cit = change XML Tag | ||
75 | ciw = select inner word | ||
76 | caw = select 'a word' | ||
77 | " where c can be replaced by v for visual mode | ||
78 | |||
79 | :%s/foo/bar/g = replace all foo with bar | ||
80 | :g/foo/s/bar//g = on lines with foo replace bar with nothing | ||
81 | :g!/foo/s/bar//g = on lines not containing foo replace bar with nothing | ||
82 | :g!/^foo/execute("normal dd") delete lines starting with foo | ||
83 | |||
84 | flags, end: after the last / | ||
85 | g = replace globally (all occurances on the current line) | ||
86 | c = confirm each replace, also allows to switch to g (use the flag to see the help message) | ||
87 | e = places the cursor in the end of the selection | ||
88 | |||
89 | flags, within the search string: | ||
90 | \v = use very magic search (more like perl) | ||
91 | \V = use no very magic, more like searching verbatim | ||
92 | \zs .. \ze = mark begin and end of a sub pattern (like perl lookaround assertions) | ||
93 | |||
94 | ### visual mode (with selected lines) | ||
95 | |||
96 | gq = formats text so that it fits in whatever :set textwidth was set | ||
97 | iB = select block between curly braces (:help object-select) | ||
98 | |||
99 | ### command line mode | ||
100 | command line mode begins with : and has its own key mappings starting with c | ||
101 | like in cnormap | ||
102 | |||
103 | :spell [word] = adds a word to the current dictionary (no mistake any more) | ||
104 | :set list = display non printable characters | ||
105 | :retab = replaces tabs with spaces | ||
106 | :set expandtab = in insert mode: replace tab with spaces | ||
107 | :Explore = cli version open file dialog (file explorer) | ||
108 | :Lex = use netrw as project drawer (stays open in its own window) | ||
109 | :only = 'maximize' current buffer | ||
110 | |||
111 | |||
112 | ### insert mode | ||
113 | |||
114 | <c-r><c-w> = auto completion with the word under the cursor (interesting with incsearch) | ||
115 | <c-a> = expand pattern from command line (e.g. *.txt) | ||
116 | |||
117 | ### navigation | ||
118 | |||
119 | <CTRL-]> = look up the tag under the cursor (help links as well) | ||
120 | <CTRL-T> = return back from tag under the cursor | ||
121 | gd = jump to the declaration of the variable under the cursor | ||
122 | |||
123 | ### macros | ||
124 | record and play back a series of vim commands | ||
125 | |||
126 | qa = start (q) macro recording in register a (can be anything) | ||
127 | q = stop macro recording | ||
128 | @a = replay macro a | ||
129 | :'<,'>normal @a = apply a to every line in the current selection | ||
130 | :reg = lists all registers (including those with macros in them) | ||
131 | |||
132 | ### registers | ||
133 | notice, that registers get used for both: macro recordings and copying text | ||
134 | |||
135 | :reg = shows contents of all registers | ||
136 | "0p = pasts from register 0, which is the same as "", but not overwritten by dd | ||
137 | "ap = same for register a | ||
138 | "0yy = yanks to register 0 (same as y by itself) | ||
139 | "ay = yanks current selection to register a (in visual mode) | ||
140 | |||
141 | ### marker | ||
142 | |||
143 | ma = set marker a-z (a in this case) | ||
144 | mA = create a session persistent file marker which can be used to reopen a file (not bound to the buffer) | ||
145 | `a = go to marker a (line & column) | ||
146 | 'a = go to marker a (line, first non blank), same as `a^ | ||
147 | |||
148 | ### other hotkeys | ||
149 | |||
150 | <C-A>, <C-X> = increment, decrement number under the cursor | ||
151 | |||
152 | ## windows | ||
153 | |||
154 | <C-w>v = splits buffer vertically (screen uses |) | ||
155 | <C-w>s = splits buffer horizontally (same as screen) | ||
156 | <C-w>w = moves the cursor to the next window and back | ||
157 | <C-w>[dir] = moves the cursor in that direction (use hjkl or arrow keys) | ||
158 | <C-w>[HK] = make a vertical split horizontal and vice versa | ||
159 | <C-w>o = only: close all other windows | ||
160 | <C-w>c = close: current window in which the cursor sits | ||
161 | |||
162 | ### vimdiff | ||
163 | |||
164 | do = get changes from other window into the current | ||
165 | dp = put changes from current window into the other | ||
166 | ]c = jump to the next change | ||
167 | [c = jump to the prevous change | ||
168 | |||
169 | ### folds | ||
170 | |||
171 | za = toggle a fold | ||
172 | zM = close all folds | ||
173 | zR = opens all folds (unfold all) | ||
174 | zE = eliminates all folds | ||
175 | |||
176 | ### buffers | ||
177 | |||
178 | :bn = buffer next | ||
179 | :bp = buffer previous | ||
180 | :bd = buffer dispatch (close) | ||
181 | :b <tab> = switch buffer by name (use <tab> and <return>) | ||
182 | :set nobuflisted = hide buffer in buffer list (great for neovim's terminal) | ||
183 | |||
184 | ### args | ||
185 | |||
186 | :n **/*.c = opens all files with that name or type in buffers and also fills the argument list | ||
187 | |||
188 | ### special | ||
189 | |||
190 | g CTRL-g = display file properties including word and char count | ||
191 | q: = show command history and use it like a normal buffer | ||
192 | z= = show spellcheck suggestions | ||
193 | |||
194 | ### completions | ||
195 | |||
196 | CTRL-O = display completions: omnicomplete (context dependant completions) | ||
197 | CTRL-X CTRL-F = display completions: file name (using vim-internals omnicomplete) | ||
198 | CTRL-N CTRL-P = display completions: file keywords | ||
199 | CTRL-K = display completions: dictionary | ||
200 | CTRL-T = display completions: thesaurus | ||
201 | CTRL-I = display completions: include files | ||
202 | CTRL-] = display completions: tags | ||
203 | CTRL-D = display completions: (marcro-) definitions | ||
204 | CTRL-V = display completions: vim command line | ||
205 | CTRL-U = display completions: user-defined | ||
206 | |||
207 | ### annoyances | ||
208 | gv = visual mode: reselect last selection | ||
209 | CTRL-o = lets the caret jump back to the previous location | ||
210 | CTRL-l = redraws the complete screen | ||
211 | CTRL-R<register> = in insert mode and command line: paste contents of <register> (e.g. : for last command, * for clipboard) | ||
212 | CTRL-R = in normal mode: redoes what has been undone with u | ||
213 | "<register>p = in normal mode: paste paste contents of <register> | ||
214 | |||
215 | ### registers | ||
216 | "/ = last search expression | ||
217 | ": = last command entered | ||
218 | "= = expression register (to do calculations or call vim functions) | ||
219 | |||
220 | ### netrw | ||
221 | :Lex = open the netrw-view as project drawer | ||
222 | gn = makes the directory under the cursor the root directory | ||
223 | a = toggles display of hidden files | ||
224 | |||
225 | ### filetype:css | ||
226 | |||
227 | viB:sort = sort inner block by name | ||
228 | |||
229 | ### vim commands | ||
230 | |||
231 | :for i in range(1,12) | put ='2016-'.i | endfor | ||
232 | |||
233 | ### debugging | ||
234 | |||
235 | :profile! start /tmp/profile.log | ||
236 | :profile func * | ||
237 | :profile file * | ||
238 | " At this point do slow actions | ||
239 | :profdel * | ||
240 | :e /tmp/profile.log | ||
241 | " add a break point to a vim script (like vimrc) to invoke the internal debugger | ||
242 | :breakadd here | ||
243 | :finish = from within a viml-script: stop sourcing it | ||
244 | |||
245 | ### substitutions | ||
246 | |||
247 | delete all comments: %s/\/\*\*< [^(\*\/)]*\*\///g | ||
248 | remove empty lines: global/^$/d | ||
249 | remove non-empty lines: v/^$/d | ||
250 | |||
251 | ### programs | ||
252 | |||
253 | gpm - cut and paste helper for the linux console (to get text from CTRL-ALT-F2 to CTRL-ALT-F3) | ||
254 | |||
255 | ### vim modeline | ||
256 | |||
257 | filetype can have multiple values, like python.django | ||
258 | The last line can be a mode line, which holds settings like tab width: | ||
259 | |||
260 | |||
261 | |||
262 | ## git | ||
263 | |||
264 | undo last commit: git reset HEAD~ | ||
265 | diff two branches: git diff branch1 branch2 path/to/file | ||
266 | |||
267 | |||
268 | |||
269 | To `~/.gitconfig` add: | ||
270 | [alias] | ||
271 | branchvv = for-each-ref --sort='committerdate:raw' --format='%(HEAD)%(if)%(HEAD)%(then)%(color:bold green)%(end) %(align:width=24)%(refname:short)%(end) %(objectname:short) %(color:bold blue)%(committerdate:iso)%(color:reset) %(if)%(upstream)%(then)[%(color:blue)%(upstream:short)%(color:reset)] %(end)%(subject)' refs/heads | ||
272 | |||
273 | Provides you with `git branchvv`, a command that works similar to `git branch`, | ||
274 | but sorts the branches by modification date and displays them. | ||
275 | |||
276 | |||
277 | # gnu screen | ||
278 | |||
279 | To run Vim in a gnu screen session: | ||
280 | |||
281 | TERM=vte-256color screen vim | ||
282 | |||
283 | But if you are using another terminal there may be further options with even | ||
284 | more capabilities. Starting point for you search could be something like: | ||
285 | |||
286 | find /usr/share/terminfo/ | grep screen | grep 256 | ||
287 | |||
288 | # gvim | ||
289 | |||
290 | Change the default brackground of applications if you see an ugly grey border | ||
291 | around your beatiful theme: | ||
292 | |||
293 | ``` | ||
294 | /* to be saved as ~/.config/gtk-3.0/gtk.css | ||
295 | * thanks to http://stackoverflow.com/users/6899000/proprefenetre */ | ||
296 | @define-color YOUR_BACKGROUND_COLOR #rrggbb; | ||
297 | |||
298 | window#vim-main-window { | ||
299 | background-color: @YOUR_BACKGROUND_COLOR; | ||
300 | } | ||
301 | ``` | ||
302 | |||
diff --git a/after/ftdetect/log.vim b/after/ftdetect/log.vim new file mode 100755 index 0000000..8203171 --- /dev/null +++ b/after/ftdetect/log.vim | |||
@@ -0,0 +1 @@ | |||
autocmd BufReadPost *.log setfiletype log | |||
diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim new file mode 100755 index 0000000..a5c454a --- /dev/null +++ b/after/ftplugin/python.vim | |||
@@ -0,0 +1,12 @@ | |||
1 | python3 << EOF | ||
2 | import os | ||
3 | import sys | ||
4 | import vim | ||
5 | for p in sys.path: | ||
6 | # Add each directory in sys.path, if it exists. | ||
7 | if os.path.isdir(p): | ||
8 | # Command 'set' needs backslash before each space. | ||
9 | vim.command(r"set path+=%s" % (p.replace(" ", r"\ "))) | ||
10 | EOF | ||
11 | |||
12 | hi link pythonDecoratorName pythonDecorator | ||
diff --git a/indent/html5.vim b/after/indent/html5.vim index 94baa87..94baa87 100644..100755 --- a/indent/html5.vim +++ b/after/indent/html5.vim | |||
diff --git a/indent/php.vim b/after/indent/php.vim index ef723a6..ef723a6 100644..100755 --- a/indent/php.vim +++ b/after/indent/php.vim | |||
diff --git a/after/indent/yaml.vim b/after/indent/yaml.vim new file mode 100755 index 0000000..3027571 --- /dev/null +++ b/after/indent/yaml.vim | |||
@@ -0,0 +1,18 @@ | |||
1 | set colorcolumn=80 | ||
2 | set textwidth=80 | ||
3 | |||
4 | let g:yaml_schema = "pyyaml" | ||
5 | |||
6 | |||
7 | |||
8 | function! YamlFix() | ||
9 | if(match(getline(v:lnum), ':$') > -1) | ||
10 | return -1 | ||
11 | elseif(match(getline(v:lnum), '^[^ ].*:$\|^\s*\.\.\.\|^\s*---\') > -1) | ||
12 | return 0 | ||
13 | else | ||
14 | return GetYAMLIndent(v:lnum) | ||
15 | endif | ||
16 | endfunction | ||
17 | setlocal indentexpr=YamlFix() | ||
18 | |||
diff --git a/after/syntax/c.vim b/after/syntax/c.vim index 72136f6..4c3b3f0 100644..100755 --- a/after/syntax/c.vim +++ b/after/syntax/c.vim | |||
@@ -21,6 +21,24 @@ syntax match Comment "//.*" contains=Todo | |||
21 | syn clear cBlock | 21 | syn clear cBlock |
22 | syn region cBlock start=/{/ end=/}/ transparent | 22 | syn region cBlock start=/{/ end=/}/ transparent |
23 | 23 | ||
24 | |||
25 | " configure c.vim so that it automatically allows doxygen like comments | ||
26 | let g:load_doxygen_syntax=1 | ||
27 | |||
28 | |||
29 | set formatoptions+=j " Where it makes sense, remove a comment leader when joining lines. | ||
30 | set formatoptions+=1 " Don't break a line after a one-letter word. | ||
31 | |||
32 | |||
33 | |||
34 | " open a corresponding header file | ||
35 | nnorem <leader>gh :execute 'edit '.findfile(substitute(expand('%:t'),'\.[ch]$','.h',''))<CR> | ||
36 | |||
37 | if filereadable("/usr/bin/vendor_perl/ack") | ||
38 | autocmd FileType c,cpp set grepprg=/usr/bin/vendor_perl/ack\ --type=cc\ --nogroup\ --column\ $* | ||
39 | autocmd FileType c,cpp set grepformat=%f:%l:%c:%m | ||
40 | endif | ||
41 | |||
24 | " multiple single line comments in a row " broken! | 42 | " multiple single line comments in a row " broken! |
25 | " syn region myCComment start="/\*" end="\*/" fold keepend transparent | 43 | " syn region myCComment start="/\*" end="\*/" fold keepend transparent |
26 | 44 | ||
diff --git a/after/syntax/cpp.vim b/after/syntax/cpp.vim deleted file mode 120000 index 64e3fd4..0000000 --- a/after/syntax/cpp.vim +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | c.vim \ No newline at end of file | ||
diff --git a/after/syntax/log.vim b/after/syntax/log.vim new file mode 100755 index 0000000..99b677f --- /dev/null +++ b/after/syntax/log.vim | |||
@@ -0,0 +1,24 @@ | |||
1 | |||
2 | |||
3 | hi link Info NonText | ||
4 | hi link Pass DiffAdd | ||
5 | |||
6 | syn match ERROR /TEST-UNEXPECTED-FAIL/ | ||
7 | syn match NonText /^\[[^\]]*\]/ | ||
8 | |||
9 | syn match NonText /^ *\d\{1,2\}:\d\{1,2\}[.:]\d\{1,2\}[:0-9]*/ | ||
10 | syn match ErrorMsg / ERROR / | ||
11 | syn match ErrorMsg / FAIL / | ||
12 | syn match Error / WARNING / | ||
13 | syn match Info / INFO / fold | ||
14 | syn match Pass / PASS / fold | ||
15 | |||
16 | |||
17 | silent! lvimgrep /\(ERROR\|WARNING\|FAIL\)/ % | ||
18 | lopen 12 | ||
19 | |||
20 | |||
21 | |||
22 | " setlocal foldexpr=getline(v:lnum)=~'INFO' | ||
23 | " setlocal foldmethod=expr | ||
24 | " setlocal foldenable | ||
diff --git a/after/syntax/markdown.vim b/after/syntax/markdown.vim new file mode 100755 index 0000000..e012ee4 --- /dev/null +++ b/after/syntax/markdown.vim | |||
@@ -0,0 +1,19 @@ | |||
1 | " Custom conceal | ||
2 | " syntax region todolist start="^\s*[\+-\*x ]" end="\s" contained keepend | ||
3 | |||
4 | syntax match markdownConceal "\[\ \]" conceal cchar= | ||
5 | syntax match markdownConceal "\[x\]" conceal cchar= | ||
6 | syntax match markdownConceal "\[v\]" conceal cchar= | ||
7 | syntax match markdownConceal "*" conceal cchar= | ||
8 | syntax match markdownConceal "-" conceal cchar= | ||
9 | syntax match markdownConceal "+" conceal cchar= | ||
10 | |||
11 | syntax region | ||
12 | \ markdownItemization | ||
13 | \ start="^\s*\(\[ \]\|[\+\-\*x]\)\s" | ||
14 | \ end="\s" | ||
15 | \ contains=markdownConceal | ||
16 | |||
17 | |||
18 | hi def link markdownConceal Todo | ||
19 | hi! link Conceal Text | ||
diff --git a/autoload b/autoload deleted file mode 160000 | |||
Subproject 645415884669c81b2ebbcb2d341081956cc8222 | |||
@@ -1,30 +0,0 @@ | |||
1 | |||
2 | # gvim () { /bin/gvim $(if [[ "$#" > 0 && `/bin/gvim --serverlist | wc -l` ]]; then echo --remote; fi) $@; } | ||
3 | # vim () { /bin/vim $(if [[ "$#" > 0 && `/bin/vim --serverlist | wc -l` ]]; then echo --remote; fi) $@; } | ||
4 | |||
5 | # man() | ||
6 | # { | ||
7 | # /bin/gvim \ | ||
8 | # $(if [[ `/bin/gvim --serverlist | wc -l` > 0 ]]; then echo --remote-send; fi) \ | ||
9 | # ":enew<CR>:0read !groffer --pager='cat' --tty $1 <bar> col -bx<CR> :set filetype=man buftype=nowrite readonly<CR>gg"; | ||
10 | # } | ||
11 | |||
12 | # export MANPAGER='vim -c":set noswapfile|%!col -b" -c":file man|:setlocal filetype=man buftype=nowrite readonly nonumber nolist signcolumn=no" -' | ||
13 | export MANPAGER="vim -M +MANPAGER -" | ||
14 | |||
15 | # man() { /bin/vim ":enew<CR>:0read !groffer --pager='cat' --tty $1 <bar> col -bx<CR> :set filetype=man buftype=nowrite readonly<CR>gg" -; } | ||
16 | # alias git='git -c color.ui=false' | ||
17 | # export GIT_DIFF_OPTS="--no-color" | ||
18 | |||
19 | |||
20 | |||
21 | git config --global --replace-all color.pager 0 | ||
22 | git config --global --replace-all core.pager 'vim -c":set noswapfile filetype=git buftype=nowrite readonly nolist nonumber signcolumn=no|:file git" -' | ||
23 | # export GIT_PAGER='' | ||
24 | |||
25 | # alias git="TERM=dumb git" | ||
26 | |||
27 | # export EDITOR="gvim()" | ||
28 | # export PAGER="tee /tmp/output.txt /dev/stdout | /bin/vim -" | ||
29 | |||
30 | # --remote-expr ":%!col -b" -c":set buftype=nowrite filetype=man readonly" -'A | ||
diff --git a/colors/coderonline.vim b/colors/coderonline.vim deleted file mode 100644 index f842b28..0000000 --- a/colors/coderonline.vim +++ /dev/null | |||
@@ -1,180 +0,0 @@ | |||
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\ 11 | ||
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 | |||
143 | " ====================== Important bits ====================== | ||
144 | "exe 'hi Normal guifg='.s:white .' guibg='.s:darkgrey | ||
145 | "exe 'hi String guifg='.s:green .' guibg='.s:darkgrey .' gui=bold' | ||
146 | "exe 'hi Function guifg='.s:violet .' guibg='.s:darkgrey .' gui=none' | ||
147 | "exe 'hi Operator guifg='.s:light_orange .' guibg='.s:darkgrey .' gui=none' | ||
148 | "exe 'hi Type guifg='.s:yellow .' guibg='.s:darkgrey .' gui=bold' | ||
149 | "exe 'hi Number guifg='.s:orange .' guibg='.s:darkgrey .' gui=none' | ||
150 | "exe 'hi Constant guifg='.s:red .' guibg='.s:darkgrey .' gui=none' | ||
151 | "exe 'hi Macro guifg='.s:magenta .' guibg='.s:darkgrey .' gui=none' | ||
152 | "exe 'hi PreProc guifg='.s:grey_blue .' guibg='.s:darkgrey .' gui=none' | ||
153 | "exe 'hi Keyword guifg='.s:light_orange .' guibg='.s:darkgrey .' gui=none' | ||
154 | "exe 'hi Comment guifg='.s:white .' guibg='.s:darkgrey .' gui=italic' | ||
155 | "exe 'hi TODO guifg='.s:grey_blue .' guibg='.s:darkgrey .' gui=italic,bold' | ||
156 | " Lay out our palette | ||
157 | let s:grey_blue = '#8a9597' | ||
158 | let s:light_grey_blue = '#a0a8b0' | ||
159 | let s:dark_grey_blue = '#34383c' | ||
160 | let s:mid_grey_blue = '#64686c' | ||
161 | let s:beige = '#ceb67f' | ||
162 | let s:light_orange = '#ebc471' | ||
163 | let s:yellow = '#e3d796' | ||
164 | let s:violet = '#a982c8' | ||
165 | let s:magenta = '#a933ac' | ||
166 | let s:green = '#e0a96f' | ||
167 | let s:lightgreen = '#c2c98f' | ||
168 | let s:red = '#d08356' | ||
169 | let s:cyan = '#74dad9' | ||
170 | let s:darkgrey = '#1a1a1a' | ||
171 | let s:grey = '#303030' | ||
172 | let s:lightgrey = '#605958' | ||
173 | let s:white = '#fffedc' | ||
174 | let s:orange = '#d08356' | ||
175 | |||
176 | " ~~~ These are specific to color_coded ~~~ | ||
177 | exe 'hi Member guifg=#0000aa gui=italic' | ||
178 | exe 'hi Variable guifg=#8800aa gui=none' | ||
179 | exe 'hi Namespace guifg=#aa0000 gui=none' | ||
180 | exe 'hi EnumConstant guifg=#00aaaa gui=none' | ||
diff --git a/colors/mac_classic.vim b/colors/mac_classic.vim deleted file mode 120000 index c1f3dc2..0000000 --- a/colors/mac_classic.vim +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | nelstrom/colors/mac_classic.vim \ No newline at end of file | ||
diff --git a/compton.conf b/compton.conf deleted file mode 100644 index 1d3025d..0000000 --- a/compton.conf +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | backend = "xrender"; | ||
2 | #backend = "glx"; | ||
3 | paint-on-overlay = true; | ||
4 | glx-no-stencil = true; | ||
5 | # glx-no-rebind-pixmap = true; # does not work! definitelly! | ||
6 | # vsync = "opengl-swc"; | ||
7 | vsync = "drm"; | ||
8 | # vsync-use-glfinish = true | ||
9 | |||
10 | # These are important. The first one enables the opengl backend. The last one is the vsync method. Depending on the driver you might need to use a different method. | ||
11 | # The other options are smaller performance tweaks that work well in most cases. | ||
12 | # You can find the rest of the options here: https://github.com/chjj/compton/wiki/perf-guide, and here: https://github.com/chjj/compton/wiki/vsync-guide | ||
13 | |||
14 | |||
15 | # Shadow | ||
16 | #shadow = true; # Enabled client-side shadows on windows. | ||
17 | shadow = false; # Enabled client-side shadows on windows. | ||
18 | #no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows. | ||
19 | #no-dnd-shadow = true; # Don't draw shadows on DND windows. | ||
20 | # clear-shadow = true; # Zero the part of the shadow's mask behind the window (experimental). | ||
21 | shadow-radius = 7; # The blur radius for shadows. (default 12) | ||
22 | shadow-offset-x = -7; # The left offset for shadows. (default -15) | ||
23 | shadow-offset-y = -7; # The top offset for shadows. (default -15) | ||
24 | shadow-exclude = [ | ||
25 | "! name~=''", | ||
26 | "n:e:Notification", | ||
27 | "n:e:Plank", | ||
28 | "n:e:Docky", | ||
29 | "g:e:Synapse", | ||
30 | "g:e:Kupfer", | ||
31 | "g:e:Conky", | ||
32 | "n:w:*Firefox*", | ||
33 | "n:w:*Chrome*", | ||
34 | "n:w:*Chromium*", | ||
35 | "class_g ?= 'Notify-osd'", | ||
36 | "class_g ?= 'Cairo-dock'", | ||
37 | "class_g ?= 'Xfce4-notifyd'", | ||
38 | "class_g ?= 'Xfce4-power-manager'", | ||
39 | "x = 0 && y = 0 && override_redirect = true" | ||
40 | ]; | ||
41 | |||
42 | # The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches | ||
43 | # (most applications are fine, only apps that do weird things with xshapes or argb are affected). | ||
44 | # This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. | ||
45 | |||
46 | # Fading | ||
47 | # fading = true; # Fade windows during opacity changes. | ||
48 | fade-delta = 8; # The time between steps in a fade in milliseconds. (default 10). | ||
49 | fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028). | ||
50 | fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03). | ||
51 | #no-fading-openclose = true; # Fade windows in/out when opening/closing | ||
52 | |||
53 | detect-client-opacity = true; # This prevents opacity being ignored for some apps. For example without this enabled my xfce4-notifyd is 100% opacity no matter what. | ||
54 | |||
55 | # Window type settings | ||
56 | wintypes: | ||
57 | { | ||
58 | tooltip = { fade = true; shadow = true; }; | ||
59 | }; | ||
60 | |||
61 | #opacity-rule = ["90:class_g = 'URxvt'", "90:class_g = ''" ]; | ||
62 | |||
63 | |||
64 | opacity-rule = ["90:class_g = 'xfce4-terminal'", "95:class_g = 'Xfce4-terminal'", "90:class_g = 'termite'", "90:class_g = 'i3bar'", "90:class_g = 'i3-frame'", "90:class_g = 'Gnome-terminal'", "90:class_g = 'gnome-terminal-server'" ]; | ||
diff --git a/default-font.conf b/default-font.conf deleted file mode 100644 index b1de279..0000000 --- a/default-font.conf +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | <?xml version="1.0"?> | ||
2 | <!-- this is a configuration file for fontconfig and should be copied or linked to ~/.config/fontconfig/conf.d/ --> | ||
3 | <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | ||
4 | <fontconfig> | ||
5 | <match> | ||
6 | <edit mode="prepend" name="family"><string>NotoSans-Regular</string></edit> | ||
7 | </match> | ||
8 | <match target="pattern"> | ||
9 | <test qual="any" name="family"><string>serif</string></test> | ||
10 | <edit name="family" mode="assign" binding="same"><string>Noto Serif</string></edit> | ||
11 | </match> | ||
12 | <match target="pattern"> | ||
13 | <test qual="any" name="family"><string>sans-serif</string></test> | ||
14 | <edit name="family" mode="assign" binding="same"><string>Noto Sans Mono Bold</string></edit> | ||
15 | </match> | ||
16 | <match target="pattern"> | ||
17 | <test name="family" qual="any"> | ||
18 | <string>monospace</string> | ||
19 | </test> | ||
20 | <edit binding="strong" mode="assign" name="family"> | ||
21 | <string>SauceCodePro Nerd Font Mono</string> | ||
22 | </edit> | ||
23 | <edit binding="strong" mode="assign" name="weight"> | ||
24 | <int>100</int> | ||
25 | </edit> | ||
26 | <edit binding="strong" mode="assign" name="style"> | ||
27 | <string>dz</string> | ||
28 | </edit> | ||
29 | <edit binding="strong" mode="assign" name="pixelsize"> | ||
30 | <double>14</double> | ||
31 | </edit> | ||
32 | </match> | ||
33 | </fontconfig> | ||
34 | |||
35 | <!-- | ||
36 | family: "Anonymous Pro for Powerline"(s) | ||
37 | family: "Consolas for Powerline"(s) "Consolas for Powerline FixedD"(s) | ||
38 | family: "DejaVu Sans Mono for Powerline"(s) | ||
39 | family: "Droid Sans Mono for Powerline"(s) | ||
40 | family: "Inconsolata for Powerline"(s) | ||
41 | family: "Inconsolata-dz for Powerline"(s) | ||
42 | family: "Liberation Mono for Powerline"(s) | ||
43 | family: "Menlo for Powerline"(s) | ||
44 | family: "Meslo LG L DZ for Powerline"(s) | ||
45 | family: "Meslo LG L for Powerline"(s) | ||
46 | family: "Meslo LG M DZ for Powerline"(s) | ||
47 | family: "Meslo LG M for Powerline"(s) | ||
48 | family: "Meslo LG S DZ for Powerline"(s) | ||
49 | family: "Meslo LG S for Powerline"(s) | ||
50 | family: "PowerlineSymbols"(s) | ||
51 | family: "Source Code Pro for Powerline"(s) | ||
52 | family: "Source Code Pro for Powerline"(s) "Source Code Pro Black"(s) | ||
53 | family: "Source Code Pro for Powerline"(s) "Source Code Pro ExtraLight"(s) | ||
54 | family: "Source Code Pro for Powerline"(s) "Source Code Pro Light"(s) | ||
55 | family: "Source Code Pro for Powerline"(s) "Source Code Pro Medium"(s) | ||
56 | family: "Source Code Pro for Powerline"(s) "Source Code Pro Semibold"(s) | ||
57 | family: "Terminus for Powerline"(s) | ||
58 | family: "Ubuntu Mono derivative Powerline"(s) | ||
59 | family: "xos4 Terminess Powerline"(s) | ||
60 | family: "xos4 Terminus for Powerline"(s) | ||
61 | --> | ||
diff --git a/doc/INSTALL b/doc/INSTALL deleted file mode 100644 index 9cab2dd..0000000 --- a/doc/INSTALL +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | # INSTALL | ||
2 | # this should briefly show you how to install this bundle | ||
3 | |||
4 | |||
5 | # [required steps] | ||
6 | |||
7 | # Download the current version using git (probably you already have!) | ||
8 | git clone http://git.entwicklerseite.de/vim ~/.vim | ||
9 | |||
10 | # Get the required submodule(s) | ||
11 | git submodule update --init --recursive | ||
12 | |||
13 | # start vim for the first time and use the plugin manager to install required plugins | ||
14 | vim -c ":PlugInstall" | ||
15 | |||
16 | # build YouCompleteMe | ||
17 | cd ~/.vim/plugged/YouCompleteMe | ||
18 | python ./install.py --clang-completer | ||
19 | |||
20 | |||
21 | |||
22 | |||
23 | # [optional steps] | ||
24 | # create a symbolic link to the downloaded vim.rc in you $HOME-directory | ||
25 | ln -s ~/.vim/vimrc ~/.vimrc | ||
26 | |||
27 | # gvim: make menu bar more fancy | ||
28 | ln -s ~/.vim/gtk-3.0.css ~/.config/gtk-3.0/gtk.css | ||
29 | |||
30 | # if you do not have working gvim start menu entries, try: | ||
31 | ln -s ~/.vim/gvim-tab.desktop ~/.local/share/applications/ | ||
32 | update-desktop-database ~/.local/share/applications/ | ||
33 | |||
34 | # Thunar file manager specific: create an entry in the sendto menu... | ||
35 | mkdir -p ~/.local/share/Thunar/sendto/ | ||
36 | ln -s ~/.vim/gvim-tab.desktop ~/.local/share/Thunar/sendto/ | ||
37 | |||
38 | |||
39 | |||
40 | # [random/unfinished stuff] | ||
41 | # download plugins and spell file for your language | ||
42 | # vim -c ":set spell" | ||
43 | # vim +set\ spell # < maybe that works as well | ||
44 | # :call spellfile#LoadFile(expand("de")) | ||
45 | |||
46 | # vim: noai:ts=2:sw=2 filetype=csh nolist | ||
diff --git a/doc/UPDATE b/doc/UPDATE deleted file mode 100644 index 6321b85..0000000 --- a/doc/UPDATE +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | git submodule -q foreach git pull -q origin master | ||
2 | |||
3 | In Vim: | ||
4 | :VundleUpdate | ||
diff --git a/doc/coderonline-vim.png b/doc/coderonline-vim.png deleted file mode 100644 index 156ff3a..0000000 --- a/doc/coderonline-vim.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/doc/git b/doc/git deleted file mode 100644 index 1205d00..0000000 --- a/doc/git +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | undo last commit: git reset HEAD~ | ||
2 | diff two branches: git diff branch1 branch2 path/to/file | ||
diff --git a/doc/gitignore b/doc/gitignore deleted file mode 100644 index 1d8dd28..0000000 --- a/doc/gitignore +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | # Byte-compiled / optimized / DLL files | ||
2 | __pycache__/ | ||
3 | *.py[cod] | ||
4 | |||
5 | # C extensions | ||
6 | *.so | ||
7 | |||
8 | # Distribution / packaging | ||
9 | bin/ | ||
10 | build/ | ||
11 | develop-eggs/ | ||
12 | dist/ | ||
13 | eggs/ | ||
14 | lib/ | ||
15 | lib64/ | ||
16 | parts/ | ||
17 | sdist/ | ||
18 | var/ | ||
19 | *.egg-info/ | ||
20 | .installed.cfg | ||
21 | *.egg | ||
22 | |||
23 | # Installer logs | ||
24 | pip-log.txt | ||
25 | pip-delete-this-directory.txt | ||
26 | |||
27 | # Unit test / coverage reports | ||
28 | .tox/ | ||
29 | .coverage | ||
30 | .cache | ||
31 | nosetests.xml | ||
32 | coverage.xml | ||
33 | |||
34 | # Translations | ||
35 | *.mo | ||
36 | |||
37 | # Mr Developer | ||
38 | .mr.developer.cfg | ||
39 | .project | ||
40 | .pydevproject | ||
41 | |||
42 | # Rope | ||
43 | .ropeproject | ||
44 | |||
45 | # Django stuff: | ||
46 | *.log | ||
47 | *.pot | ||
48 | |||
49 | # Sphinx documentation | ||
50 | docs/_build/ | ||
diff --git a/doc/gtk.css b/doc/gtk.css deleted file mode 100644 index 5f15661..0000000 --- a/doc/gtk.css +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | /* to be saved as ~/.config/gtk-3.0/gtk.css | ||
2 | * thanks to http://stackoverflow.com/users/6899000/proprefenetre */ | ||
3 | @define-color YOUR_BACKGROUND_COLOR #rrggbb; | ||
4 | |||
5 | window#vim-main-window { | ||
6 | background-color: @YOUR_BACKGROUND_COLOR; | ||
7 | } | ||
diff --git a/doc/list-of-filetypes.txt b/doc/list-of-filetypes.txt deleted file mode 100644 index 9752c6a..0000000 --- a/doc/list-of-filetypes.txt +++ /dev/null | |||
@@ -1,175 +0,0 @@ | |||
1 | # this list can be generated with ':setfiletype <C-d>'. I have copied it to | ||
2 | # make it searchable. | ||
3 | |||
4 | 2html erlang master sinda | ||
5 | HGAnnotate eruby matlab sindacmp | ||
6 | PKGBUILD esmtprc maxima sindaout | ||
7 | a2ps esqlc mel sisu | ||
8 | a65 esterel messages skill | ||
9 | aap eterm mf sl | ||
10 | abap euphoria3 mgl slang | ||
11 | abaqus euphoria4 mgp slice | ||
12 | abc eviews mib slim | ||
13 | abel exim mix slpconf | ||
14 | acedb expect mma slpreg | ||
15 | ada exports mmix slpspi | ||
16 | aflex falcon mmp slrnrc | ||
17 | ahdl fan modconf slrnsc | ||
18 | alsaconf fasm model sm | ||
19 | amiga fdcc modsim3 smarty | ||
20 | aml fetchmail modula2 smcl | ||
21 | ampl fgl modula3 smil | ||
22 | ansible fish monk smith | ||
23 | ansible_hosts flexwiki moo sml | ||
24 | ansible_template focexec mp snnsnet | ||
25 | ant form mplayerconf snnspat | ||
26 | antlr forth mrxvtrc snnsres | ||
27 | apache fortran msidl snobol4 | ||
28 | apachestyle foxpro msmessages solidity | ||
29 | aptconf framescript msql spec | ||
30 | arch freebasic mupad specman | ||
31 | arduino fstab mush spice | ||
32 | art fvwm mustache splint | ||
33 | asciidoc fvwm2m4 muttrc spup | ||
34 | asm gdb mysql spyce | ||
35 | asm68k gdmo named sql | ||
36 | asmh8300 gedcom nanorc sqlanywhere | ||
37 | asn git nasm sqlforms | ||
38 | aspperl gitcommit nastran sqlhana | ||
39 | aspvbs gitconfig natural sqlinformix | ||
40 | asterisk gitolite ncf sqlj | ||
41 | asteriskvm gitrebase netrc sqloracle | ||
42 | atlas gitsendemail netrw sqr | ||
43 | augeas gkrellmrc nginx squid | ||
44 | autohotkey glsl nim srec | ||
45 | autoit gnash ninja sshconfig | ||
46 | automake gnomecat nix sshdconfig | ||
47 | ave gnuplot nosyntax st | ||
48 | avra go nqc stata | ||
49 | awk godefstack nroff stp | ||
50 | ayacc godoc nsis strace | ||
51 | b gohtmltmpl obj stylus | ||
52 | baan gotexttmpl objc sudoers | ||
53 | basic gp objcpp svg | ||
54 | bc gpg ocaml svn | ||
55 | bdf gprof occam swift | ||
56 | bib grads octave syncolor | ||
57 | bib_latexSuite gretl omnimark synload | ||
58 | bindzone groff opencl syntax | ||
59 | blade groovy openroad sysctl | ||
60 | blank group opl systemd | ||
61 | bst grub ora systemverilog | ||
62 | btm gsp pamconf tads | ||
63 | bzl gtkrc papp tags | ||
64 | bzr haml pascal tak | ||
65 | c hamster passwd takcmp | ||
66 | cabal handlebars pcap takout | ||
67 | calendar haskell pccts tap | ||
68 | catalog haste pdf tar | ||
69 | cdl hastepreproc perl taskdata | ||
70 | cdrdaoconf haxe perl6 taskedit | ||
71 | cdrtoc haxe_extended pf tasm | ||
72 | cf hb pfmain tcl | ||
73 | cfg help pgsql tcsh | ||
74 | ch hercules php teraterm | ||
75 | chaiscript hex phtml terminfo | ||
76 | change hgcommit pic tex | ||
77 | changelog hitest pike tex_LatexBox | ||
78 | chaskell hog pilrc tex_latexSuite | ||
79 | cheetah hostconf pine texinfo | ||
80 | chill hostsaccess pinfo texmf | ||
81 | chordpro hss plaintex text | ||
82 | cl html plantuml textile | ||
83 | clean html5 pli tf | ||
84 | clipper htmlcheetah plm thrift | ||
85 | clojure htmldjango plp tidy | ||
86 | cmake htmlm4 plsql tilde | ||
87 | cmake-indent htmlos po tli | ||
88 | cmake-syntax hxml pod tmux | ||
89 | cmusrc ia64 postscr tomdoc | ||
90 | cobol ibasic pov toml | ||
91 | coco icemenu povini tpp | ||
92 | coffee icon ppd trasys | ||
93 | color_coded idl ppwiz treetop | ||
94 | colortest idlang prescribe trustees | ||
95 | conaryrecipe indent privoxy tsalt | ||
96 | conf inform procmail tsscl | ||
97 | config initex progress tssgm | ||
98 | context initng prolog tssop | ||
99 | cpp inittab promela tt2 | ||
100 | cql ipfilter proto tt2html | ||
101 | crm ishd protocols tt2js | ||
102 | crontab iss ps1 twig | ||
103 | cryptol ist ps1xml typescript | ||
104 | crystal j psf uc | ||
105 | cs jal ptcap udevconf | ||
106 | csc jam pug udevperm | ||
107 | cscope_plus jargon puppet udevrules | ||
108 | csdl jasmine purescript uil | ||
109 | csh java purifylog updatedb | ||
110 | csp javacc pyrex upstart | ||
111 | css javascript python upstreamdat | ||
112 | cterm jess qf upstreaminstalllog | ||
113 | ctrlh jgraph qml upstreamlog | ||
114 | cucumber jinja2 quake upstreamrpt | ||
115 | cuda jovial r usserverlog | ||
116 | cupl jproperties racc usw2kagtlog | ||
117 | cuplsim json radiance vala | ||
118 | cuda jovial r usserverlog | ||
119 | cupl jproperties racc usw2kagtlog | ||
120 | cuplsim json radiance vala | ||
121 | cvs jsp ragel valgrind | ||
122 | cvsrc jst ratpoison vb | ||
123 | cweb jsx rc vbnet | ||
124 | cynlib julia rcs vcl | ||
125 | cynpp kconfig rcslog velocity | ||
126 | d kivy readline vera | ||
127 | dart kix rebol verilog | ||
128 | datascript kotlin redif verilogams | ||
129 | dcd kscript registry vgrindefs | ||
130 | dcl kwt remind vhdl | ||
131 | debchangelog lace resolv vim | ||
132 | debcontrol latextoc reva vimgo | ||
133 | debsources latte rexx viminfo | ||
134 | def ld rhelp virata | ||
135 | denyhosts ldapconf rib vmasm | ||
136 | desc ldif rmd voscm | ||
137 | desktop less rnc vrml | ||
138 | dictconf lex rng vroom | ||
139 | dictdconf lftp rnoweb vsejcl | ||
140 | diff lhaskell robots vundlelog | ||
141 | dircolors libao rpcgen wdiff | ||
142 | dirpager lifelines rpl web | ||
143 | diva lilo rrst webmacro | ||
144 | django limits rspec wget | ||
145 | dns liquid rst whitespace | ||
146 | dnsmasq lisp rtf winbatch | ||
147 | docbk lite ruby wml | ||
148 | docbksgml litestep rust wsh | ||
149 | docbkxml logcheck samba wsml | ||
150 | dockerfile loginaccess sas wvdial | ||
151 | dosbatch logindefs sass xbl | ||
152 | dosini logtalk sather xdefaults | ||
153 | dot lotos sbt xf86conf | ||
154 | doxygen lout scala xhtml | ||
155 | dracula lpc scala.xpt xinetd | ||
156 | dsl lprolog scheme xkb | ||
157 | dtd lscript scilab xmath | ||
158 | dtml lsl screen xml | ||
159 | dtrace lss scss xmodmap | ||
160 | dts lua sd xpm | ||
161 | dylan lynx sdc xpm2 | ||
162 | dylanintr m4 sdl xquery | ||
163 | dylanlid mail sed xs | ||
164 | ecd mailaliases sendpr xsd | ||
165 | edif mailcap sensors xsl | ||
166 | eelixir make services xslt | ||
167 | eiffel mallard setserial xxd | ||
168 | elf man sgml yacc | ||
169 | elinks manconf sgmldecl yaml | ||
170 | elixir manual sgmllnx z8a | ||
171 | elm maple sh zimbu | ||
172 | elmfilt markdown sicad zsh | ||
173 | ember-script masm sieve | ||
174 | emblem mason simula | ||
175 | |||
diff --git a/doc/readme.md b/doc/readme.md deleted file mode 100644 index 68bd20b..0000000 --- a/doc/readme.md +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | <h1>vim configuration</h1> | ||
2 | This is the configuration I am using. | ||
3 | |||
4 | |||
5 | <h2>Screenshot</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/doc/screen.txt b/doc/screen.txt deleted file mode 100644 index 5c375d2..0000000 --- a/doc/screen.txt +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | To run vim inside a screen session: | ||
2 | |||
3 | TERM=vte-256color screen vim | ||
4 | |||
5 | works very well. But if you are using another terminal you may be interested in | ||
6 | other possibilities, like this: | ||
7 | |||
8 | find /usr/share/terminfo/ | grep screen | grep 256 | ||
9 | |||
diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt deleted file mode 100644 index 4d58590..0000000 --- a/doc/shortcuts.txt +++ /dev/null | |||
@@ -1,205 +0,0 @@ | |||
1 | :viusage = summary of all keyboard shortcuts | ||
2 | :options = shows currently :set options (with descriptions) | ||
3 | leader key = usually set to backslash expects a quick command | ||
4 | |||
5 | |||
6 | [normal mode] | ||
7 | f{char} = move cursor to the character {char} | ||
8 | gf = open file under cursor | ||
9 | <C-w>gf = open file under cursor in a tab | ||
10 | <C-w>] = jump to the tag under the cursor in a new window | ||
11 | <C-t> = jump back from where that ^ brought you | ||
12 | K = keyword lookup for the word under the cursor (see :help kp) | ||
13 | w = next word | ||
14 | e = end of word (=inner word) | ||
15 | |||
16 | |||
17 | @see: :h text-objects | ||
18 | ci' = change between single quote | ||
19 | ci" = change between double quote | ||
20 | ci( = change between brace | ||
21 | cit = change XML Tag | ||
22 | ciw = select inner word | ||
23 | caw = select 'a word' | ||
24 | " where c can be replaced by v for visual mode | ||
25 | |||
26 | :%s/foo/bar/g = replace all foo with bar | ||
27 | :g/foo/s/bar//g = on lines with foo replace bar with nothing | ||
28 | :g!/foo/s/bar//g = on lines not containing foo replace bar with nothing | ||
29 | :g!/^foo/execute("normal dd") delete lines starting with foo | ||
30 | |||
31 | flags, end: after the last / | ||
32 | g = replace globally (all occurances on the current line) | ||
33 | c = confirm each replace, also allows to switch to g (use the flag to see the help message) | ||
34 | e = places the cursor in the end of the selection | ||
35 | |||
36 | flags, within the search string: | ||
37 | \v = use very magic search (more like perl) | ||
38 | \V = use no very magic, more like searching verbatim | ||
39 | \zs .. \ze = mark begin and end of a sub pattern (like perl lookaround assertions) | ||
40 | |||
41 | |||
42 | |||
43 | [visual mode] # with selected lines | ||
44 | gq = formats text so that it fits in whatever :set textwidth was set | ||
45 | iB = select block between curly braces (:help object-select) | ||
46 | |||
47 | |||
48 | [commands] | ||
49 | command line mode begins with : and has its own key mappings starting with c like in cnormap | ||
50 | |||
51 | :spell [word] = adds a word to the current dictionary (no mistake any more) | ||
52 | :set list = display non printable characters | ||
53 | :retab = replaces tabs with spaces | ||
54 | :set expandtab = in insert mode: replace tab with spaces | ||
55 | :Explore = cli version open file dialog (file explorer) | ||
56 | :Lex = use netrw as project drawer (stays open in its own window) | ||
57 | :only = 'maximize' current buffer | ||
58 | |||
59 | <c-r><c-w> = auto completion with the word under the cursor (interesting with incsearch) | ||
60 | |||
61 | |||
62 | [navigation] | ||
63 | <CTRL-]> = look up the tag under the cursor (help links as well) | ||
64 | <CTRL-T> = return back from tag under the cursor | ||
65 | gd = jump to the declaration of the variable under the cursor | ||
66 | |||
67 | |||
68 | [macros] # record and play back a series of vim commands | ||
69 | qa = start (q) macro recording in register a (can be anything) | ||
70 | q = stop macro recording | ||
71 | @a = replay macro a | ||
72 | :'<,'>normal @a = apply a to every line in the current selection | ||
73 | :reg = lists all registers (including those with macros in them) | ||
74 | |||
75 | [registers] | ||
76 | notice, that registers get used for both: macro recordings and copying text | ||
77 | |||
78 | :reg = shows contents of all registers | ||
79 | "0p = pasts from register 0, which is the same as "", but not overwritten by dd | ||
80 | "ap = same for register a | ||
81 | "0yy = yanks to register 0 (same as y by itself) | ||
82 | "ay = yanks current selection to register a (in visual mode) | ||
83 | |||
84 | |||
85 | [marker] | ||
86 | ma = set marker a-z (a in this case) | ||
87 | mA = create a session persistent file marker which can be used to reopen a file (not bound to the buffer) | ||
88 | `a = go to marker a (line & column) | ||
89 | 'a = go to marker a (line, first non blank), same as `a^ | ||
90 | |||
91 | |||
92 | |||
93 | [hotkeys] | ||
94 | <C-A>, <C-X> = increment, decrement number under the cursor | ||
95 | |||
96 | |||
97 | [windows] | ||
98 | <C-W>v = splits buffer vertically (screen uses |) | ||
99 | <C-W>s = splits buffer horizontally (same as screen) | ||
100 | <C-W>w = moves the cursor to the next window and back | ||
101 | <C-W>[dir] = moves the cursor in that direction (use hjkl or arrow keys) | ||
102 | <C-W>[HK] = make a vertical split horizontal and vice versa | ||
103 | <C-W>o = only: close all other windows | ||
104 | <C-W>c = close: current window in which the cursor sits | ||
105 | |||
106 | |||
107 | [vimdiff] | ||
108 | do = get changes from other window into the current | ||
109 | dp = put changes from current window into the other | ||
110 | ]c = jump to the next change | ||
111 | [c = jump to the prevous change | ||
112 | |||
113 | [folds] | ||
114 | za = toggle a fold | ||
115 | zM = close all folds | ||
116 | zR = opens all folds (unfold all) | ||
117 | zE = eliminates all folds | ||
118 | |||
119 | |||
120 | [buffers] | ||
121 | :bn = buffer next | ||
122 | :bp = buffer previous | ||
123 | :bd = buffer dispatch (close) | ||
124 | :b <tab> = switch buffer by name (use <tab> and <return>) | ||
125 | :set nobuflisted = hide buffer in buffer list (great for neovim's terminal) | ||
126 | |||
127 | [args] | ||
128 | :n **/*.c = opens all files with that name or type in buffers and also fills the argument list | ||
129 | |||
130 | |||
131 | [special] | ||
132 | g CTRL-g = display file properties including word and char count | ||
133 | q: = show command history and use it like a normal buffer | ||
134 | z= = show spellcheck suggestions | ||
135 | |||
136 | |||
137 | [completions] | ||
138 | CTRL-O = display completions: omnicomplete (context dependant completions) | ||
139 | |||
140 | CTRL-X CTRL-F = display completions: file name (using vim-internals omnicomplete) | ||
141 | CTRL-N CTRL-P = display completions: file keywords | ||
142 | CTRL-K = display completions: dictionary | ||
143 | CTRL-T = display completions: thesaurus | ||
144 | CTRL-I = display completions: include files | ||
145 | CTRL-] = display completions: tags | ||
146 | CTRL-D = display completions: (marcro-) definitions | ||
147 | CTRL-V = display completions: vim command line | ||
148 | CTRL-U = display completions: user-defined | ||
149 | |||
150 | |||
151 | [annoyances] | ||
152 | gv = visual mode: reselect last selection | ||
153 | CTRL-o = lets the caret jump back to the previous location | ||
154 | CTRL-L = redraws the complete screen | ||
155 | CTRL-R<register> = in insert mode and command line: paste contents of <register> (e.g. : for last command, * for clipboard) | ||
156 | CTRL-R = in normal mode: redoes what has been undone with u | ||
157 | "<register>p = in normal mode: paste paste contents of <register> | ||
158 | |||
159 | [registers] | ||
160 | "/ = last search expression | ||
161 | ": = last command entered | ||
162 | "= = expression register (to do calculations or call vim functions) | ||
163 | |||
164 | |||
165 | |||
166 | [netrw] | ||
167 | :Lex = open the netrw-view as project drawer | ||
168 | gn = makes the directory under the cursor the root directory | ||
169 | a = toggles display of hidden files | ||
170 | |||
171 | [filetype:css] | ||
172 | viB:sort = sort inner block by name | ||
173 | |||
174 | [vim commands] | ||
175 | :for i in range(1,12) | put ='2016-'.i | endfor | ||
176 | |||
177 | [fancy utf-8 symbols] | ||
178 | ௵ | ||
179 | |||
180 | [debugging] | ||
181 | :profile! start /tmp/profile.log | ||
182 | :profile func * | ||
183 | :profile file * | ||
184 | " At this point do slow actions | ||
185 | :profdel * | ||
186 | :e /tmp/profile.log | ||
187 | " add a break point to a vim script (like vimrc) to invoke the internal debugger | ||
188 | :breakadd here | ||
189 | |||
190 | :finish = from within a viml-script: stop sourcing it | ||
191 | |||
192 | [substitutions] | ||
193 | delete all comments: %s/\/\*\*< [^(\*\/)]*\*\///g | ||
194 | remove empty lines: global/^$/d | ||
195 | remove non-empty lines: v/^$/d | ||
196 | |||
197 | [programs] | ||
198 | gpm - cut and paste helper for the linux console (to get text from CTRL-ALT-F2 to CTRL-ALT-F3) | ||
199 | |||
200 | |||
201 | [vim modeline] | ||
202 | filetype can have multiple values, like python.django | ||
203 | The last line can be a mode line, which holds settings like tab width: | ||
204 | |||
205 | # vim: noai:ts=2:sw=2 filetype=dosini.text | ||
diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index ca0b3c3..0000000 --- a/favicon.ico +++ /dev/null | |||
Binary files differ | |||
diff --git a/ftplugin/coffee.vim b/ftplugin/coffee.vim deleted file mode 100644 index 5d5675c..0000000 --- a/ftplugin/coffee.vim +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | let coffee_indent_keep_current = 1 " avoid problems with html indentation | ||
diff --git a/ftplugin/doxygen.vim b/ftplugin/doxygen.vim deleted file mode 100644 index dd2cdf2..0000000 --- a/ftplugin/doxygen.vim +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | let g:load_doxygen_syntax=1 | ||
diff --git a/ftplugin/help.vim b/ftplugin/help.vim deleted file mode 100644 index e2eb971..0000000 --- a/ftplugin/help.vim +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | " I will never get used to press CTRL-] to follow a link, never! | ||
2 | nnoremap <buffer> <CR> <C-]> | ||
3 | nnoremap <buffer> <BS> <C-T> | ||
diff --git a/ftplugin/nerdtree.vim b/ftplugin/nerdtree.vim deleted file mode 100644 index 62f5e5b..0000000 --- a/ftplugin/nerdtree.vim +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | autocmd! WinNew,WinEnter,WinLeave * if exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) == bufwinnr('%') | setlocal statusline=NERDTree | endif | ||
diff --git a/ftplugin/text.vim b/ftplugin/text.vim deleted file mode 100644 index 226de51..0000000 --- a/ftplugin/text.vim +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | " highlight double words (its unlikely they are right) | ||
2 | autocmd InsertLeave * syntax match Convention /\v<(\w+)\_s+\1>/ containedin=ALL | ||
diff --git a/gtk-3.0.css b/gtk-3.0.css deleted file mode 100644 index f347a83..0000000 --- a/gtk-3.0.css +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | /* | ||
2 | #vim-menubar, | ||
3 | #vim-menubar #menu, | ||
4 | #vim-toolbar, | ||
5 | #vim-gui-drawarea, | ||
6 | #vim-main-window { | ||
7 | color:#6060af; | ||
8 | color: #4e4e4e; | ||
9 | font-family: "Hasklug Nerd Font Mono", "Source Code Pro for Powerline", "Source Code Pro", "Roboto"; | ||
10 | font-weight:bold; | ||
11 | font-size:8pt; | ||
12 | border:0; | ||
13 | outline:0; | ||
14 | } | ||
15 | |||
16 | * { | ||
17 | border-width:0px; | ||
18 | outline-width:0px; | ||
19 | padding:0; | ||
20 | margin:0; | ||
21 | } | ||
22 | |||
23 | #vim-menubar | ||
24 | { | ||
25 | padding-left:1em; | ||
26 | border-bottom:2px solid #ffffff; | ||
27 | } | ||
28 | |||
29 | #vim-menubar>* | ||
30 | { | ||
31 | padding-right:1em; | ||
32 | padding-top:.25em; | ||
33 | padding-bottom:.25em; | ||
34 | } | ||
35 | |||
36 | #vim-menubar>*, | ||
37 | #vim-main-window { | ||
38 | background-color:#ffffff; | ||
39 | color: #4e4e4e; | ||
40 | } | ||
41 | |||
42 | menu menuitem:backdrop, menu menuitem:backdrop:hover | ||
43 | { | ||
44 | border:0px; | ||
45 | } | ||
46 | */ | ||
47 | |||
48 | window#vim-main-window > box | ||
49 | { | ||
50 | background:#fff; | ||
51 | border:2px solid #fff; | ||
52 | } | ||
53 | |||
54 | /* within window > box ... */ | ||
55 | menubar#vim-menubar { | ||
56 | font-family: "monospace", "Hasklug Nerd Font Mono", "Source Code Pro for Powerline", "Source Code Pro", "Roboto"; | ||
57 | font-weight:bold; | ||
58 | font-size:8pt; | ||
59 | background: #fff; | ||
60 | /* background: linear-gradient(180deg, white 85%, black); */ | ||
61 | } | ||
62 | |||
63 | menubar#vim-menubar menuitem { | ||
64 | background:transparent; | ||
65 | } | ||
66 | |||
67 | menubar#vim-menubar > menuitem { | ||
68 | padding:.25em; | ||
69 | } | ||
70 | |||
71 | menubar#vim-menubar menuitem box { | ||
72 | padding:.1em .25em; | ||
73 | } | ||
74 | |||
75 | menubar#vim-menubar menuitem window | ||
76 | { | ||
77 | margin-top:1em; | ||
78 | } | ||
79 | |||
80 | /* opened menu (after being clicked) */ | ||
81 | menubar#vim-menubar menuitem window menu { | ||
82 | padding:1px; | ||
83 | background:linear-gradient(90deg, #ccc, #fff); | ||
84 | |||
85 | } | ||
86 | |||
87 | menubar#vim-menubar menuitem window menu menuitem { | ||
88 | padding:0em; | ||
89 | margin:0px; | ||
90 | } | ||
91 | |||
92 | menubar#vim-menubar menuitem window menu menuitem box { | ||
93 | background:rgba(255,255,255,.5); | ||
94 | padding:.25em; | ||
95 | padding-left:1em; | ||
96 | |||
97 | } | ||
98 | |||
99 | menubar#vim-menubar menuitem window menu separator { | ||
100 | margin:0; | ||
101 | background:#fff; | ||
102 | border-top:1px dotted #666; | ||
103 | } | ||
104 | |||
105 | |||
106 | menubar#vim-menubar menuitem:hover { | ||
107 | box-shadow:none; | ||
108 | background:rgba(0,0,0,.2); | ||
109 | color:#000; | ||
110 | } | ||
111 | |||
112 | |||
113 | |||
114 | /* | ||
115 | toolbar button { | ||
116 | notebook tab { | ||
117 | */ | ||
diff --git a/gvim-buffer.desktop b/gvim-buffer.desktop deleted file mode 100644 index 5cd2cbf..0000000 --- a/gvim-buffer.desktop +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | [Desktop Entry] | ||
2 | Type=Application | ||
3 | Name=Gnome Vi IMproved Buffer | ||
4 | Icon=gvim | ||
5 | Comment=Open file in an existing instance of vi and in a new tab | ||
6 | 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++; | ||
7 | Exec=gvim -f -N --remote-silent %F | ||
8 | Terminal=false | ||
9 | X-XClassHintResName=VIM | ||
10 | Categories=Utility;TextEditor; | ||
diff --git a/gvim.desktop b/gvim.desktop deleted file mode 100644 index 37c6e58..0000000 --- a/gvim.desktop +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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; | ||
@@ -0,0 +1,32 @@ | |||
1 | " ====================================================================================================================== | ||
2 | " GUI_DEFAULTS: | ||
3 | " We want to have a minimal UI | ||
4 | " ====================================================================================================================== | ||
5 | |||
6 | if has("gui_running") | ||
7 | set guicursor=a:block-blinkon100 | ||
8 | set browsedir=buffer | ||
9 | set toolbar+=text | ||
10 | set guiheadroom=0 | ||
11 | set guioptions+=eig | ||
12 | set guioptions-=T | " toolbar | ||
13 | set guioptions+=c | " use console dialogues instead of popups | ||
14 | set guioptions+=a | " auto select: copy&paste using middle click | ||
15 | set guioptions+=m | " remove menu | ||
16 | set guioptions-=e | " do not display tabs | ||
17 | set guioptions-=L | " do not show left scrollbar | ||
18 | set guioptions-=r | " do not show right scrollbar | ||
19 | set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) | ||
20 | " set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END | ||
21 | " set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text | ||
22 | |||
23 | set background=light | ||
24 | " its possible to define alternative fonts (order matters), but we will | ||
25 | " use the systems default font and cofigure that if necessary | ||
26 | set guifont=Monospace\ 10 | ||
27 | |||
28 | " like in the terminal: use Ctrl-shift-v for paste in vim's command editor | ||
29 | cnoremap <c-s-v> <c-r>* | ||
30 | endif | ||
31 | |||
32 | exec ":source " . fnamemodify(expand("$MYVIMRC"), ":p:h") . "/vimrc" | ||
diff --git a/indent/.keep b/indent/.keep deleted file mode 100644 index f8e463a..0000000 --- a/indent/.keep +++ /dev/null | |||
@@ -1 +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/init-mini.lua b/init-mini.lua new file mode 100644 index 0000000..0ac8d1e --- /dev/null +++ b/init-mini.lua | |||
@@ -0,0 +1,90 @@ | |||
1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
2 | if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||
3 | vim.fn.system({ | ||
4 | "git", | ||
5 | "clone", | ||
6 | "--filter=blob:none", | ||
7 | "https://github.com/folke/lazy.nvim.git", | ||
8 | "--branch=stable", -- latest stable release | ||
9 | lazypath, | ||
10 | }) | ||
11 | end | ||
12 | vim.opt.rtp:prepend(lazypath) | ||
13 | require("lazy").setup(plugins, opts) | ||
14 | |||
15 | |||
16 | vim.opt.number = true | ||
17 | |||
18 | vim.opt.shiftwidth = 2 | ||
19 | vim.opt.tabstop = 2 | ||
20 | vim.opt.softtabstop = 2 | ||
21 | |||
22 | |||
23 | require('gitsigns').setup() | ||
24 | |||
25 | local cmp = require'cmp' | ||
26 | cmp.setup({ | ||
27 | snippet = { | ||
28 | -- REQUIRED - you must specify a snippet engine | ||
29 | expand = function(args) | ||
30 | require('luasnip').lsp_expand(args.body) -- For `luasnip` users. | ||
31 | vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) | ||
32 | end, | ||
33 | }, | ||
34 | mapping = cmp.mapping.preset.insert({ | ||
35 | ['<C-b>'] = cmp.mapping.scroll_docs(-4), | ||
36 | ['<C-f>'] = cmp.mapping.scroll_docs(4), | ||
37 | ['<C-Space>'] = cmp.mapping.complete(), | ||
38 | ['<C-e>'] = cmp.mapping.abort(), | ||
39 | ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. | ||
40 | }), | ||
41 | sources = cmp.config.sources({ | ||
42 | { name = 'nvim_lsp' }, | ||
43 | { name = 'luasnip' }, -- For luasnip users. | ||
44 | }, { | ||
45 | { name = 'buffer' }, | ||
46 | }) | ||
47 | }) | ||
48 | |||
49 | -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). | ||
50 | cmp.setup.cmdline({ '/', '?' }, { | ||
51 | mapping = cmp.mapping.preset.cmdline(), | ||
52 | sources = { | ||
53 | { name = 'buffer' } | ||
54 | } | ||
55 | }) | ||
56 | |||
57 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). | ||
58 | cmp.setup.cmdline(':', { | ||
59 | mapping = cmp.mapping.preset.cmdline(), | ||
60 | sources = cmp.config.sources({ | ||
61 | { name = 'path' } | ||
62 | }, { | ||
63 | { name = 'cmdline' } | ||
64 | }), | ||
65 | matching = { disallow_symbol_nonprefix_matching = false } | ||
66 | }) | ||
67 | |||
68 | |||
69 | require'cmp'.setup { | ||
70 | sources = { | ||
71 | { name = 'nvim_lua' } | ||
72 | } | ||
73 | } | ||
74 | |||
75 | -- Set up lspconfig. | ||
76 | local capabilities = require('cmp_nvim_lsp').default_capabilities() | ||
77 | require("neodev").setup({ | ||
78 | capabilities = capabilities, | ||
79 | }) | ||
80 | -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled. | ||
81 | require('lspconfig').lua_ls.setup({ | ||
82 | capabilities = capabilities, | ||
83 | settings = { | ||
84 | Lua = { | ||
85 | diagnostics = { | ||
86 | globals = {'vim'} | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | }) | ||
diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..a68778d --- /dev/null +++ b/init.lua | |||
@@ -0,0 +1,80 @@ | |||
1 | -------------------------------------------------------------------------------- | ||
2 | -- vim options, first sourced from vimrc, then appended by Neovim specific stuff | ||
3 | -------------------------------------------------------------------------------- | ||
4 | local configdir = vim.fn.fnamemodify(vim.fn.expand("$MYVIMRC"), ":p:h") | ||
5 | vim.cmd('source ' .. configdir .. '/vimrc') | ||
6 | |||
7 | vim.opt.encoding='utf-8' | ||
8 | vim.opt.inccommand = "nosplit" -- Neovim only: preview substitute and such things in real time | ||
9 | vim.opt.shadafile = configdir .. "/shada.file" | ||
10 | |||
11 | -------------------------------------------------------------------------------- | ||
12 | -- Bootstrap lazy.nvim | ||
13 | -------------------------------------------------------------------------------- | ||
14 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
15 | if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||
16 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" | ||
17 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) | ||
18 | if vim.v.shell_error ~= 0 then | ||
19 | vim.api.nvim_echo({ | ||
20 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, | ||
21 | { out, "WarningMsg" }, | ||
22 | { "\nPress any key to exit..." }, | ||
23 | }, true, {}) | ||
24 | vim.fn.getchar() | ||
25 | os.exit(1) | ||
26 | end | ||
27 | end | ||
28 | vim.opt.rtp:prepend(lazypath) | ||
29 | |||
30 | require("lazy").setup({ | ||
31 | spec = { | ||
32 | { import = "plugins", }, | ||
33 | 'coderonline/vim-fancy-line', | ||
34 | 'coderonline/vim-recently-used', | ||
35 | } | ||
36 | }) | ||
37 | |||
38 | -- Restore cursor position | ||
39 | vim.api.nvim_create_autocmd({ "BufReadPost" }, { | ||
40 | callback = function() vim.cmd('silent! normal! g`"zv') end | ||
41 | }) | ||
42 | |||
43 | -- LSP says 'fix available', but there is no such command? Let us fix that: | ||
44 | vim.api.nvim_create_user_command( | ||
45 | 'LspFix', | ||
46 | function() | ||
47 | vim.lsp.buf.code_action() | ||
48 | end, {} | ||
49 | ) | ||
50 | |||
51 | -- speaking of lsp, lets enable logging (TODO: remove if you remove | ||
52 | -- `lua/cmp.lua`, but why would you?) | ||
53 | vim.g.lsp_log_verbose = 1 | ||
54 | vim.g.lsp_log_file = configdir .. ('/vim-lsp.log') | ||
55 | vim.lsp.set_log_level 'error' | ||
56 | if vim.fn.has 'nvim-0.5.1' == 1 then | ||
57 | require('vim.lsp.log').set_format_func(vim.inspect) | ||
58 | end | ||
59 | |||
60 | -- If you need scoop for some dependencies on Windows machines this may come | ||
61 | -- handy: | ||
62 | if vim.fn.has("win32") then | ||
63 | vim.opt.rtp:append(vim.fn.expand("$HOME\\scoop\\shims")) | ||
64 | end | ||
65 | |||
66 | if vim.g.neovide then | ||
67 | vim.guifont = "monospace:h11:b" | ||
68 | vim.g.neovide_cursor_animation_length = 0.03 | ||
69 | vim.g.neovide_cursor_trail_size = 0.8 | ||
70 | vim.g.neovide_scroll_animation_length = 0.05 | ||
71 | vim.g.neovide_transparency = 0.9 | ||
72 | vim.g.neovide_cursor_animation_length=0 | ||
73 | vim.g.neovide_cursor_vfx_mode = "" | ||
74 | vim.g.neovide_floating_blur_amount_x = 4.0 | ||
75 | vim.g.neovide_floating_blur_amount_y = 4.0 | ||
76 | vim.g.neovide_background_color = '#383a62' | ||
77 | vim.g.neovide_scale_factor = 1.0 | ||
78 | end | ||
79 | |||
80 | -- vim: tabstop=2 shiftwidth=2 softtabstop=2 | ||
diff --git a/init.vim b/init.vim deleted file mode 120000 index c9a3c9c..0000000 --- a/init.vim +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | vimrc \ No newline at end of file | ||
diff --git a/install.sh b/install.sh deleted file mode 100644 index cfdf3bd..0000000 --- a/install.sh +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | # Welcome to Vimax! | ||
2 | # | ||
3 | # This script allows a local installation to some random path and starts | ||
4 | # the vim-EDITOR after installation is finished. That way the configuration | ||
5 | # can easily be tested. | ||
6 | # | ||
7 | # You have just executed this script | ||
8 | |||
9 | if [[ ! $EDITOR =~ ^n?g?vim?$ ]]; then | ||
10 | echo Your EDITOR environment variable is set to \"$EDITOR\" | ||
11 | echo This script requires it to be some kind of vim or nvim, gvim, vi, ... | ||
12 | echo | ||
13 | echo Please run this script with EDITOR=vim sh install.sh | ||
14 | echo Which will set the EDITOR just temporary for running this script. | ||
15 | exit | ||
16 | fi | ||
17 | |||
18 | cd $(dirname "$0") | ||
19 | |||
20 | echo "working in $(pwd)" | ||
21 | |||
22 | mkdir -p autoload | ||
23 | ln -i -s -b vimrc-full vimrc | ||
24 | |||
25 | $EDITOR -u NORC -N \ | ||
26 | +runtime plugin/netrwPlugin.vim \ | ||
27 | +'new +saveas!\ autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' \ | ||
28 | +'new +saveas!\ vimrc-full http://git.entwicklerseite.de/vim/plain/vimrc-full' \ | ||
29 | +qall | ||
30 | |||
31 | $EDITOR -u vimrc-full -N \ | ||
32 | +'PlugInstall --sync' \ | ||
33 | +qall | ||
34 | |||
35 | $EDITOR -u vimrc-full -N $0 | ||
diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100644 index 0000000..1eb9646 --- /dev/null +++ b/lua/plugins/cmp.lua | |||
@@ -0,0 +1,157 @@ | |||
1 | return { | ||
2 | { | ||
3 | 'hrsh7th/nvim-cmp', | ||
4 | dependencies = { | ||
5 | 'nvim-lua/popup.nvim', | ||
6 | 'nvim-lua/plenary.nvim', | ||
7 | 'saadparwaiz1/cmp_luasnip', | ||
8 | "hrsh7th/cmp-emoji", | ||
9 | 'hrsh7th/cmp-nvim-lsp', | ||
10 | 'hrsh7th/cmp-buffer', | ||
11 | 'hrsh7th/cmp-path', | ||
12 | 'hrsh7th/vim-vsnip', | ||
13 | 'octaltree/cmp-look', | ||
14 | 'folke/trouble.nvim', | ||
15 | { | ||
16 | 'L3MON4D3/LuaSnip', | ||
17 | config = function() | ||
18 | vim.keymap.set( | ||
19 | {"i", "s"}, | ||
20 | "<leader><Tab>", | ||
21 | function() require('luasnip').jump(1) end, | ||
22 | {silent = true} | ||
23 | ) | ||
24 | vim.keymap.set( | ||
25 | {"i", "s"}, | ||
26 | "<leader><S-Tab>", | ||
27 | function() require('luasnip').jump(-1) end, | ||
28 | {silent = true} | ||
29 | ) | ||
30 | end, | ||
31 | }, | ||
32 | }, | ||
33 | |||
34 | config = function() | ||
35 | require('trouble').setup() | ||
36 | |||
37 | local cmp = require'cmp' | ||
38 | cmp.setup({ | ||
39 | snippet = { | ||
40 | -- REQUIRED - you must specify a snippet engine | ||
41 | expand = function(args) | ||
42 | require('luasnip').lsp_expand(args.body) -- For `luasnip` users. | ||
43 | -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) | ||
44 | end, | ||
45 | }, | ||
46 | window = { | ||
47 | completion = cmp.config.window.bordered(), | ||
48 | documentation = cmp.config.window.bordered(), | ||
49 | }, | ||
50 | mapping = cmp.mapping.preset.insert({ | ||
51 | ['<C-b>'] = cmp.mapping.scroll_docs(-4), | ||
52 | ['<C-f>'] = cmp.mapping.scroll_docs(4), | ||
53 | ['<C-Space>'] = cmp.mapping.complete(), | ||
54 | ['<C-e>'] = cmp.mapping.abort(), | ||
55 | ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. | ||
56 | }), | ||
57 | sources = cmp.config.sources({ | ||
58 | { name = 'nvim_lsp' }, | ||
59 | { name = 'luasnip' }, -- For luasnip users. | ||
60 | }, { | ||
61 | { name = 'buffer' }, | ||
62 | }) | ||
63 | }) | ||
64 | end | ||
65 | }, | ||
66 | { | ||
67 | 'neovim/nvim-lspconfig', | ||
68 | dependencies = { | ||
69 | { "folke/neodev.nvim" } | ||
70 | }, | ||
71 | config = function() | ||
72 | -- Set up lspconfig. | ||
73 | local keymap = vim.keymap | ||
74 | local on_attach = function(client, bufnr) | ||
75 | local opts = { noremap = true, silent = true, buffer = bufnr } | ||
76 | keymap.set("n", "gf", "<cmd>Lspsaga lsp_finder<CR>", opts) -- show definition, references | ||
77 | keymap.set("n", "gD", "<Cmd>Lspsaga goto_definition<CR>", opts) -- got to declaration | ||
78 | keymap.set("n", "gd", "<cmd>Lspsaga peek_definition<CR>", opts) -- see definition and make edits in window | ||
79 | keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) -- go to implementation | ||
80 | keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opts) -- see available code actions | ||
81 | keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts) -- smart rename | ||
82 | keymap.set("n", "<leader>D", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show diagnostics for line | ||
83 | keymap.set("n", "<leader>d", "<cmd>Lspsaga show_cursor_diagnostics<CR>", opts) -- show diagnostics for cursor | ||
84 | keymap.set("n", "[d", "<cmd>Lspsaga diagnostic_jump_prev<CR>", opts) -- jump to previous diagnostic in buffer | ||
85 | keymap.set("n", "]d", "<cmd>Lspsaga diagnostic_jump_next<CR>", opts) -- jump to next diagnostic in buffer | ||
86 | keymap.set("n", "K", "<cmd>Lspsaga hover_doc<CR>", opts) -- show documentation for what is under cursor | ||
87 | keymap.set("n", "<leader>o", "<cmd>LSoutlineToggle<CR>", opts) -- see outline on right hand side | ||
88 | keymap.set("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts) | ||
89 | vim.keymap.set("n", "<C-n>", ":cnext<CR>") | ||
90 | vim.keymap.set("n", "<C-p>", ":cprev<CR>") | ||
91 | end | ||
92 | |||
93 | local capabilities = require("cmp_nvim_lsp").default_capabilities() | ||
94 | |||
95 | -- # Language Servers | ||
96 | -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md | ||
97 | for _,server in ipairs({ | ||
98 | 'bitbake_language_server', | ||
99 | "clangd", -- C/C++ | clang | ||
100 | "ts_ls", -- javascript | typescript-language-server | ||
101 | "lua_ls", -- lua (but not init.lua entirely, hence why neodev) | ||
102 | "jdtls", | ||
103 | "html", | ||
104 | "cssls", -- ccs | vscode-css-languageserver | ||
105 | "rust_analyzer", -- rust | rust-analyzer | ||
106 | "eslint", -- javascript | eslint | ||
107 | 'vimls', -- vimscript | vim-language-server | ||
108 | 'html', -- html | ||
109 | 'jsonls', -- jsonls | ||
110 | "pyright", -- python | ||
111 | "bashls", -- bash | bash-language-server | ||
112 | "gopls", | ||
113 | "emmet_ls", | ||
114 | "marksman"}) do | ||
115 | require("lspconfig")[server].setup({ | ||
116 | capabilities = capabilities, | ||
117 | on_attach = on_attach | ||
118 | }) | ||
119 | end | ||
120 | |||
121 | -- # specialized config for some LSPs which have non-ideal defaults | ||
122 | -- | ||
123 | -- require('lspconfig')['java_language_server'].setup{ cmd = { "/usr/share/java/java-language-server/lang_server_linux.sh" }, root_dir = function () return vim.fn.getcwd() end } | ||
124 | -- configure html server | ||
125 | require('lspconfig')["html"].setup({ | ||
126 | init_options = { | ||
127 | configurationSection = { "html", "css", "javascript" }, | ||
128 | embeddedLanguages = { | ||
129 | css = true, | ||
130 | javascript = true, | ||
131 | }, | ||
132 | provideFormatter = true, | ||
133 | }, | ||
134 | }) | ||
135 | require('lspconfig')['pylsp'].setup{ | ||
136 | settings = { | ||
137 | pylsp = { | ||
138 | plugins = { | ||
139 | pycodestyle = { | ||
140 | ignore = {'W391'}, | ||
141 | maxLineLength = 100 | ||
142 | } | ||
143 | } | ||
144 | } | ||
145 | } | ||
146 | } | ||
147 | require("lspconfig").clangd.setup { | ||
148 | on_attach = on_attach, | ||
149 | capabilities = capabilities, | ||
150 | cmd = { | ||
151 | "clangd", | ||
152 | "--offset-encoding=utf-16", | ||
153 | }, | ||
154 | } | ||
155 | end | ||
156 | } | ||
157 | } | ||
diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua new file mode 100644 index 0000000..416f2d1 --- /dev/null +++ b/lua/plugins/colorizer.lua | |||
@@ -0,0 +1,6 @@ | |||
1 | return { | ||
2 | 'norcalli/nvim-colorizer.lua', | ||
3 | config = function() | ||
4 | require('colorizer').setup() | ||
5 | end, | ||
6 | } | ||
diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..a73b1e8 --- /dev/null +++ b/lua/plugins/colorscheme.lua | |||
@@ -0,0 +1,6 @@ | |||
1 | return { | ||
2 | 'RRethy/base16-nvim', | ||
3 | config = function() | ||
4 | vim.cmd.colorscheme "base16-rebecca" | ||
5 | end, | ||
6 | } | ||
diff --git a/lua/plugins/devicons.lua b/lua/plugins/devicons.lua new file mode 100644 index 0000000..9e69c5f --- /dev/null +++ b/lua/plugins/devicons.lua | |||
@@ -0,0 +1,11 @@ | |||
1 | |||
2 | return { | ||
3 | 'nvim-tree/nvim-web-devicons', | ||
4 | config = function() | ||
5 | require'nvim-web-devicons'.setup { | ||
6 | color_icons = true; | ||
7 | default = true; | ||
8 | strict = true; | ||
9 | } | ||
10 | end, | ||
11 | } | ||
diff --git a/lua/plugins/fzf.lua b/lua/plugins/fzf.lua new file mode 100644 index 0000000..f3fc76b --- /dev/null +++ b/lua/plugins/fzf.lua | |||
@@ -0,0 +1,4 @@ | |||
1 | return { | ||
2 | 'junegunn/fzf', | ||
3 | 'junegunn/fzf.vim', | ||
4 | } | ||
diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..d88bf68 --- /dev/null +++ b/lua/plugins/gitsigns.lua | |||
@@ -0,0 +1,6 @@ | |||
1 | return { | ||
2 | 'lewis6991/gitsigns.nvim', | ||
3 | config = function() | ||
4 | require('gitsigns').setup() | ||
5 | end, | ||
6 | } | ||
diff --git a/lua/plugins/lspsaga.lua b/lua/plugins/lspsaga.lua new file mode 100644 index 0000000..ff7867b --- /dev/null +++ b/lua/plugins/lspsaga.lua | |||
@@ -0,0 +1,10 @@ | |||
1 | return { | ||
2 | 'nvimdev/lspsaga.nvim', | ||
3 | config = function() | ||
4 | require('lspsaga').setup({}) | ||
5 | end, | ||
6 | dependencies = { | ||
7 | 'nvim-treesitter/nvim-treesitter', -- optional | ||
8 | 'nvim-tree/nvim-web-devicons', -- optional | ||
9 | } | ||
10 | } | ||
diff --git a/lua/plugins/orgmode.lua b/lua/plugins/orgmode.lua new file mode 100644 index 0000000..a9d6ea0 --- /dev/null +++ b/lua/plugins/orgmode.lua | |||
@@ -0,0 +1,11 @@ | |||
1 | return { | ||
2 | 'nvim-orgmode/orgmode', | ||
3 | event = 'VeryLazy', | ||
4 | ft = { 'org' }, | ||
5 | config = function() | ||
6 | require('orgmode').setup({ | ||
7 | org_agenda_files = '~/orgfiles/**/*', | ||
8 | org_default_notes_file = '~/orgfiles/refile.org', | ||
9 | }) | ||
10 | end, | ||
11 | } | ||
diff --git a/lua/plugins/popup.lua b/lua/plugins/popup.lua new file mode 100644 index 0000000..0ff2e3a --- /dev/null +++ b/lua/plugins/popup.lua | |||
@@ -0,0 +1,5 @@ | |||
1 | return { | ||
2 | 'nvim-lua/plenary.nvim', | ||
3 | 'nvim-lua/popup.nvim', | ||
4 | } | ||
5 | |||
diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..fee09df --- /dev/null +++ b/lua/plugins/telescope.lua | |||
@@ -0,0 +1,15 @@ | |||
1 | return { | ||
2 | 'nvim-telescope/telescope.nvim', | ||
3 | dependencies = { | ||
4 | 'nvim-telescope/telescope-media-files.nvim' | ||
5 | }, | ||
6 | config = function() | ||
7 | require('telescope').load_extension('media_files') | ||
8 | |||
9 | local builtin = require('telescope.builtin') | ||
10 | vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) | ||
11 | vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) | ||
12 | vim.keymap.set('n', '<leader>fb', builtin.buffers, {}) | ||
13 | vim.keymap.set('n', '<leader>fh', builtin.help_tags, {}) | ||
14 | end, | ||
15 | } | ||
diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..9673f63 --- /dev/null +++ b/lua/plugins/treesitter.lua | |||
@@ -0,0 +1,20 @@ | |||
1 | return { | ||
2 | -- treesitter is experimental and breaks indentation on xml, html with `=` | ||
3 | -- treesitter is optional for orgmode, but without it syntax highlighting in | ||
4 | -- org files is broken | ||
5 | 'nvim-treesitter/nvim-treesitter', | ||
6 | config = function() | ||
7 | require'nvim-treesitter.configs'.setup { | ||
8 | ensure_installed = {"c", "html", "css", "javascript", "org"}, | ||
9 | sync_install = false, | ||
10 | auto_install = true, | ||
11 | ignore_install = {}, | ||
12 | disable = { }, | ||
13 | modules = { "all" }, | ||
14 | highlight = { | ||
15 | enable = true, | ||
16 | } | ||
17 | } | ||
18 | end | ||
19 | } | ||
20 | |||
diff --git a/nvim.desktop b/nvim.desktop deleted file mode 100644 index 21f0090..0000000 --- a/nvim.desktop +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | [Desktop Entry] | ||
2 | Version=1.0 | ||
3 | Type=Application | ||
4 | Name=Vim | ||
5 | Comment= | ||
6 | Exec=xfce4-terminal --icon /usr/share/icons/HighContrast/256x256/apps/vim.png -T 'nvim' -e '/bin/bash -i -c "env TERM=gnome-256color screen nvr ."' --fullscreen | ||
7 | Icon=/usr/share/icons/HighContrast/256x256/apps/vim.png | ||
8 | Path= | ||
9 | Terminal=false | ||
10 | StartupNotify=false | ||
diff --git a/plugged/.info b/plugged/.info deleted file mode 100644 index 8057473..0000000 --- a/plugged/.info +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | This file must exist, because git does not allow empty directories to be commited. | ||
diff --git a/spell/.keep b/spell/.keep deleted file mode 100644 index 6d81f6e..0000000 --- a/spell/.keep +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | vim will automatically download spellchecker dictionaries to this directory | ||
diff --git a/temp/.keep b/temp/.keep deleted file mode 100644 index 3d99c12..0000000 --- a/temp/.keep +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
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/thesaurus/php.txt b/thesaurus/php.txt deleted file mode 100644 index 133c9fe..0000000 --- a/thesaurus/php.txt +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | math abs acos acosh asin asinh atan atan2 atanh base_convert bindec ceil cos | ||
2 | errors debug_backtrace debug_print_backtrace error_get_last error_log error_reporting restore_error_handler | ||
diff --git a/vim.desktop b/vim.desktop deleted file mode 100644 index f8efe76..0000000 --- a/vim.desktop +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | [Desktop Entry] | ||
2 | X-Desktop-File-Install-Version=0.23 | ||
3 | Type=Application | ||
4 | Name=Vi IMproved->buffer2 | ||
5 | Icon=gvim | ||
6 | Comment=Open file in an existing instance of vi and in a new tab | ||
7 | 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++; | ||
8 | X-XClassHintResName=VIM | ||
9 | Categories=Application;Utility;TextEditor; | ||
10 | # Exec=vim --servername VIM --remote-silent %F | ||
11 | Exec=xfce4-terminal -e "bash -c '~/.bashrc ; vim --servername VIM --remote-silent %F'" | ||
12 | Terminal=true | ||
13 | StartupNotify=true | ||
diff --git a/vimpagerrc b/vimpagerrc deleted file mode 100644 index 9516d3c..0000000 --- a/vimpagerrc +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | let g:vimpager = {} | ||
2 | let g:less = {} | ||
3 | let g:less.enabled = 0 | ||
4 | let g:less.number = 1 | ||
5 | let g:less.hlsearch = 0 | ||
6 | let g:vimpager.ansiesc = 0 | ||
7 | let g:less.enabled = 0 | ||
8 | |||
9 | set noswapfile | ||
10 | set viminfo+=% | " restore buffer list | ||
@@ -1 +1,391 @@ | |||
1 | vimrc-full \ No newline at end of file | 1 | "======================================================================================================================= |
2 | " GENERAL | ||
3 | "======================================================================================================================= | ||
4 | set termguicolors | ||
5 | |||
6 | filetype on | ||
7 | filetype plugin on | ||
8 | filetype indent on | ||
9 | |||
10 | syntax on | " enable syntax highlighting | ||
11 | syntax sync minlines=60 | " how many preceding lines will be parsed? (high performance impact) | ||
12 | |||
13 | set secure | " to ensure, that modelines do not contain executable code | ||
14 | set noexrc | " exrc was nice, but has too many security problems. Now using editorconfig instead (see plugins) | ||
15 | set modeline | " set variables specific to a file, like indentation by adding a comment (TODO: should probably be replaced by editorconfig) | ||
16 | set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against | ||
17 | set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis | ||
18 | set ignorecase smartcase | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower) | ||
19 | set hlsearch incsearch | " highlight pattern while entering it (performance wise this isn't that good) | ||
20 | |||
21 | |||
22 | "======================================================================================================================= | ||
23 | " BASIC CODE STYLE | ||
24 | "======================================================================================================================= | ||
25 | " set cindent cinoptions+=(0 | " indents at the level of parentheses -- if desired | ||
26 | set expandtab | " replace tabs with spaces | ||
27 | set textwidth=0 | " should be set file type specific, colorcolumns is there to assist anyways | ||
28 | |||
29 | set tabstop=2 | " I am sorry, but 2 is simply better | ||
30 | set shiftwidth=2 | " . | ||
31 | set softtabstop=2 | " . | ||
32 | |||
33 | "======================================================================================================================= | ||
34 | " PATH -- where to search for includes (e.g. `gf` or `:find`) | ||
35 | "======================================================================================================================= | ||
36 | set path+=**4 | " allow recursive searches for files (limit depth by 4) | ||
37 | if executable("uname") " does not work under Windows | ||
38 | let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include" | ||
39 | endif | ||
40 | |||
41 | if filereadable("/bin/bash") | ||
42 | set shell=/bin/bash | ||
43 | elseif filereadable("/usr/local/bin/bash") | ||
44 | set shell=/usr/local/bin/bash | ||
45 | elseif has("win32") | ||
46 | set shell="cmd.exe" | ||
47 | endif | ||
48 | |||
49 | " ====================================================================================================================== | ||
50 | " SETTINGS: | ||
51 | " ====================================================================================================================== | ||
52 | set breakindent | " Every wrapped line will continue visually indented | ||
53 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | ||
54 | set concealcursor=nc | " limits the display of concealed text to normal and command mode | ||
55 | set conceallevel=2 | " replace escaped chars by their UTF-8 representation (useful for LaTeX) | ||
56 | set confirm | " asks 'do you want to save?' | ||
57 | set cpoptions+=P | " makes :w filename set the current buffer to filename | ||
58 | set hidden | " allows switching buffers even if the current buffer contains changes (displays +) | ||
59 | set linebreak | " wrap long lines at char 'breakat', not inside words | ||
60 | set mousemodel=popup | " only in gvim: right click opens a pop-up-menu | ||
61 | set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode | ||
62 | set noautochdir | " When on, Vim will change the current working directory | ||
63 | set nostartofline | " when scrolling: do not move the cursor to column 1 | ||
64 | set nowrap | " but do not (by default) wrap long lines around | ||
65 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | ||
66 | |||
67 | set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for | ||
68 | set scrolljump=4 | " how many lines get scrolled into view when cursor reaches the screens edge | ||
69 | set scrolloff=4 | " keeps cursor centered | ||
70 | set shiftround | " indent/un-indent snaps to multiple of shiftwidths | ||
71 | set writedelay=0 | ||
72 | |||
73 | " display and performance | ||
74 | set lazyredraw | " disables redraw during macro execution (improves performance, but causes problems with solid backgrounds) | ||
75 | set cmdheight=2 | " sets the command line's height | ||
76 | set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators | ||
77 | set nocursorcolumn | " turn visual cursor column off (improves performance) | ||
78 | set updatetime=80 | " updates the screen more often | ||
79 | set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry | ||
80 | set notimeout | " improves performance but is known to cause problems on slow terminals | ||
81 | set ttimeout ttimeoutlen=150 | " set Esc key timeout in ms- | ||
82 | set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) | ||
83 | set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always | ||
84 | set shortmess+=I | " don't give the intro message when starting Vim |:intro|. | ||
85 | set wildmenu | " use a menu in the command line | ||
86 | set wildmode=longest:full | " do not preselect any entry and show all possible | ||
87 | |||
88 | " code completion | ||
89 | " set dictionary=/usr/share/dict/cracklib-small | ||
90 | set isfname-== | " remove = as char in filenames, because most FSs do not support it | ||
91 | set complete+=d | " scan current and included files for defined name or macro | ||
92 | set complete+=i | " scan current and included files for completions | ||
93 | set complete+=k | " make default completer <C-N> respect the dictionary | ||
94 | set complete-=u | " scan current and included files | ||
95 | set complete+=i | " scan current and included files | ||
96 | set complete+=d | " scan current and included files for defined name or macro | ||
97 | " set complete=d | " scan current and included files for defined name or macro | ||
98 | set completeopt+=noinsert | " Do not insert any text for a match until the user selects one | ||
99 | set completeopt+=noselect | " Do not select a completion from the menu, let the user do that | ||
100 | set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] | ||
101 | set tags+=../tags | ||
102 | |||
103 | " code folding... | ||
104 | set nofoldenable | " disable folding, because we have zi to toggle foldenable :) | ||
105 | set foldclose=all | " automatically fold, when the cursor leaves the folded area | ||
106 | set foldcolumn=0 | " I think I don't need this second indicator | ||
107 | " set numberwidth=5 | ||
108 | " set foldmethod=syntax | " foldlevel: syntax, indent, manual / foldmethod=syntax makes Vim incredible slow | ||
109 | set foldnestmax=1 | " top level folding only | ||
110 | set foldopen=block,hor,search | " when do we unfold? | ||
111 | " set foldtext=printf('%*s%.*S',indent(v:foldstart),'',&textwidth-indent(v:foldstart),substitute(substitute(join(getline(v:foldstart,v:foldend),'\ '),'[[:space:]*/]\\+','\ ','g'),'^[[:space:]*]','','g')) | ||
112 | set foldtext=repeat('\ ',indent(v:foldstart)-1).join(getline(v:foldstart,v:foldend))[:winwidth(0)]->substitute('[[:space:]]\\+','\ ','g') | ||
113 | |||
114 | " works ... | ||
115 | " set foldexpr=match(synIDattr(synID(v:lnum,indent(v:lnum)+1,0),'name'),'Comment')>-1 | ||
116 | set foldexpr=!empty(filter(synstack(v:lnum,indent(v:lnum)+1),{_,val->match(synIDattr(val,'name'),'Comment')>-1})) | ||
117 | |||
118 | " vim window behaviour | ||
119 | set splitbelow | " open new windows below the current one (i find that more intuitive) | ||
120 | set splitright | " this also works for me and makes better use of the scren space I think | ||
121 | set winminwidth=0 | " (and all other windows, so TODO: watch out) | ||
122 | set winwidth=30 | " keep NERDTreeWindow at least this size | ||
123 | |||
124 | " vim session handling and restore behaviour | ||
125 | set viminfo+=% | " restore buffer list | ||
126 | set sessionoptions= | ||
127 | set sessionoptions+=buffers | ||
128 | set sessionoptions+=curdir | ||
129 | set sessionoptions+=folds | ||
130 | set sessionoptions+=resize | ||
131 | set sessionoptions+=slash | ||
132 | set sessionoptions+=tabpages | ||
133 | set sessionoptions+=unix | ||
134 | set sessionoptions+=winpos | ||
135 | set sessionoptions+=winsize | ||
136 | |||
137 | " set nocindent smartindent | " use smart indent rather then cindent | ||
138 | set noautoindent | ||
139 | set nosmartindent | ||
140 | |||
141 | set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths | ||
142 | set noequalalways | " do not evenly size windows when opening new or closing old | ||
143 | set nocursorline | " turn visual cursor line off (improves performance) | ||
144 | |||
145 | "======================================================================================================================= | ||
146 | " SPELL_CHECKING: | ||
147 | "======================================================================================================================= | ||
148 | let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell' | ||
149 | " add local user default spell file as primary source for words | ||
150 | let &spellfile=fnamemodify($MYVIMRC, ":p:h")."/spell/spellfile-user.UTF-8.add" | ||
151 | |||
152 | set nospell | " disable spell checker by default | ||
153 | set spelllang=en,de | " languages for the spell checker | ||
154 | set spellsuggest=10 | " how many words will z= suggest? | ||
155 | set thesaurus+=~/.vim/thesaurus/php.txt | ||
156 | |||
157 | if &diff " only for diff mode/vimdiff | ||
158 | set diffopt=filler,context:1000000 " filler is default and inserts empty lines for sync | ||
159 | set foldmethod=syntax | ||
160 | endif | ||
161 | |||
162 | "======================================================================================================================= | ||
163 | " UNDO: | ||
164 | " Persistent undo behaviour, also keeps undo history between starts | ||
165 | "======================================================================================================================= | ||
166 | if has('persistent_undo') | ||
167 | if isdirectory('/dev/shm') | ||
168 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undoes | ||
169 | set directory=/dev/shm/ | " swap file directory to RAM | ||
170 | set swapfile | ||
171 | elseif isdirectory('/tmp/') | ||
172 | set undodir=/tmp/ | ||
173 | endif | ||
174 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistence) | ||
175 | endif | ||
176 | |||
177 | |||
178 | "======================================================================================================================= | ||
179 | " DISPLAY & MULTI_BYTE | ||
180 | "======================================================================================================================= | ||
181 | if has("multi_byte") | ||
182 | scriptencoding utf-8 | " tell vim that we are using UTF-8 here | ||
183 | set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below) | ||
184 | set termencoding=utf-8 | " we just assume that this is supported. | ||
185 | |||
186 | set fillchars= | " initialize empty fillchars | ||
187 | set listchars= | " initialize empty listchars | ||
188 | |||
189 | if &term ==# 'linux' | ||
190 | set fillchars+=vert:\│ | " cool vertical split char | ||
191 | else | ||
192 | set fillchars+=vert:\║ | " cool vertical split char | ||
193 | endif | ||
194 | |||
195 | set fillchars+=fold:\ | " | ||
196 | set fillchars+=diff:\ | " a white space gets used here | ||
197 | |||
198 | set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) | ||
199 | set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) | ||
200 | |||
201 | set listchars+=tab:▏\ | " | ||
202 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) | ||
203 | " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) | ||
204 | " set listchars+=space:⸳ | " · | " symbols used when using :set list (which displays non-printable chars) | ||
205 | set showbreak+=› | " symbol used in the beginning of a wrapped line | ||
206 | |||
207 | " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) | ||
208 | set nolist | ||
209 | |||
210 | autocmd InsertEnter * set list | ||
211 | autocmd InsertLeave * set list& | ||
212 | |||
213 | autocmd InsertEnter * set colorcolumn=80,120 | ||
214 | autocmd InsertLeave * set colorcolumn& | ||
215 | " set fillchars+=stlnc:\― | " | ||
216 | end | ||
217 | |||
218 | |||
219 | "======================================================================================================================= | ||
220 | " AUTOCMDs and FileType specific stuff | ||
221 | "======================================================================================================================= | ||
222 | if has("autocmd") | ||
223 | " use the shada/viminfo file to return the cursor to where it was... | ||
224 | autocmd BufWinEnter * if &previewwindow | setlocal nonumber nolist signcolumn=no filetype=c nobuflisted | endif | ||
225 | |||
226 | " Workaround: Allows Vim to yank text within wayland | ||
227 | " XDG_SESSION_TYPE is only set if a login manager was used | ||
228 | " WAYLAND_DISPLAY should always work | ||
229 | " if ($XDG_SESSION_TYPE ==# 'wayland' || ! empty($WAYLAND_DISPLAY)) && !has('nvim') | ||
230 | " autocmd TextYankPost * call system("wl-copy", getreg('+')) | ||
231 | " endif | ||
232 | |||
233 | autocmd TextYankPost * echo '> text yanked to '. | ||
234 | \ (get(v:event,'regname') == '' | ||
235 | \ ? 'default register' | ||
236 | \ : 'register '.get(v:event,'regname')) | ||
237 | |||
238 | |||
239 | autocmd InsertLeave * silent! call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' }) | ||
240 | autocmd InsertEnter * silent! call matchdelete(101) | ||
241 | |||
242 | |||
243 | "==================================================================================================================== | ||
244 | augroup FILETYPES | ||
245 | " indent within <script> and <style> (default is a zero indent) | ||
246 | let g:html_indent_script1 = "inc" | ||
247 | let g:html_indent_style1 = "inc" | ||
248 | |||
249 | " let g:loaded_ruby_provider = 1 " disable ruby support | ||
250 | " let g:loaded_python_provider = 1 " disable python 3 | ||
251 | |||
252 | let g:LatexBox_latexmk_preview_continuously = 1 | ||
253 | let g:LatexBox_viewer = "evince" | ||
254 | |||
255 | autocmd FileType python setlocal keywordprg=pydoc | ||
256 | autocmd FileType vim setlocal keywordprg=:help |. | ||
257 | autocmd FileType conf setlocal isfname-== | ||
258 | autocmd Filetype css command! CSSsort :g/{/+1;/}/-1 sort | ||
259 | autocmd Filetype html,markdown,xml iabbrev </ </<C-X><C-O> | ||
260 | |||
261 | autocmd Filetype html,htmldjango,xml | ||
262 | \ :nnoremap | ||
263 | \ <M-Down> | ||
264 | \ :call search('^ *<', 'e')<CR>:nohlsearch<CR>| | ||
265 | \ :nnoremap | ||
266 | \ <M-Up> | ||
267 | \ :call search('^ *<', 'eb')<CR>:nohlsearch<CR>| | ||
268 | \ :nnoremap | ||
269 | \ <leader>= | ||
270 | \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat= | ||
271 | augroup END | ||
272 | endif | ||
273 | |||
274 | " ====================================================================================================================== | ||
275 | augroup CUSTOM_COMMANDS | ||
276 | command! Qfls call setqflist([],'r',{ 'title':'listed buffers', 'items':map(getbufinfo({"buflisted":1}), '{"bufnr":get(v:val,"bufnr"),"lnum":get(v:val,"lnum"),"module":printf("%-*s",winwidth(0)-4,fnamemodify(get(v:val,"name"),":t"))}') }) | ||
277 | command! Ctoggle | ||
278 | \ if(get(getqflist({'winid':1}), 'winid') == win_getid())|cclose|else|botright copen|endif | ||
279 | command! Ltoggle | ||
280 | \ if(get(getloclist(0, {'winid':1}), 'winid') == win_getid())|lclose|else|lopen|endif | ||
281 | command! BuffersToArg :exec ':args '.join(map(range(0, bufnr('$')), 'fnameescape(fnamemodify(bufname(v:val), ":."))')) | ||
282 | command! BufToArg :argadd %:. | ||
283 | command! Gbranch call setqflist([], 'r', {'title':'Git branch selector','items':map(systemlist("git branch"), {_, p->{'filename':'branch','module': fnamemodify(p, ':.')}})}) | ||
284 | " the following command opens a preview-window and shows the declaration of | ||
285 | " the function under the cursor. It also highlights the word to make it easier | ||
286 | " to spot within a great file | ||
287 | command! Helpme au! CursorHold * nested let @/=expand('<cword>')|exe "silent! psearch ".expand("<cword>") | ||
288 | command! FindInAllBuffers cex [] | bufdo vimgrepadd //g % | cw | ||
289 | augroup END | ||
290 | |||
291 | "======================================================================================================================= | ||
292 | augroup KEYBOARD_MAPPING | ||
293 | " map CTRL-PageUp/Down to next/previous buffer | ||
294 | " and Shift-PageUp/Down to next/previous arglist file | ||
295 | nnoremap <C-PageUp> :bn<CR> | ||
296 | nnoremap <C-PageDown> :bp<CR> | ||
297 | nnoremap <S-PageUp> :N<CR> | ||
298 | nnoremap <S-PageDown> :n<CR> | ||
299 | |||
300 | nnoremap <F4> :wincmd c<CR> | ||
301 | nnoremap <F5> :make!<CR> | ||
302 | nnoremap <F6> :silent syntax sync fromstart<CR>:nohlsearch<CR>:silent match<CR>:silent 2match<CR>:silent 3match<CR> | ||
303 | nnoremap <F7> :Ltoggle<CR> | ||
304 | nnoremap <F8> :Ctoggle<CR> | ||
305 | nnoremap <F9> :TagbarToggle<CR> | ||
306 | "" remap <..> | ||
307 | nnoremap <F12> :Qfls<CR>:Ctoggle<CR> | ||
308 | |||
309 | " close current buffer with <leader>q... | ||
310 | nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>. | ||
311 | nnoremap <leader>r :syntax sync fromstart | ||
312 | |||
313 | nnoremap <silent> <A-Up> :wincmd k<CR> | ||
314 | nnoremap <silent> <A-Down> :wincmd j<CR> | ||
315 | nnoremap <silent> <A-Left> :wincmd h<CR> | ||
316 | nnoremap <silent> <A-Right> :wincmd l<CR> | ||
317 | |||
318 | |||
319 | inoremap <C-S> <C-O>:w<CR> | ||
320 | |||
321 | " exec current line as a command, insert output of command (from: https://youtu.be/MquaityA1SM?t=35m45s) | ||
322 | nnoremap <leader>Q !!$SHELL<CR> | ||
323 | " google the word under the cursor | ||
324 | nnoremap <leader>g :execute ":!xdg-open https://google.de/search?q=".expand("<cword>")<CR> | ||
325 | nnoremap <leader>u :execute ":!xdg-open ".expand("<cWORD>")<CR> | ||
326 | " display highlight group under the cursor | ||
327 | nnoremap <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR> | ||
328 | |||
329 | |||
330 | " ====================================================================================================================== | ||
331 | " SHORTCUTS: custom shortcuts | ||
332 | " inoremap <C-Space> <C-x><C-o> | ||
333 | " inoremap <C-@> <C-Space> | ||
334 | |||
335 | " Bind CTRL+Backspace to vim's version (CTRL+W) in " <CR> insert mode (only works with gvim) | ||
336 | inoremap <C-Backspace> <C-W> | ||
337 | |||
338 | " INDENTATION: allows un-indenting a selected block and keeps selection | ||
339 | vnoremap < <gv | ||
340 | vnoremap > >gv | ||
341 | |||
342 | " make shift-home select to the beginning of the line | ||
343 | nnoremap <s-home> v^ | ||
344 | nnoremap <s-end> v$ | ||
345 | |||
346 | nnoremap <s-down> vj | ||
347 | vnoremap <s-down> j | ||
348 | nnoremap <s-up> vk | ||
349 | vnoremap <s-up> k | ||
350 | |||
351 | " if the wildmenu is configured to to display suggestions vertically, then | ||
352 | " reconfigure the cursor keys to work in that direction | ||
353 | if &wildoptions =~# 'pum' | ||
354 | cnoremap <expr> <up> pumvisible() ? "<C-p>" : "\<up>" | ||
355 | cnoremap <expr> <down> pumvisible() ? "<C-n>" : "\<down>" | ||
356 | endif | ||
357 | |||
358 | |||
359 | " INSERT_MODE_MAPPINGS: | ||
360 | " default copy&paste insert key binding (just in insert mode, so it doesn't conflict | ||
361 | " with visual block mode)- would have been nice, but collides with c-w for digraphs | ||
362 | " inoremap <C-V> <C-R>+ | ||
363 | |||
364 | " NEOVIM_SPECIFIC: | ||
365 | if has('nvim') " only neovim... | ||
366 | " shortcut \t opens a terminal in a horizontal split | ||
367 | nnoremap <leader>t :new +terminal<CR> | ||
368 | endif | ||
369 | augroup END | ||
370 | |||
371 | augroup NETRW | ||
372 | " Deprecated with this configuration, but still useful when deactivating some Plugins | ||
373 | " NETRW: obsolete with NERDTree | ||
374 | let g:netrw_alto = 0 | " open files on the right | ||
375 | let g:netrw_altv = 1 | " open files on the right | ||
376 | let g:netrw_banner = 0 | " display help messages? | ||
377 | let g:netrw_browse_split = 4 | " 4=open in previous window | ||
378 | let g:netrw_fastbrowse = 2 | " manually refresh direcory list (avoids display errors) | ||
379 | let g:netrw_hide = 1 | " show not-hidden files only | ||
380 | let g:netrw_keepdir = 1 | " because that works better, when gf finds a path name | ||
381 | let g:netrw_list_hide = '^\..*' | " Explore mode: hide files starting with dot | ||
382 | let g:netrw_liststyle = 3 | " 3=tree | ||
383 | let g:netrw_preview = 0 | " | ||
384 | let g:netrw_winsize = 20 | " window size in percent | ||
385 | " let s:treedepthstring = "│ " | " this is not going to work, but left here for documentation | ||
386 | augroup END | ||
387 | |||
388 | |||
389 | "======================================================================================================================= | ||
390 | " v modeline, do not chnage v | ||
391 | " vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:\<,\>,\-,\& number | ||
diff --git a/vimrc-full b/vimrc-full deleted file mode 100644 index 468c505..0000000 --- a/vimrc-full +++ /dev/null | |||
@@ -1,1295 +0,0 @@ | |||
1 | " vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\!,\<,\>,\-,\& number | ||
2 | |||
3 | "======================================================================================================================= | ||
4 | " GENERAL: | ||
5 | "======================================================================================================================= | ||
6 | set exrc | " enable exrc, a specific .exrc per project, which can contain usual .vimrc commands | ||
7 | set textwidth=0 | " better done with modeline or local exrc and not here | ||
8 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline or local exrc | ||
9 | set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against | ||
10 | set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis | ||
11 | set ignorecase smartcase hlsearch | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower) | ||
12 | set cindent cinoptions+=(0 | " indent at parentheses | ||
13 | |||
14 | |||
15 | set path+=** | " allow recursive searches for files | ||
16 | let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include" | ||
17 | |||
18 | "======================================================================================================================= | ||
19 | " SHELL | ||
20 | "======================================================================================================================= | ||
21 | if filereadable("/bin/bash") | ||
22 | set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here | ||
23 | elseif filereadable("/usr/local/bin/bash") | ||
24 | set shell=/usr/local/bin/bash | ||
25 | endif | ||
26 | |||
27 | "======================================================================================================================= | ||
28 | " Persistent undo | ||
29 | "======================================================================================================================= | ||
30 | if has('persistent_undo') | ||
31 | if isdirectory('/dev/shm') | ||
32 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undoes | ||
33 | set directory=/dev/shm/ | " swap file directory to RAM | ||
34 | set swapfile | ||
35 | elseif isdirectory('/tmp/') | ||
36 | set undodir=/tmp/ | ||
37 | endif | ||
38 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistence) | ||
39 | endif | ||
40 | |||
41 | "======================================================================================================================= | ||
42 | " multi byte | ||
43 | "======================================================================================================================= | ||
44 | if has("multi_byte") | ||
45 | scriptencoding utf-8 | " tell vim that we are using UTF-8 here | ||
46 | set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below) | ||
47 | let &termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those | ||
48 | |||
49 | set fillchars= | " initialize empty fillchars | ||
50 | set listchars= | " initialize empty listchars | ||
51 | |||
52 | if &term == "linux" | ||
53 | set fillchars+=vert:\│ | " cool vertical split char | ||
54 | else | ||
55 | set fillchars+=vert:\║ | " cool vertical split char | ||
56 | endif | ||
57 | |||
58 | set fillchars+=fold:\ | " | ||
59 | set fillchars+=diff:\ | " a white space gets used here | ||
60 | |||
61 | set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) | ||
62 | set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) | ||
63 | |||
64 | set listchars+=tab:▏\ | " | ||
65 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) | ||
66 | " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) | ||
67 | set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) | ||
68 | set showbreak+=› | " symbol used in the beginning of a wrapped line | ||
69 | |||
70 | " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) | ||
71 | set nolist | ||
72 | autocmd InsertEnter * set list | ||
73 | autocmd InsertLeave * set nolist | ||
74 | " set fillchars+=stlnc:\― | " | ||
75 | end | ||
76 | |||
77 | |||
78 | "======================================================================================================================= | ||
79 | " SPELL_CHECKING | ||
80 | "======================================================================================================================= | ||
81 | let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' | ||
82 | " add local user default spell file as primary source for words | ||
83 | let &spellfile=fnamemodify($MYVIMRC, ":p:h")."/spell/spellfile-user.UTF-8.add" | ||
84 | |||
85 | set nospell | " disable spell checker by default | ||
86 | set spelllang=en,de | " languages for the spell checker | ||
87 | set spellsuggest=10 | " how many words will z= suggest? | ||
88 | set thesaurus+=~/.vim/thesaurus/php.txt | ||
89 | |||
90 | "======================================================================================================================= | ||
91 | " cscope | ||
92 | "======================================================================================================================= | ||
93 | " http://vim.wikia.com/wiki/Cscope | ||
94 | if has('cscope') " compiled with cscope support? | ||
95 | set cscopetag " CTRL-] uses cscope first, then ctags | ||
96 | set cscopeverbose | ||
97 | |||
98 | if has('quickfix') | ||
99 | set cscopequickfix=s+,c+,d+,i+,t+,e+ | ||
100 | endif | ||
101 | |||
102 | if has('menu') | ||
103 | 1001menu &Cscope.find.c\ symbol | ||
104 | \<tab>s | ||
105 | \ :cscope find s <cword><:cR> | ||
106 | 1001menu &Cscope.find.definition | ||
107 | \<tab>g | ||
108 | \ :cscope find g <cword><:cR> | ||
109 | 1001menu &Cscope.find.functions\ called\ by\ this | ||
110 | \<tab>d | ||
111 | \ :cscope find d <cword><:cR> | ||
112 | 1001menu &Cscope.find.functions\ calling\ this | ||
113 | \<tab>c | ||
114 | \ :cscope find c <cword><:cR> | ||
115 | 1001menu &Cscope.find.text\ string | ||
116 | \<tab>t | ||
117 | \ :cscope find t <cword><:cR> | ||
118 | 1001menu &Cscope.find.egrep\ pattern | ||
119 | \<tab>e | ||
120 | \ :cscope find e <cword><:cR> | ||
121 | 1001menu &Cscope.find.this\ file | ||
122 | \<tab>f | ||
123 | \ :cscope find f <cword><:cR> | ||
124 | 1001menu &Cscope.find.files\ including\ this\ file | ||
125 | \<tab>i | ||
126 | \ :cscope find i <cword><:cR> | ||
127 | 1001menu &Cscope.find.places\ where\ this\ symbol\ is\ assigned\ a\ value | ||
128 | \<tab>a | ||
129 | \ :cscope find a <cword><:cR> | ||
130 | 1001menu &Cscope.-Sep1- | ||
131 | \ : | ||
132 | 1001menu &Cscope.create\ and\ add\ database | ||
133 | \ :cscope kill -1<CR>:execute '!find -type f -regex ".*\.\(c\\|h\\|cpp\\|cxx\\|hh\\|hpp\\|hxx\)$" <bar> cscope -i- -b -q -v'<CR>:cscope add .<CR> | ||
134 | 1001menu &Cscope.-Sep2- | ||
135 | \ : | ||
136 | 1001menu &Cscope.add\ \. | ||
137 | \ :cscope add .<CR> | ||
138 | 1001menu &Cscope.show | ||
139 | \ :cscope show<CR> | ||
140 | 1001menu &Cscope.reset | ||
141 | \ :cscope reset<CR> | ||
142 | endif | ||
143 | endif | ||
144 | |||
145 | " ====================================================================================================================== | ||
146 | " GUI_VERSION | ||
147 | " ====================================================================================================================== | ||
148 | if has("gui_running") | ||
149 | set guicursor=a:block-blinkon100 | ||
150 | set browsedir=buffer | ||
151 | set toolbar+=text | ||
152 | set guiheadroom=0 | ||
153 | set guioptions+=eig | ||
154 | set guioptions-=T | " toolbar | ||
155 | set guioptions+=c | " use console dialogues instead of popups | ||
156 | set guioptions+=a | " auto select: copy&paste using middle click | ||
157 | set guioptions+=m | " remove menu | ||
158 | set guioptions-=e | " do not display tabs | ||
159 | set guioptions-=L | " do not show left scrollbar | ||
160 | set guioptions-=r | " do not show right scrollbar | ||
161 | set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) | ||
162 | " set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END | ||
163 | " set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text | ||
164 | |||
165 | |||
166 | " its possible to define alternative fonts (order matters) | ||
167 | set guifont=Monospace\ 10 | ||
168 | set guifont+=Noto\ Sans\ Mono\ Bold | ||
169 | set guifont+=Noto\ Sans\ Mono\ Bold | ||
170 | set guifont+=Hasklug\ Nerd\ Font\ Mono\ Semi-Bold\ 10 | ||
171 | set guifont+=Hasklig\ Semi-Bold\ 10 | ||
172 | set guifont+=Bitstream\ Vera\ Sans\ Mono\ 10 | ||
173 | set guifont+=FuraMono\ Nerd\ Font\ Mono\ Medium\ 11 | ||
174 | set guifont+=Source\ Code\ Pro\ for\ Powerline\ SemiBold\ 10 | ||
175 | set guifont+=LiterationMono\ Nerd\ Font\ Mono\ 10 | ||
176 | set guifont+=RobotoMono\ Nerd\ Font\ Medium\ 10 | ||
177 | set guifont+=Source\ Code\ Pro\ Semi-Bold\ 10 | ||
178 | set guifont+=Dejavu\ Sans\ Mono\ for\ Powerline\ Semibold | ||
179 | set guifont+=Droid\ Sans\ Mono\ for\ Powerline\ 10 | ||
180 | set guifont+=Meslo\ LG\ M\ for\ Powerline\ 10 | ||
181 | |||
182 | " like in the terminal: use Ctrl-shift-v for paste in vim's command editor | ||
183 | cnoremap <c-s-v> <c-r>* | ||
184 | endif | ||
185 | |||
186 | " ====================================================================================================================== | ||
187 | " SETTINGS: | ||
188 | " ====================================================================================================================== | ||
189 | set breakindent | " Every wrapped line will continue visually indented | ||
190 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | ||
191 | set concealcursor=nc | " limits the display of concealed text to normal and command mode | ||
192 | set conceallevel=2 | " replace escaped chars by their UTF-8 representation (useful for LaTeX) | ||
193 | set confirm | " asks 'do you want to save?' | ||
194 | set cpoptions+=P | " makes :w filename set the current buffer to filename | ||
195 | set hidden | " allows switching buffers even if the current buffer contains changes (displays +) | ||
196 | set linebreak | " wrap long lines at char 'breakat', not inside words | ||
197 | set mousemodel=popup | " only in gvim: right click opens a pop-up-menu | ||
198 | set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode | ||
199 | set noautochdir | " When on, Vim will change the current working directory | ||
200 | set nostartofline | " when scrolling: do not move the cursor to column 1 | ||
201 | set nowrap | " but do not (by default) wrap long lines around | ||
202 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | ||
203 | set incsearch | " highlight pattern while entering it (performance wise this isn't that good) | ||
204 | |||
205 | if has('nvim') " Neovim? | ||
206 | set inccommand=nosplit | " preview substitute and such things in real time | ||
207 | endif | ||
208 | |||
209 | set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for | ||
210 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge | ||
211 | set scrolloff=0 | " keeps cursor centered | ||
212 | set shiftround | " indent/un-indent snaps to multiple of shiftwidths | ||
213 | set writedelay=0 | ||
214 | |||
215 | " display and performance | ||
216 | set lazyredraw | " disables redraw during macro execution (improves performance) | ||
217 | set cmdheight=2 | " sets the command line's height | ||
218 | set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators | ||
219 | set nocursorcolumn | " turn visual cursor column off (improves performance) | ||
220 | set updatetime=80 | " updates the screen more often | ||
221 | set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry | ||
222 | set notimeout | " improves performance but is known to cause problems on slow terminals | ||
223 | set ttimeout ttimeoutlen=150 | " set Esc key timeout in ms- | ||
224 | set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) | ||
225 | set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always | ||
226 | set shortmess+=I | " don't give the intro message when starting Vim |:intro|. | ||
227 | set wildmenu | " use a menu in the command line | ||
228 | set wildmode=longest:full | " do not preselect any entry and show all possible | ||
229 | |||
230 | " code completion | ||
231 | " set dictionary=/usr/share/dict/cracklib-small | ||
232 | " set complete+=k " make default completer <C-N> respect the dictionary | ||
233 | set complete-=u " scan current and included files | ||
234 | set complete+=i " scan current and included files | ||
235 | set complete+=d " scan current and included files for defined name or macro | ||
236 | set complete+=d | " scan current and included files for defined name or macro | ||
237 | set complete+=i | " scan current and included files for completions | ||
238 | set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] | ||
239 | set tags+=../tags | ||
240 | |||
241 | " code folding... | ||
242 | set nofoldenable | " disable folding, because we have zi to toggle foldenable :) | ||
243 | set foldclose=all | " automatically fold, when the cursor leaves the folded area | ||
244 | set foldcolumn=1 | " I think I don't need this second indicator | ||
245 | " set numberwidth=5 | ||
246 | " set foldmethod=syntax | " foldlevel: syntax, indent, manual / foldmethod=syntax makes Vim incredible slow | ||
247 | set foldnestmax=1 | " top level folding only | ||
248 | set foldopen=block,hor,search | " when do we unfold? | ||
249 | " set foldtext=Foldtext() | " | ||
250 | " set foldtext=v:folddashes.substitute(getline(v:foldstart),'\\v^/[/*]\','','g') | ||
251 | " set foldtext='⊞\ '.substitute(getline(v:foldstart),'^[\ '.printf(&cms,'').']*','','').'↵'.getline(v:foldstart+1).'↵'.getline(v:foldstart+2) | ||
252 | " set foldtext=repeat('',indent(v:foldstart)).substitute(substitute(substitute(join(getline(v:foldstart,v:foldend)),'\\s\\s\\+\\\|\[\*\/\]','\ ','g'),'\^\\s\\+','','g'),\ '\\s\\s\\+',\ '\ ',\ 'g') | ||
253 | set foldtext=printf('%*s%.*S',indent(v:foldstart),'',&textwidth-indent(v:foldstart),substitute(substitute(join(getline(v:foldstart,v:foldend),'\ '),'[[:space:]]\\+','\ ','g'),'^[[:space:]]','','g')) | ||
254 | |||
255 | " works ... | ||
256 | " set foldexpr=match(synIDattr(synID(v:lnum,indent(v:lnum)+1,0),'name'),'Comment')>-1 | ||
257 | set foldexpr=!empty(filter(synstack(v:lnum,indent(v:lnum)+1),{_,val->match(synIDattr(val,'name'),'Comment')>-1})) | ||
258 | |||
259 | " set foldtext=printf('%*s%.'.eval(&textwidth-indent(v:foldstart)).'S',indent(v:foldstart),'',substitute(substitute(substitute(join(getline(v:foldstart,v:foldend)),'\\s\\s\\+\\\|\[\*\/\]','\ ','g'),'\^\\s\\+','','g'),\ '\\s\\s\\+',\ '\ ',\ 'g')) | ||
260 | |||
261 | " vim window behaviour | ||
262 | set splitbelow | " open new windows below the current one (i find that more intuitive) | ||
263 | set splitright | " this also works for me and makes better use of the scren space I think | ||
264 | set winminwidth=0 | " (and all other windows, so TODO: watch out) | ||
265 | set winwidth=30 | " keep NERDTreeWindow at least this size | ||
266 | |||
267 | |||
268 | " vim session handling and restore behaviour | ||
269 | set viminfo+=% | " restore buffer list | ||
270 | set sessionoptions= | ||
271 | set sessionoptions+=buffers | ||
272 | set sessionoptions+=curdir | ||
273 | set sessionoptions+=folds | ||
274 | set sessionoptions+=resize | ||
275 | set sessionoptions+=slash | ||
276 | set sessionoptions+=tabpages | ||
277 | set sessionoptions+=unix | ||
278 | set sessionoptions+=winpos | ||
279 | set sessionoptions+=winsize | ||
280 | |||
281 | |||
282 | " set nocindent smartindent | " use smart indent rather then cindent | ||
283 | set noautoindent | ||
284 | set nosmartindent | ||
285 | |||
286 | set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths | ||
287 | set noequalalways | " do not evenly size windows when opening new or closing old | ||
288 | set nocursorline | " turn visual cursor line off (improves performance) | ||
289 | "======================================================================================================================= | ||
290 | |||
291 | " Vim 8 has a terminal command... | ||
292 | if has('terminal') | ||
293 | " use default ESC key to leave insert mode in the internal terminal emulator | ||
294 | tnoremap <Esc> <C-W>N | ||
295 | " make terminal windows hidden by default (copied from :help terminal) | ||
296 | autocmd BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif | ||
297 | endif | ||
298 | |||
299 | |||
300 | " NEOVIM_incompatible: | ||
301 | " | ||
302 | if has('nvim') " Neovim? | ||
303 | autocmd TermOpen term://* set nobuflisted | ||
304 | " use default ESC key to leave insert mode in the internal terminal emulator | ||
305 | tnoremap <Esc> <C-\><C-n> | ||
306 | " set shada+=n~/.vim/shada | " shada file to use | ||
307 | " | ||
308 | menu &UI.&Open\ in\ Serversession | ||
309 | \ :execute ':!nvr --servername /tmp/nvimsocket --remote % +'.line('.')<CR>:stopinsert<CR>:set readonly<CR> | ||
310 | |||
311 | else " default Vim? | ||
312 | autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") | ||
313 | |||
314 | set ttymouse=xterm2 | ||
315 | set ttyscroll=100 | " improves speed for terminal vim, incompatible with nvim | ||
316 | set ttyfast | " improves speed for terminal vim (incompatible with nvim) | ||
317 | set nottybuiltin | " use external termcaps | ||
318 | set restorescreen | " restores the console after exiting vim (intentionally not in nvim) | ||
319 | " | ||
320 | let g:loaded_ruby_provider = 1 " disable ruby support | ||
321 | let g:loaded_python_provider = 1 " disable python 3 | ||
322 | |||
323 | if version >= 702 " clean up (see: http://vim.wikia.com/wiki/VimTip396) | ||
324 | autocmd BufWinLeave * call clearmatches() | ||
325 | endif | ||
326 | |||
327 | |||
328 | " scripts from the default vim installation, which do not get loaded by default, but are useful. | ||
329 | if filereadable($VIMRUNTIME.'/macros/editexisting.vim') | ||
330 | packadd! editexisting | ||
331 | endif | ||
332 | |||
333 | " load default plugin 'matchit' to allow % to jump between tags | ||
334 | if filereadable($VIMRUNTIME.'/macros/matchit.vim') | ||
335 | packadd! matchit | ||
336 | endif | ||
337 | |||
338 | endif | ||
339 | |||
340 | |||
341 | if has("autocmd") | ||
342 | set modeline | " set variables specific to a file, like indentation by adding a comment | ||
343 | " set default completion function in case YouCompleteMe cannot help | ||
344 | " set omnifunc=syntaxcomplete#Complete | ||
345 | |||
346 | augroup set_window_title " { | ||
347 | " autocmd BufEnter * let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" | ||
348 | autocmd CursorHold * let &titlestring = "%t %y ".$USER."@".hostname().":%{expand(\"%:~:.:h\")}" | ||
349 | set title | ||
350 | " autocmd CursorHold * let &titlestring = "Vim (".airline#extensions#tagbar#currenttag().")" | ||
351 | |||
352 | " set window title for screen(3) | ||
353 | if &term == "screen" | ||
354 | set t_ts=k | ||
355 | set t_fs=\ | ||
356 | endif | ||
357 | if &term == "screen" || &term == "xterm" | ||
358 | set titlelen=40 | ||
359 | set title | ||
360 | endif | ||
361 | augroup END | ||
362 | |||
363 | augroup ChangeIcon | ||
364 | "if filereadable("/usr/bin/xseticon") | ||
365 | "if filereadable("~/.vim/nvim.png") | ||
366 | " autocmd VimEnter * silent :execute "!xseticon -id $WINDOWID ~/.vim/nvim.png" | ||
367 | " autocmd VimLeave * silent :execute "!xseticon -id $WINDOWID /usr/share/icons/gnome/32x32/apps/xfce-terminal.png" | ||
368 | "endif | ||
369 | "endif | ||
370 | augroup END | ||
371 | |||
372 | " Fix terminal title ================================================================================================= | ||
373 | " autocmd VimEnter * let &t_EI .= "\<Esc>[0 q" | ||
374 | " autocmd VimEnter * let &t_SI = "\<Esc>]12;green\x7" | ||
375 | autocmd VimLeave * silent !echo -ne "\033]112\007" | ||
376 | |||
377 | " highlight word under the cursor ==================================================================================== | ||
378 | let w:m1 = 0 | ||
379 | function! HighlightWordUnderCursor() | ||
380 | if(exists('w:m1') && w:m1 > 0) | ||
381 | silent! call matchdelete(w:m1) | ||
382 | let w:m1 = 0 | ||
383 | endif | ||
384 | let l:currentword = escape(expand('<cword>'), '.') | ||
385 | if(strlen(l:currentword) > 0) | ||
386 | let w:m1=100 | ||
387 | silent! call matchadd('BoldUnderline', '\<'.l:currentword.'\>', -1, w:m1) | ||
388 | endif | ||
389 | endfunction | ||
390 | autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor() | ||
391 | |||
392 | " hitting K over a keyword shows a help in a buffer. | ||
393 | " Here we define the commands used to look those keywords up | ||
394 | " as per file type... | ||
395 | augroup filetype_specific | ||
396 | autocmd FileType python setlocal keywordprg=pydoc | ||
397 | autocmd FileType vim setlocal keywordprg=:help |. | ||
398 | autocmd FileType c,cpp setlocal equalprg=clang-format | ||
399 | autocmd FileType c,cpp setlocal breakat-=- | ||
400 | |||
401 | if filereadable("/usr/bin/vendor_perl/ack") | ||
402 | autocmd FileType c,cpp set grepprg=/usr/bin/vendor_perl/ack\ --type=cc\ --nogroup\ --column\ $* | ||
403 | autocmd FileType c,cpp set grepformat=%f:%l:%c:%m | ||
404 | endif | ||
405 | |||
406 | autocmd BufWinEnter * if &previewwindow | setlocal nonumber signcolumn=no filetype=c nobuflisted | endif | ||
407 | |||
408 | |||
409 | " autocmd FileType c,cpp setlocal iskeyword-=_ | ||
410 | |||
411 | " the following helps to make file=/etc/something work with gf, but disallows filenames with an equal sign in them | ||
412 | autocmd FileType conf setlocal isfname-== | ||
413 | |||
414 | |||
415 | autocmd Filetype css command! CSSsort :g/{/+1;/}/-1 sort | ||
416 | |||
417 | " keyboard mapping for xml alike languages | ||
418 | " Alt-Up : Move cursor up one tag | ||
419 | " Alt-Down: Move cursor down one tag | ||
420 | " leader-=: tidies currently selected tag and subtags and sorts attributes by name (alphabetically) | ||
421 | autocmd Filetype html,markdown,xml iabbrev </ </<C-X><C-O> | ||
422 | autocmd Filetype html,htmldjango,xml | ||
423 | \ :nnoremap | ||
424 | \ <M-Down> | ||
425 | \ :call search('^ *<', 'e')<CR>:nohlsearch<CR>| | ||
426 | \ :nnoremap | ||
427 | \ <M-Up> | ||
428 | \ :call search('^ *<', 'eb')<CR>:nohlsearch<CR>| | ||
429 | \ :nnoremap | ||
430 | \ <leader>= | ||
431 | \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat= | ||
432 | augroup END | ||
433 | |||
434 | " autocmd BufNewFile set nobuflisted | ||
435 | " use the shada/viminfo file to return the cursor to where it was... | ||
436 | autocmd BufReadPost * call setpos(".", getpos("'\"")) | ||
437 | |||
438 | augroup CurrentFileName | ||
439 | " highlight the current files name inside the document... | ||
440 | let @g = ":exe ':match SpellBad /'.escape(expand('%:t'), '.').'/'" | ||
441 | " put the current files name after the cursor... | ||
442 | let @f = ":exe ':normal a'.expand('%:t')" | ||
443 | |||
444 | " grep all buffers for a given string and return result in a quickfix window | ||
445 | let @q = ":cex [] | bufdo vimgrepadd /foo/g % | cw" | ||
446 | |||
447 | let @l = ":let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}|:SignifyRefresh" | ||
448 | |||
449 | if has('menu') | ||
450 | source $VIMRUNTIME/menu.vim | ||
451 | set wildmenu | ||
452 | set cpo-=< | ||
453 | set wcm=<C-Z> | ||
454 | |||
455 | 01menu &Functions.toggle\ file\ browser | ||
456 | \<Tab><leader><leader> | ||
457 | \ <leader><leader> | ||
458 | 01menu &Functions.-Sep0- : | ||
459 | |||
460 | 01menu &Functions.help | ||
461 | \<Tab><F1> | ||
462 | \ <F1> | ||
463 | 01menu &Functions.bp:\ previous\ buffer | ||
464 | \<Tab><F2> | ||
465 | \ <F2> | ||
466 | 01menu &Functions.bn:\ next\ buffer | ||
467 | \<Tab><F3> | ||
468 | \ <F3> | ||
469 | 01menu &Functions.^wc\:\ close\ window | ||
470 | \<Tab><F4> | ||
471 | \ <F4> | ||
472 | 01menu &Functions.-Sep1- : | ||
473 | |||
474 | 01menu &Functions.make | ||
475 | \<Tab><F5> | ||
476 | \ <F5> | ||
477 | 01menu &Functions.clear\ matches,\ update\ viewport | ||
478 | \<Tab><F6> | ||
479 | \ <F6> | ||
480 | 01menu &Functions.copen\:\ show\ quickfix\ list | ||
481 | \<Tab><F7> | ||
482 | \ <F7> | ||
483 | 01menu &Functions.lopen\:\ show\ location\ list | ||
484 | \<Tab><F8> | ||
485 | \ <F8> | ||
486 | 01menu &Functions.-Sep2- : | ||
487 | |||
488 | 01menu &Functions.toggle\ tagbar | ||
489 | \<Tab><F9> | ||
490 | \ <F9> | ||
491 | |||
492 | if has("gui_running") == 0 | ||
493 | " in the gui F10 already triggers the menu, not in a terminal vim, so upgrade that... | ||
494 | map <F10> :emenu <C-Z> | ||
495 | endif | ||
496 | 01menu &Functions.activate\ menu\ (:emenu) | ||
497 | \<Tab><F10> | ||
498 | \ <F10> | ||
499 | |||
500 | 01menu &Functions.undef11 | ||
501 | \<Tab><F11> | ||
502 | \ <F11> | ||
503 | 01menu &Functions.undef12 | ||
504 | \<Tab><F12> | ||
505 | \ <F12> | ||
506 | 01menu &Functions.-Sep2- : | ||
507 | |||
508 | |||
509 | 09menu &Directory.print\ current\ directory | ||
510 | \<Tab>:pwd | ||
511 | \ :pwd<CR> | ||
512 | |||
513 | 09menu &Directory.-Sep- : | ||
514 | |||
515 | 09menu &Directory.Change\ to\ GIT\ root | ||
516 | \<Tab>:Gcd | ||
517 | \ :Gcd<CR>:pwd<CR> | ||
518 | |||
519 | 09menu &Directory.Change\ to\ current\ buffers\ directory\ (global) | ||
520 | \<tab>:cd\ %:p:h | ||
521 | \ :cd %:h<CR>:pwd<CR> | ||
522 | |||
523 | 09menu &Directory.Change\ to\ current\ buffers\ directory\ (local\ window)<tab>:lcd\ %:p:h | ||
524 | \ :lcd %:p:h<CR>:pwd<CR> | ||
525 | |||
526 | menu &Git.&Display\ uncommited\ files\ in\ location\ list | ||
527 | \ :call setloclist(0, map(systemlist("git diff --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR> | ||
528 | menu &Git.&Display\ recently\ changed\ files\ in\ quickfix\ list | ||
529 | \ :call setqflist([], 'r', {'title': 'Recently changed in GIT', 'items':map(systemlist("git show --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}) })<CR>:copen<CR> | ||
530 | menu &Git.&Display\ last\ changes | ||
531 | \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}<CR>:SignifyRefresh<CR> | ||
532 | menu &Git.&Display\ unmerged\ files\ in\ location\ list | ||
533 | \ :call setloclist(0, map(systemlist("git diff --name-only --diff-filter=U \| uniq"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR> | ||
534 | menu &Git.&Display\ significance\ of\ changes | ||
535 | \ :!git diff --stat HEAD~1..HEAD | ||
536 | menu &Git.&Display\ Changed\ files\ compared\ to\ master | ||
537 | \ :!git diff --name-status ..master | ||
538 | |||
539 | menu &Match.Clear\ All\ Matches | ||
540 | \<Tab><F6> | ||
541 | \ :call clearmatches()<CR> | ||
542 | |||
543 | menu &Match.-Sep- : | ||
544 | |||
545 | menu &Match.&dispensable\ white\ spaces | ||
546 | \ :call matchadd("Convention", '\s\+$', 0)<CR> | ||
547 | |||
548 | menu &Match.&long\ lines\ (exeeding\ textwidth) | ||
549 | \ :call matchadd("Convention", '\%>'.&textwidth.'v.', 0)<CR> | ||
550 | |||
551 | menu &Match.Highlight\ current\ file\ name | ||
552 | \ :call matchadd("Search", escape(expand('%:t'), '.'))<CR> | ||
553 | |||
554 | " :execute ':match SpellBad /'.escape(expand('%:t'), '.').'/'<CR> | ||
555 | |||
556 | menu &Window.-Sep- : | ||
557 | |||
558 | |||
559 | menu &Window.Scratch | ||
560 | \ :Scratch<CR> | ||
561 | |||
562 | |||
563 | menu &Find.file\ under\ the\ cursor | ||
564 | \<Tab>gf | ||
565 | \ gf | ||
566 | |||
567 | menu &Find.Open\ search\ results\ in\ location\ list | ||
568 | \<Tab>:gf | ||
569 | \ :execute ':vimgrep /'.escape(getreg('/'), '.').'/g %'<CR> | ||
570 | \ :copen<CR> | ||
571 | |||
572 | menu &Changes.list | ||
573 | \<Tab>:changes | ||
574 | \ :changes<CR> | ||
575 | menu &Changes.-Sep- : | ||
576 | menu &Changes.previous | ||
577 | \<Tab>g; | ||
578 | \ g; | ||
579 | menu &Changes.next | ||
580 | \<Tab>g, | ||
581 | \ g, | ||
582 | menu &List.location.signs\ to\ list | ||
583 | \<Tab>CMD | ||
584 | \ :execute ":call setloclist(0, map(get(getbufinfo('%')[0], 'signs'), {_, p->extend(p, {'bufnr':buffer_number('.'), 'text':get(p, 'name')})}))"<CR> | ||
585 | menu &List.location.list\ to\ signs | ||
586 | \<Tab>CMD | ||
587 | \ :call execute(extend(['sign define LocationListEntry text=L', 'sign unplace *'], map(getloclist('%'), {key, val->'sign place '.(key+100).' name=LocationListEntry line='.val['lnum'].' buffer='.buffer_number('%')})))<CR> | ||
588 | menu &Jump.list | ||
589 | \<Tab>:jumps | ||
590 | \ :jumps<CR> | ||
591 | menu &Jump.-Sep1- : | ||
592 | menu &Jump.previous\ position | ||
593 | \<Tab>CTRL-O | ||
594 | \ <C-O> | ||
595 | menu &Jump.next\ position | ||
596 | \<Tab>CTRL-I | ||
597 | \ <C-I> | ||
598 | menu &Jump.-Sep2- : | ||
599 | menu &Jump.clear\ list | ||
600 | \<Tab>:clearjumps | ||
601 | \ :clearjumps | ||
602 | |||
603 | 1000menu &Tag.list | ||
604 | \<Tab>:tags | ||
605 | \ :tags<CR> | ||
606 | 1000menu &Tag.selection\ list | ||
607 | \<Tab>:ts | ||
608 | \ :ts<CR> | ||
609 | |||
610 | 1000menu &Tag.-Sep1- : | ||
611 | |||
612 | 1000menu &Tag.stack.jump\ older | ||
613 | \<Tab><C-T> | ||
614 | \ :po | ||
615 | 1000menu &Tag.stack.jump\ | ||
616 | \<Tab>:ta | ||
617 | \ :ta | ||
618 | endif | ||
619 | |||
620 | " autocmd BufEnter * @f | ||
621 | augroup END | ||
622 | |||
623 | " autocmd VimEnter * set nobuflisted | ||
624 | endif | ||
625 | |||
626 | |||
627 | " ====================================================================================================================== | ||
628 | " SHORTCUTS: custom shortcuts | ||
629 | " inoremap <C-Space> <C-x><C-o> | ||
630 | " inoremap <C-@> <C-Space> | ||
631 | |||
632 | " Bind CTRL+Backspace to vim's version (CTRL+W) in " <CR> insert mode (only works with gvim) | ||
633 | inoremap | ||
634 | \ <C-Backspace> | ||
635 | \ <C-W> | ||
636 | |||
637 | " INDENTATION: allows un-indenting a selected block and keeps selection | ||
638 | vnoremap < <gv | ||
639 | vnoremap > >gv | ||
640 | |||
641 | " make shift-home select to the beginning of the line | ||
642 | nnoremap <s-home> v^ | ||
643 | nnoremap <s-end> v$ | ||
644 | |||
645 | nnoremap <s-down> vj | ||
646 | vnoremap <s-down> j | ||
647 | nnoremap <s-up> vk | ||
648 | vnoremap <s-up> k | ||
649 | |||
650 | |||
651 | " close current buffer with <leader>q... | ||
652 | nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>. | ||
653 | " google the word under the cursor | ||
654 | nnoremap <leader>G :execute ":!xdg-open https://google.de/search?q=".expand("<cword>") | ||
655 | |||
656 | nnoremap <silent> <F5> :make!<CR> | ||
657 | nnoremap <silent> <F6> :silent syntax sync fromstart<CR>:nohlsearch<CR>:silent match<CR>:silent 2match<CR>:silent 3match<CR> | ||
658 | nnoremap <leader>r :syntax sync fromstart | ||
659 | |||
660 | nnoremap <silent> <A-Up> :wincmd k<CR> | ||
661 | nnoremap <silent> <A-Down> :wincmd j<CR> | ||
662 | nnoremap <silent> <A-Left> :wincmd h<CR> | ||
663 | nnoremap <silent> <A-Right> :wincmd l<CR> | ||
664 | |||
665 | " INSERT_MODE_MAPPINGS: | ||
666 | " default copy&paste insert key binding (just in insert mode, so it doesn't conflict | ||
667 | " with visual block mode)- would have been nice, but collides with c-w for digraphs | ||
668 | " inoremap <C-V> <C-R>+ | ||
669 | " | ||
670 | inoremap <C-S> <C-O>:w<CR> | ||
671 | |||
672 | " NEOVIM_SPECIFIC: | ||
673 | if has('nvim') " only neovim... | ||
674 | " shortcut \t opens a terminal in a horizontal split | ||
675 | nnoremap <leader>t :new +terminal<CR> | ||
676 | endif | ||
677 | |||
678 | |||
679 | |||
680 | " ====================================================================================================================== | ||
681 | " START: LOADING PLUGINS | ||
682 | " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ | ||
683 | call plug#begin() | ||
684 | " Colorschemes: | ||
685 | Plug 'coderonline/vim-remote-menu' | ||
686 | " Plug 'bbchung/clighter8' | ||
687 | " Plug 'octol/vim-cpp-enhanced-highlight' | ||
688 | " Plug 'vim-scripts/TagHighlight' | ||
689 | " if ! exists('g:TagHighlightSettings') | ||
690 | " let g:TagHighlightSettings = {} | ||
691 | " endif | ||
692 | " let g:TagHighlightSettings['TagFileName'] = 'tags' | ||
693 | " let g:TagHighlightSettings['CtagsExecutable'] = 'ctags' | ||
694 | |||
695 | Plug 'chriskempson/base16-vim' | " not just one high quality color scheme (all named base16-*) | ||
696 | Plug 'NLKNguyen/papercolor-theme' | " the one I like the most | ||
697 | |||
698 | Plug 'mhinz/vim-signify' | " uses the sign column to indicate added, modified and removed lines | ||
699 | Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin | ||
700 | Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= | ||
701 | Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' | ||
702 | let g:signify_vcs_list = [ 'git' ] | " use signify only with git (improves speed when loading buffers, see :h signify) | ||
703 | let g:signify_cursorhold_insert = 0 | ||
704 | let g:signify_cursorhold_normal = 0 | ||
705 | let g:signify_update_on_bufenter = 0 | ||
706 | let g:signify_update_on_focusgained = 0 | ||
707 | let g:signify_sign_show_count = 1 | ||
708 | |||
709 | let g:signify_sign_add = '≫' | ||
710 | let g:signify_sign_delete = '≪' | ||
711 | let g:signify_sign_delete_first_line = '≪' | ||
712 | let g:signify_sign_change = '≶' | ||
713 | let g:signify_sign_changedelete = g:signify_sign_change | ||
714 | |||
715 | |||
716 | " NERDTree: replaces NetRW, as long as it has so many bugs | ||
717 | Plug 'scrooloose/nerdtree' | " | ||
718 | let NERDTreeIgnore = ['\.aux$', '\.o$'] | ||
719 | let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory | ||
720 | let NERDTreeChDirMode = 0 | ||
721 | let NERDTreeHiddenFirst = 1 | ||
722 | let NERDTreeMinimalUI = 1 | ||
723 | let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) | ||
724 | let NERDTreeWinSize = 40 | ||
725 | let NERDTreeQuitOnOpen = 1 | ||
726 | |||
727 | " depending on if NERDTree has the focus: | ||
728 | nnoremap <expr> | ||
729 | \ <leader><leader> | ||
730 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose<CR>' : ':NERDTreeFind<CR>' | ||
731 | nnoremap <expr> | ||
732 | \ <F2> | ||
733 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':N<CR>' | ||
734 | |||
735 | nnoremap <expr> | ||
736 | \ <F3> | ||
737 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':n<CR>' | ||
738 | |||
739 | nnoremap <F4> | ||
740 | \ :wincmd c<CR> | ||
741 | " close NERDTree if it is the last remaining window (taken from the official documentation) | ||
742 | " autocmd bufenter * | ||
743 | " \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | ||
744 | " | ||
745 | |||
746 | |||
747 | " map CTRL-PageUp/Down to next/previous buffer | ||
748 | " and Shift-PageUp/Down to next/previous arglist file | ||
749 | nnoremap <C-PageUp> :bn<CR> | ||
750 | nnoremap <C-PageDown> :bp<CR> | ||
751 | nnoremap <S-PageUp> :N<CR> | ||
752 | nnoremap <S-PageDown> :n<CR> | ||
753 | |||
754 | |||
755 | " Additional: ========================================. | ||
756 | " Plug 'sheerun/vim-polyglot' " better syntax highlighting/indentation for multiple languages | ||
757 | " let g:javascript_conceal_function = "ƒ" | ||
758 | " let g:javascript_conceal_null = "ø" | ||
759 | " let g:javascript_conceal_this = "@" | ||
760 | " let g:javascript_conceal_return = "⇚" | ||
761 | " let g:javascript_conceal_undefined = "¿" | ||
762 | " let g:javascript_conceal_NaN = "ℕ" | ||
763 | " let g:javascript_conceal_prototype = "¶" | ||
764 | " let g:javascript_conceal_static = "•" | ||
765 | " let g:javascript_conceal_super = "Ω" | ||
766 | " let g:javascript_conceal_arrow_function = "⇒" | ||
767 | |||
768 | |||
769 | " indent within <script> and <style> (default is a zero indent) | ||
770 | let g:html_indent_script1 = "inc" | ||
771 | let g:html_indent_style1 = "inc" | ||
772 | |||
773 | Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more | ||
774 | let g:tagbar_autoclose = 0 | ||
775 | let g:tagbar_autofocus = 1 | ||
776 | let g:tagbar_autoshowtag = 0 | ||
777 | let g:tagbar_compact = 1 | ||
778 | let g:tagbar_indent = 0 | ||
779 | let g:tagbar_foldlevel = 99 | ||
780 | |||
781 | nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to hotkey F9 | ||
782 | |||
783 | " Autocompleter: ===================================== | ||
784 | if has("python") || has('python3') | ||
785 | |||
786 | " ULTISNIPS: code snippet ============================================================================================ | ||
787 | Plug 'honza/vim-snippets' " dependency of ultisnips (see below) | ||
788 | Plug 'SirVer/ultisnips' " replaces loremipsum (and many more) | ||
789 | " let g:UltiSnipsExpandTrigger = '<Tab>'| " expands the snippet, be careful not to use <tab> elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion) | ||
790 | let g:UltiSnipsExpandTrigger = '<Tab>'| " expands the snippet, be careful not to use <tab> elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion) | ||
791 | |||
792 | let g:UltiSnipsJumpForwardTrigger = '<Tab>'| | ||
793 | let g:UltiSnipsJumpBackwardTrigger = '<S-Tab>'| | ||
794 | "d let g:UltiSnipsJumpForwardTrigger = '<PageDown>' | ||
795 | " let g:UltiSnipsJumpBackwardTrigger = '<PageUp>' | ||
796 | "let g:UltiSnipsExpandTrigger = '<C-j>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
797 | "let g:UltiSnipsJumpForwardTrigger = '<C-j>'| " \ | ||
798 | "let g:UltiSnipsJumpBackwardTrigger = '<C-k>'| " \ | ||
799 | "let g:UltiSnipsListSnippets = '<C-`>'| " YouCompleteMe includes those, so this isn't necessary | ||
800 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary | ||
801 | """ Ultisnips | ||
802 | " let g:UltiSnipsExpandTrigger="<c-tab>" | ||
803 | " let g:UltiSnipsListSnippets="<c-s-tab>" | ||
804 | |||
805 | if has('nvim') | ||
806 | Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | ||
807 | " Use deoplete. | ||
808 | let g:deoplete#enable_at_startup = 1 | ||
809 | inoremap <silent><expr> <C-Space> deoplete#mappings#manual_complete() | ||
810 | |||
811 | Plug 'Shougo/echodoc.vim' | ||
812 | let g:echodoc#enable_at_startup = 1 | ||
813 | |||
814 | " Plug 'Rip-Rip/clang_complete' | ||
815 | " Plug 'tweekmonster/deoplete-clang2' | ||
816 | " Plug 'zchee/deoplete-clang' | ||
817 | " let g:deoplete#sources#clang#libclang_path = "/usr/lib/libclang.so" | ||
818 | " let g:deoplete#sources#clang#clang_header = "/usr/lib/clang/6.0.0" | ||
819 | " let g:deoplete#sources#clang#std#cpp = 'c++1z' | ||
820 | " let g:deoplete#sources#clang#clang_complete_database = "/home/max/src" | ||
821 | " Plug 'Shougo/neoinclude.vim' " makes vim slow - unfortunatelly | ||
822 | |||
823 | " Plug 'Shougo/deoplete-clangx' " mentioned in Q&A of deoplete | ||
824 | Plug 'autozimu/LanguageClient-neovim', { | ||
825 | \ 'branch': 'next', | ||
826 | \ 'do': 'bash install.sh', | ||
827 | \ } | ||
828 | |||
829 | let g:LanguageClient_serverCommands = { | ||
830 | \ 'cpp': ['clangd'] | ||
831 | \ } | ||
832 | " Plug 'roxma/nvim-completion-manager' unmaintained python version | ||
833 | else | ||
834 | " YouCompleteMe: ===================================================================================================== | ||
835 | " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | ||
836 | Plug 'Valloric/YouCompleteMe', { | ||
837 | \ 'do' : 'python install.py --clang-completer --system-libclang --quiet', | ||
838 | \ } | ||
839 | let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar/sign column | ||
840 | let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar/sign coloumn | ||
841 | |||
842 | let g:ycm_autoclose_preview_window_after_insertion = 0 | ||
843 | let g:ycm_auto_trigger = 1 | ||
844 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file | ||
845 | let g:ycm_confirm_extra_conf = 0 " security is overrated ;) | ||
846 | let g:ycm_always_populate_location_list = 0 " we can manually run :YcmDiags to do that | ||
847 | |||
848 | let g:ycm_key_list_previous_completion = ['Up'] | ||
849 | let g:ycm_key_list_select_completion = ['Down'] | ||
850 | |||
851 | " Plug 'vim-scripts/dbext.vim' " dependency to allow db related completions | ||
852 | " let g:ycm_server_python_interpreter = 'python3' | ||
853 | " let g:ycm_python_binary_path = '/usr/bin/python3' " the python interpreter of choice (for code checking) | ||
854 | " let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window | ||
855 | " let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword | ||
856 | " let g:ycm_complete_in_comments = 1 " Completion in comments | ||
857 | " let g:ycm_complete_in_strings = 1 " Completion in string | ||
858 | " let g:ycm_min_num_of_chars_for_completion = 6 " we normally avoid identifier based completion, it just helps with long words. Use semantic completions with <C-Space> instead (terrible idea, html snippets not working!) | ||
859 | " let g:ycm_min_num_identifier_candidate_chars = 4 | ||
860 | " let g:ycm_max_num_identifier_candidates = 10 | ||
861 | " let g:ycm_max_num_candidates = 50 | ||
862 | " let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure | ||
863 | " let g:ycm_key_list_select_completion = ['<Down>'] | ||
864 | " let g:ycm_key_list_previous_completion = ['<Up>'] | ||
865 | " let g:ycm_global_ycm_extra_conf = '.ycm_extra_conf.py' | ||
866 | " let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } | ||
867 | " " let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? | ||
868 | " let g:ycm_show_diagnostics_ui = 0 | ||
869 | " " disable <tab>-key for YCM so that it can be used with ultisnips | ||
870 | " let g:ycm_key_list_select_completion=[] | ||
871 | " let g:ycm_key_list_previous_completion=[] | ||
872 | endif | ||
873 | |||
874 | |||
875 | " SYNTASTIC: ========================================================================================================= | ||
876 | if has('nvim') | ||
877 | Plug 'w0rp/ale' | ||
878 | let g:ale_set_highlights = 0 | ||
879 | highlight! link ALEWarningSign FoldColumn | ||
880 | let g:ale_sign_error = '' | ||
881 | let g:ale_sign_style_error = '' | ||
882 | let g:ale_sign_info = '' | ||
883 | let g:ale_sign_warning = '' | ||
884 | else | ||
885 | Plug 'scrooloose/syntastic' | ||
886 | " set statusline+=%#warningmsg# | ||
887 | " set statusline+=%{SyntasticStatuslineFlag()} | ||
888 | let g:LatexBox_latexmk_preview_continuously = 1 | ||
889 | let g:LatexBox_viewer = "evince" | ||
890 | let g:syntastic_always_populate_loc_list = 1 | ||
891 | let g:syntastic_auto_loc_list = 0 | ||
892 | let g:syntastic_check_on_open = 1 | ||
893 | let g:syntastic_check_on_wq = 0 | ||
894 | " let g:syntastic_quiet_messages = {"type":"style"} | ||
895 | " | ||
896 | " E221: multiple spaces before Operator | ||
897 | let g:syntastic_python_flake8_args = '--max-complexity=10 --max-line-length=120 --exclude venv --doctests --exit-zero --ignore=E221' | ||
898 | " filter ( = do not display) style/formatting errors and warnings | ||
899 | let g:syntastic_error_symbol = '✖' | ||
900 | let g:syntastic_style_error_symbol = '✗' | ||
901 | let g:syntastic_warning_symbol = '➔' | ||
902 | let g:syntastic_style_warning_symbol = '≈' | ||
903 | endif | ||
904 | |||
905 | " JEDI: ============================================================================================================== | ||
906 | Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures | ||
907 | let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe | ||
908 | let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi | ||
909 | let g:jedi#show_call_signatures_delay = 0 | ||
910 | let g:jedi#auto_vim_configure = 0 | ||
911 | let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 | ||
912 | " autocmd FileType python jedi.preload_module('os', 'sys', 'math') | ||
913 | " let g:pymode_options_max_line_length = 120 | ||
914 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' | ||
915 | |||
916 | endif " has("python") | ||
917 | |||
918 | "======================================================================================================================= | ||
919 | " TESTING: | " plugins which I am currently trying... | ||
920 | "======================================================================================================================= | ||
921 | " Plug 'rhysd/vim-clang-format' | unnecessary, because we can just :pyf /usr/share/clang/clang-format.py | ||
922 | Plug 'kana/vim-operator-user' " dependency, which allows overriding the = operator for indentation | ||
923 | |||
924 | " TODO: check if this is unrequired, when set equalprog is set to that py file | ||
925 | autocmd FileType c,cpp,objc map <buffer> = :pyf /usr/share/clang/clang-format.py<CR> | ||
926 | |||
927 | " let g:clang_format#detect_style_file = 1 | ||
928 | " autocmd FileType c,cpp,objc map <buffer> = <Plug>(operator-clang-format) | ||
929 | |||
930 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | ||
931 | " Plug 'rkitover/vimpager' | ||
932 | " found this command instead (use as PAGER): | ||
933 | " man -P 'nvim -R -u NORC -c":%!col -b" -c":set buftype=nowrite filetype=man" -' ls | ||
934 | |||
935 | command BuffersToArg :exec ':args '.join(map(range(0, bufnr('$')), 'fnameescape(fnamemodify(bufname(v:val), ":."))')) | ||
936 | command BufToArg :argadd %:. | ||
937 | command Gbranch call setqflist([], 'r', {'title':'Git branch selector','items':map(systemlist("git branch"), {_, p->{'filename':'branch','module': fnamemodify(p, ':.')}})}) | ||
938 | |||
939 | " the following command opens a preview-window and shows the declaration of | ||
940 | " the function under the cursor. It also highlights the word to make it easier | ||
941 | " to spot within a great file | ||
942 | command Helpme au! CursorHold * nested let @/=expand('<cword>')|exe "silent! psearch ".expand("<cword>") | ||
943 | |||
944 | "======================================================================================================================= | ||
945 | call plug#end() | " all plugins are getting loaded on this line, don't remove! | ||
946 | |||
947 | " ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ | ||
948 | " END: LOADING PLUGINS | ||
949 | " ====================================================================================================================== | ||
950 | |||
951 | " Deprecated with this configuration, but still useful when deactivating some Plugins | ||
952 | " NETRW: obsolete with NERDTree | ||
953 | let g:netrw_alto = 0 | " open files on the right | ||
954 | let g:netrw_altv = 1 | " open files on the right | ||
955 | let g:netrw_banner = 0 | " display help messages? | ||
956 | let g:netrw_browse_split = 4 | " 4=open in previous window | ||
957 | let g:netrw_fastbrowse = 2 | " manually refresh direcory list (avoids display errors) | ||
958 | let g:netrw_hide = 1 | " show not-hidden files only | ||
959 | let g:netrw_keepdir = 0 | ||
960 | let g:netrw_list_hide = '^\..*' | " Explore mode: hide files starting with dot | ||
961 | let g:netrw_liststyle = 3 | " 3=tree | ||
962 | let g:netrw_preview = 0 | " | ||
963 | let g:netrw_winsize = 20 | " window size in percent | ||
964 | |||
965 | " ====================================================================================================================== | ||
966 | " COLORSCHEME: | ||
967 | " ====================================================================================================================== | ||
968 | |||
969 | function! ExtendColorTheme() | ||
970 | " let g:status_fg=synIDattr(hlID('Cursor'), 'fg#') | ||
971 | " let g:status_bg=synIDattr(hlID('Cursor'), 'bg#') | ||
972 | " let g:status_sel=synIDattr(hlID('Text'), 'fg#') | ||
973 | " let g:status_sel='#ffffff' | ||
974 | let g:status_fg='#00aa00' | ||
975 | let g:status_bg='#000000' | ||
976 | let g:status_sel='#ffff00' | ||
977 | |||
978 | " execute 'highlight! StatusLine' | ||
979 | " \ .' guibg=NONE' | ||
980 | " \ .' guifg='.g:status_bg | ||
981 | " \ .' gui=inverse' | ||
982 | |||
983 | " " execute 'highlight! User1 gui=NONE' | ||
984 | " execute 'highlight! User1 guibg='.g:status_sel | ||
985 | " execute 'highlight! User1 guifg='.g:status_fg | ||
986 | |||
987 | " execute 'highlight! User2 gui=NONE' | ||
988 | " execute 'highlight! User2 guibg='.g:status_sel | ||
989 | " execute 'highlight! User2 guifg=NONE' | ||
990 | |||
991 | |||
992 | filetype on | ||
993 | filetype plugin on | ||
994 | filetype indent on | ||
995 | |||
996 | syntax on | " enable syntax highlighting | ||
997 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) | ||
998 | |||
999 | " use the default terminal background color as background (allows transparency) | ||
1000 | " highlight! Normal guibg=NONE ctermbg=NONE | ||
1001 | " highlight! NonText guibg=NONE guifg=black ctermbg=NONE ctermfg=black | ||
1002 | |||
1003 | " make the ~ (tilde) indicator invisible, which usually marks the EOF | ||
1004 | highlight! link EndOfBuffer Ignore | ||
1005 | |||
1006 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE | ||
1007 | highlight! Pmenu ctermbg=LightYellow ctermfg=DarkGrey | ||
1008 | highlight! PmenuSel ctermbg=blue ctermfg=LightYellow cterm=bold | ||
1009 | |||
1010 | highlight! link PmenuSbar Pmenu | ||
1011 | highlight! PmenuThumb cterm=inverse | ||
1012 | highlight! MoreMsg cterm=inverse | ||
1013 | |||
1014 | highlight! link LineNr Comment | ||
1015 | highlight! link Folded Comment | ||
1016 | highlight! link SignColumn Comment | ||
1017 | highlight! link FoldColumn Comment | ||
1018 | " highlight! Folded ctermbg=NONE | ||
1019 | " highlight! Cursor guibg=#729fcf ctermbg=yellow | ||
1020 | highlight! link VertSplit NonText | ||
1021 | " highlight! SpellBad ctermbg=none | ||
1022 | highlight! SpecialKey ctermfg=19 | ||
1023 | highlight! WhiteSpace ctermfg=19 | ||
1024 | |||
1025 | " highlight! link TabLine LineNr | ||
1026 | " highlight! TabLineSel ctermbg=blue ctermfg=black | ||
1027 | " highlight! link TabLineFill LineNr | ||
1028 | highlight! Search ctermbg=LightYellow ctermfg=12 guibg=#fefd86 guifg=#222222 | ||
1029 | highlight! link WildMenu Search | ||
1030 | |||
1031 | " generic, which should exist but don't | ||
1032 | highlight! SignifySignAdd ctermbg=NONE | ||
1033 | highlight! Bold cterm=bold gui=bold | ||
1034 | highlight! Italic cterm=italic gui=italic | ||
1035 | highlight! Underline cterm=underline gui=underline | ||
1036 | highlight! BoldUnderline cterm=bold,underline gui=bold,underline | ||
1037 | highlight! BoldItalic cterm=Bold,Italic gui=Bold,Italic | ||
1038 | |||
1039 | " make tab stop (see listchars) less disturbing... | ||
1040 | highlight! link SpecialKey NonText | ||
1041 | |||
1042 | " highlight! link LightlineMiddle_tabline ColorColumn | ||
1043 | " highlight! link LightlineLeft_tabline_1 ColorColumn | ||
1044 | " highlight! link LightlineLeft_tabline_0_1 ColorColumn | ||
1045 | |||
1046 | highlight! Todo guibg=#ffffaa guifg=#000000 gui=bold term=bold | ||
1047 | highlight! cStatement guifg=red gui=bold term=bold | ||
1048 | |||
1049 | highlight! link Convention Error | ||
1050 | |||
1051 | |||
1052 | highlight! link SignifySignAdd LineNr | ||
1053 | highlight! link SignifySignChange LineNr | ||
1054 | highlight! link SignifySignDelete LineNr | ||
1055 | highlight! link SignifySignChangeDelete LineNr | ||
1056 | highlight! link SignifySignDeleteFirstLine LineNr | ||
1057 | |||
1058 | highlight! SpellBad ctermbg=NONE ctermfg=red cterm=NONE | ||
1059 | highlight! link YcmErrorSign SpellBad | ||
1060 | highlight! link YcmWarningSign Spellbad | ||
1061 | |||
1062 | " autocmd InsertLeave * call matchadd('Conceal', ' \+$', -1, 101, { 'conceal': '⟶' }) | ||
1063 | autocmd InsertEnter * silent! call matchdelete(101) | ||
1064 | autocmd InsertLeave * silent! call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' }) | ||
1065 | |||
1066 | " Show trailing whitepace and spaces before a tab as part of the syntax highlighting | ||
1067 | " autocmd BufEnter,InsertLeave * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL | ||
1068 | " autocmd Syntax * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL | ||
1069 | " autocmd BufEnter,BufWritePost * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL | ||
1070 | " autocmd InsertEnter * syntax clear Convention | ||
1071 | " autocmd BufEnter,InsertLeave * execute ':syntax match Convention /\%>'.&textwidth.'v./ containedin=ALL' | ||
1072 | |||
1073 | autocmd InsertEnter * set colorcolumn=80,120 | ||
1074 | autocmd InsertLeave * set colorcolumn& | ||
1075 | " set colorcolumn= | " not used, because we have a :match directive for textwidth | ||
1076 | " | ||
1077 | " if argc() == 0 | ||
1078 | " rv | ||
1079 | " autocmd VimEnter * split +bro\ ol | ||
1080 | " endif | ||
1081 | endfunction | ||
1082 | autocmd! ColorScheme * call ExtendColorTheme() | ||
1083 | |||
1084 | |||
1085 | |||
1086 | " ====================================================================================================================== | ||
1087 | " CONVENIENCE: | ||
1088 | " ====================================================================================================================== | ||
1089 | command Vimls | ||
1090 | \ call setloclist(0, map(getbufinfo({'buflisted':1}), | ||
1091 | \ "{'bufnr': v:val.bufnr, | ||
1092 | \ 'lnum': v:val.lnum, | ||
1093 | \ 'text': '='.printf('%*s, % 3d: %s [%s]', winwidth(0) / 2, '', v:val.bufnr, v:val.name, getbufvar(v:val.bufnr, '&buftype')), | ||
1094 | \ 'pattern': 'not loaded'} | ||
1095 | \ ")) | ||
1096 | |||
1097 | command Ctoggle | ||
1098 | \ if(get(getqflist({'winid':1}), 'winid') == win_getid())|cclose|else|botright copen|endif | ||
1099 | command Ltoggle | ||
1100 | \ if(get(getloclist(0, {'winid':1}), 'winid') == win_getid())|lclose|else|lopen|endif | ||
1101 | |||
1102 | |||
1103 | |||
1104 | " nnoremap <silent> <ESC> :lclose<CR> " brings vim into REPLACE mode (R) | ||
1105 | nnoremap <silent> <F7> :Ltoggle<CR> | ||
1106 | nnoremap <silent> <F8> :Ctoggle<CR> | ||
1107 | nnoremap <silent> <F12> :Vimls<CR>:Ltoggle<CR> | ||
1108 | |||
1109 | " exec current line as a command, insert output of command (from: https://youtu.be/MquaityA1SM?t=35m45s) | ||
1110 | nnoremap Q !!$SHELL<CR> | ||
1111 | |||
1112 | |||
1113 | " ====================================================================================================================== | ||
1114 | " TESTING: | ||
1115 | " ====================================================================================================================== | ||
1116 | " avoids openin an empty buffer when restoring bufferlist from viminfo... | ||
1117 | " if argc() == 0 | ||
1118 | " silent autocmd VimEnter * nested :silent bun | ||
1119 | " endif | ||
1120 | |||
1121 | autocmd TextYankPost * echo '> text yanked to '.( | ||
1122 | \ get(v:event,'regname') == '' | ||
1123 | \ ? 'default register' | ||
1124 | \ : 'register '.get(v:event,'regname')) | ||
1125 | |||
1126 | autocmd VimEnter,WinEnter * exec ':set scrolljump='.winheight(0)/2 | ||
1127 | |||
1128 | " display highlight group under the cursor | ||
1129 | map <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR> | ||
1130 | |||
1131 | if filereadable(expand("~/.vimrc_background")) && filereadable(expand("~/.config/base16-shell/colortest")) | ||
1132 | let g:base16_shell_path="~/.config/base16-shell/scripts" | ||
1133 | let base16colorspace=256 | ||
1134 | " let syntax_cmd="skip" " vim internal, use base16 and no default colors | ||
1135 | set background=dark | ||
1136 | source ~/.vimrc_background | ||
1137 | else | ||
1138 | let g:PaperColor_Theme_Options = { | ||
1139 | \ 'theme': { | ||
1140 | \ 'default': { | ||
1141 | \ 'transparent_background': 0 | ||
1142 | \ } | ||
1143 | \ } | ||
1144 | \ } | ||
1145 | set background=light | ||
1146 | colorscheme PaperColor | ||
1147 | endif | ||
1148 | |||
1149 | |||
1150 | augroup status | ||
1151 | set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one | ||
1152 | set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split | ||
1153 | |||
1154 | let g:status_sym_start = '' | ||
1155 | let g:status_sym_end = '' | ||
1156 | let g:status_sym_sep_start = '' | ||
1157 | let g:status_sym_sep_end = '' | ||
1158 | let g:symbol_branch = '' | ||
1159 | |||
1160 | if &term == "linux" | ||
1161 | let g:symbol_branch = '' | ||
1162 | |||
1163 | let g:group_active = "StatusLineTerm" | ||
1164 | let g:group_inactive = "StatusLineTermNC" | ||
1165 | let g:group_tabline = "StatusLineTerm" | ||
1166 | else | ||
1167 | let g:group_active = "StatusLine" | ||
1168 | let g:group_inactive = "StatusLineNC" | ||
1169 | let g:group_tabline = "TabLine" | ||
1170 | endif | ||
1171 | |||
1172 | " this function reverts foreground color and background color of a given | ||
1173 | " highlight group and returns the name of a newly created _invert group | ||
1174 | function! CreateInvertGroup(highlight_group) | ||
1175 | if(synIDattr(hlID(a:highlight_group), "reverse")==1) | ||
1176 | let w:color=synIDattr(hlID(a:highlight_group), "fg#") | ||
1177 | else | ||
1178 | let w:color=synIDattr(hlID(a:highlight_group), "bg#") | ||
1179 | endif | ||
1180 | |||
1181 | let l:retval=a:highlight_group.'_invert' | ||
1182 | if(exists('w:color') && w:color == '') | ||
1183 | let w:color = 'NONE' | ||
1184 | endif | ||
1185 | silent! exec 'highlight '.retval.' gui=NONE guifg='.w:color.' cterm=NONE ctermfg='.w:color | ||
1186 | return l:retval | ||
1187 | endfunction | ||
1188 | |||
1189 | function! UpdateStatus(highlight_group) | ||
1190 | let l:invert_group = CreateInvertGroup(a:highlight_group) | ||
1191 | let l:mode = get({ | ||
1192 | \ 'n' : 'normal', | ||
1193 | \ 'i' : 'insert', | ||
1194 | \ 'R' : 'replace', | ||
1195 | \ 'v' : 'visual', | ||
1196 | \ "V" : 'visual line', | ||
1197 | \ "\<C-V>" : 'visual block', | ||
1198 | \ 'c' : 'command', | ||
1199 | \ 's' : 'select', | ||
1200 | \ 'S' : 'select line', | ||
1201 | \ "\<C-s>" : 'select block', | ||
1202 | \ 't' : 'terminal' | ||
1203 | \ }, mode(), mode()) | ||
1204 | return '' | ||
1205 | \ ."%#StatusLineHighlight#" | ||
1206 | \ ."%#".a:highlight_group."#" | ||
1207 | \ ."%(%w%h%q%)".' '.l:mode.' ' | ||
1208 | \ .g:status_sym_sep_start.' ' | ||
1209 | \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}" | ||
1210 | \ ."%{winbufnr(0).' '.g:status_sym_sep_start}" | ||
1211 | \ ."%{(&readonly\ ?\ '\ \ \ '\ :\ '')}" | ||
1212 | \ ."%{(&modified\ ?\ '\ \ '.nr2char(0xF0C7).'\ '\ :\ '')\ }" | ||
1213 | \ ."%{(haslocaldir() ?\ ' '.fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ " | ||
1214 | \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ has('nvim')?b:term_title:expand(&titlestring)\ :\ substitute(expand('%:p'),\ '^'.getcwd(-1).'/*',\ '',\ ''))\ }" | ||
1215 | \ ."%1(%)" | ||
1216 | \ ."%#".l:invert_group."#" | ||
1217 | \ .g:status_sym_end | ||
1218 | \ .'' | ||
1219 | \ ."%=" | ||
1220 | \ .'' | ||
1221 | \ ."%#".l:invert_group."#" | ||
1222 | \ .g:status_sym_start | ||
1223 | \ ."%#".a:highlight_group."#" | ||
1224 | \ ."%1(%)" | ||
1225 | \ ."%{(&filetype\ !=\ ''\ ?\ &filetype\ :\ &buftype)}" | ||
1226 | \ ."%(\ %{g:status_sym_sep_end}\ %)" | ||
1227 | \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}" | ||
1228 | \ ."%{(&fileencoding\ !=\ ''\ ?\ &fileencoding.' '.g:status_sym_sep_end.' '\ :\ '')}" | ||
1229 | \ ."%{(&fileformat\ !=\ ''\ ?\ ' '.&fileformat.' '\ :\ '')}" | ||
1230 | \ .g:status_sym_sep_end.' ' | ||
1231 | \ ."%4l:%-3c" | ||
1232 | \ .g:status_sym_sep_end.' ' | ||
1233 | \ ."%-3p%%" | ||
1234 | endfunction | ||
1235 | |||
1236 | function! UpdateTabline(highlight_group) | ||
1237 | let l:invert_group = CreateInvertGroup(a:highlight_group) | ||
1238 | return '' | ||
1239 | \ ."%#".a:highlight_group."#" | ||
1240 | \ ."%3( \ %)" | ||
1241 | \ ."%{getcwd(-1)}" | ||
1242 | \ .g:status_sym_sep_start.' ' | ||
1243 | \ ."%(\ ".g:symbol_branch."\ %{fugitive#head()}\ %)" | ||
1244 | \ ."%#".l:invert_group."#" | ||
1245 | \ .g:status_sym_end | ||
1246 | \ .'' | ||
1247 | \ ."%=" | ||
1248 | \ .'' | ||
1249 | \ ."%#".l:invert_group."#" | ||
1250 | \ .g:status_sym_start | ||
1251 | \ ."%#".a:highlight_group."#" | ||
1252 | \ ."%3(\ %)" | ||
1253 | \ ."%(%{v:servername}\ %{v:this_session}%)" | ||
1254 | \ .g:status_sym_sep_end.' ' | ||
1255 | \ ."%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" | ||
1256 | \ ."%##" | ||
1257 | \ ."" " end | ||
1258 | endfunction | ||
1259 | |||
1260 | function! ApplyColorScheme() | ||
1261 | " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim | ||
1262 | " set t_ut= | ||
1263 | " set up statusline, global and current window individually | ||
1264 | set statusline=%!UpdateStatus(g:group_inactive) | ||
1265 | setlocal statusline=%!UpdateStatus(g:group_active) | ||
1266 | " set up the tabline (match colors) | ||
1267 | set tabline=%!UpdateTabline(g:group_tabline) | ||
1268 | endfunction | ||
1269 | " apply colors from the loaded colorscheme... | ||
1270 | " when changing the colorscheme also apply new colors to the statusbar... | ||
1271 | autocmd VimEnter,ColorScheme * call ApplyColorScheme() | ||
1272 | |||
1273 | autocmd WinEnter * setlocal statusline=%!UpdateStatus(g:group_active) | ||
1274 | autocmd WinLeave * setlocal statusline< | ||
1275 | augroup END " status | ||
1276 | |||
1277 | " moved after VimEnter of statusline, so that it does not get overwritten any | ||
1278 | " more | ||
1279 | if empty(argv()) | ||
1280 | |||
1281 | " autocmd VimEnter * call setloclist(0, filter(map(copy(v:oldfiles), {_, p->{'filename': expand(get(split(p, "'"), 0))}}), { val -> echo val})) | ||
1282 | |||
1283 | " from the list of recent files: make absolute paths, filter out files not | ||
1284 | " contained in cwd and finally filter out directories and non-files... | ||
1285 | autocmd StdinReadPre * let s:std_in=1 | ||
1286 | autocmd VimEnter * if !exists("s:std_in") | call setloclist(0, [], 'r', | ||
1287 | \ { | ||
1288 | \ 'title':'Recently used files in directory: '.getcwd(), | ||
1289 | \ 'items':map(filter(filter( | ||
1290 | \ map(copy(v:oldfiles), | ||
1291 | \ {_, p->expand(p)}), 'v:val =~ "'.getcwd().'/"'), 'filereadable(v:val)'), | ||
1292 | \ {_, p->{'filename': fnamemodify(p, ':.')}}) | ||
1293 | \ }) | lopen | only | setfiletype qf | ||
1294 | endif | ||
1295 | |||
diff --git a/vimrc-medium b/vimrc-medium deleted file mode 100644 index 8281ef1..0000000 --- a/vimrc-medium +++ /dev/null | |||
@@ -1,108 +0,0 @@ | |||
1 | set nocompatible " be iMproved, required | ||
2 | filetype off " required | ||
3 | |||
4 | |||
5 | |||
6 | call plug#begin() | ||
7 | |||
8 | " let Vundle manage Vundle, required | ||
9 | Plug 'VundleVim/Vundle.vim' | ||
10 | |||
11 | Plug 'tpope/vim-sensible' | " a sane and modern default configuration | ||
12 | Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin | ||
13 | Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' | ||
14 | Plug 'tpope/vim-repeat' | " lets . (dot) repeat plugin macros as well, specifically vim-surround | ||
15 | Plug 'tpope/vim-vinegar' | " Improves :Explore | ||
16 | Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | ||
17 | |||
18 | Plug 'gregsexton/matchtag' | " highlights closing ML tags like braces | ||
19 | Plug 'loremipsum' | " Sample text generator | ||
20 | Plug 'vim-airline/vim-airline' | " beautification of the mode line | ||
21 | Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme | ||
22 | Plug 'sheerun/vim-polyglot' | ||
23 | |||
24 | Plug 'f-breidenstein/icinga-vim' | ||
25 | Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= | ||
26 | |||
27 | "# Plugin 'indenthtml.vim' | " works better with mixed html/css/javascript | ||
28 | "# Plugin 'evanmiller/nginx-vim-syntax' | ||
29 | |||
30 | |||
31 | " Plugin 'tpope/vim-vividchalk' | " dark theme | ||
32 | " Plugin 'nelstrom/vim-mac-classic-theme' | " light theme | ||
33 | |||
34 | |||
35 | |||
36 | " All of your Plugins must be added before the following line | ||
37 | call plug#end() | " all plugins are getting loaded on this line, don't remove! | ||
38 | |||
39 | filetype plugin indent on | " required | ||
40 | |||
41 | " set term=xtermc | " required on solaris | ||
42 | set t_Co=256 | ||
43 | colorscheme industry | ||
44 | set background=light | ||
45 | |||
46 | let g:airline_theme='luna' | ||
47 | let g:airline_powerline_fonts = 1 | ||
48 | " enable airline's fancy headline with all buffers and tabs | ||
49 | let g:airline#extensions#tabline#enabled = 1 | ||
50 | let g:airline#extensions#tabline#show_buffers = 1 | ||
51 | let g:airline#extensions#tabline#show_tabs = 1 | ||
52 | |||
53 | |||
54 | syntax on | ||
55 | |||
56 | |||
57 | set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) | ||
58 | |||
59 | set encoding=utf-8 | " set up vim's cosole encoding (not file encoding, for which there is fileencoding=) | ||
60 | |||
61 | set ignorecase smartcase | " search with ignorecase by default, but use case sensitive search when one captical char is contained | ||
62 | |||
63 | set lazyredraw | ||
64 | set ttyscroll=3 | ||
65 | set ttyfast | ||
66 | set mouse=a | ||
67 | set hidden | ||
68 | set viminfo+=% | " restore buffer list | ||
69 | |||
70 | |||
71 | " set title | ||
72 | " set t_ts=^[k | ||
73 | " set t_fs=^[\ | ||
74 | " auto BufEnter * :set title | let &titlestring = 'v:' . expand('%') | ||
75 | " auto VimLeave * :set t_ts=^[k^[\ | ||
76 | " To ignore plugin indent changes, instead use: | ||
77 | "filetype plugin on | ||
78 | " | ||
79 | " Brief help | ||
80 | " :PluginList - lists configured plugins | ||
81 | " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate | ||
82 | " :PluginSearch foo - searches for foo; append `!` to refresh local cache | ||
83 | " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal | ||
84 | " | ||
85 | " see :h vundle for more details or wiki for FAQ | ||
86 | " Put your non-Plugin stuff after this line | ||
87 | " | ||
88 | if has("autocmd") | ||
89 | set modeline | " set variables specific to a file, like indentation by adding a comment | ||
90 | endif | ||
91 | |||
92 | " set window title for screen(3) | ||
93 | if &term == "screen" | ||
94 | set t_ts=k | ||
95 | set t_fs=\ | ||
96 | endif | ||
97 | if &term == "screen" || &term == "xterm" | ||
98 | let &titlestring = "%t|".$USER."@".hostname().":%{expand(\"%:~:.:h\")}%=%y" | ||
99 | set title | ||
100 | endif | ||
101 | |||
102 | " let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" | ||
103 | " automatically remove trailing white spaces on save.. | ||
104 | autocmd BufWritePre * %s/\s\+$//e | ||
105 | |||
106 | nnoremap <Tab> :bn<CR>| " lets one use CTRL+Tab to switch between tabs | ||
107 | nnoremap <S-Tab> :bp<CR>| " use CTRL+Shift+Tab to switch to preview tab | ||
108 | |||
diff --git a/vimrc-minimal b/vimrc-minimal deleted file mode 100644 index 96924f0..0000000 --- a/vimrc-minimal +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | set nocompatible | ||
2 | |||
3 | |||
4 | filetype plugin indent on | ||
5 | |||
6 | set omnifunc=syntaxcomplete#Complete | ||
7 | |||
8 | syntax on | ||
9 | |||
10 | |||
11 | set ts=2 sw=2 expandtab | ||
12 | |||
13 | set ignorecase smartcase | ||
14 | |||
15 | set hidden | ||
16 | |||
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... | ||
4 | set nocompatible | " do not try to be vi, be vim (required by Vundle) | ||
5 | filetype off | " Vundle needs this | ||
6 | set rtp+=~/.vim/bundle/Vundle.vim | " set runtimepath (required by Vundle) | ||
7 | call vundle#begin('~/.vim/bundle/') | " location where Vundle searches&installs plugins | ||
8 | |||
9 | " Plugin dependant configurations... | ||
10 | Plugin 'tpope/vim-sensible' | " a sane and modern default configuration | ||
11 | Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin | ||
12 | Plugin 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' | ||
13 | Plugin 'tpope/vim-repeat' | " lets . (dot) repeat plugin macros as well, specifically vim-surround | ||
14 | Plugin 'tpope/vim-vinegar' | " Improves :Explore | ||
15 | Plugin 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | ||
16 | |||
17 | Plugin 'tpope/vim-vividchalk' | " dark theme | ||
18 | Plugin 'nelstrom/vim-mac-classic-theme' | " light theme | ||
19 | |||
20 | Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion | ||
21 | Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use | ||
22 | Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back | ||
23 | Plugin 'jeaye/color_coded' | " semantic highlighting with vim | ||
24 | Plugin 'terryma/vim-multiple-cursors' | " displays visual block mode as cursors | ||
25 | Plugin 'taglist-plus' | " quick code navigator | ||
26 | Plugin 'jdonaldson/vaxe' | " code completion for haxe | ||
27 | Plugin 'sheerun/vim-polyglot' | " better syntax highlighting/indentation for multiple languages | ||
28 | Plugin 'loremipsum' | " Sample text generator | ||
29 | Plugin 'vim-airline/vim-airline' | " beautification of the mode line | ||
30 | Plugin 'nathanaelkane/vim-indent-guides' | " shows indentation guidelines by pressing <leader>ig | ||
31 | Plugin 'gregsexton/matchtag' | " highlights closing ML tags like braces | ||
32 | Plugin 'indenthtml.vim' | " works better with mixed html/css/javascript | ||
33 | Plugin 'easymotion/vim-easymotion' | " speed up navigation: try \\w or \\f, then one of the highlighted chars | ||
34 | Plugin 'Shougo/vimproc.vim' | ||
35 | Plugin 'Shougo/vimshell.vim' | ||
36 | Plugin 'jeetsukumaran/vim-buffergator' | " switch buffers with \b or <\-Left> <\-Right> | ||
37 | |||
38 | let g:airline_powerline_fonts = 1 | ||
39 | |||
40 | let Tlist_Compact_Format = 1 | " | ||
41 | let Tlist_GainFocus_On_ToggleOpen = 1 | " | ||
42 | let Tlist_Close_On_Select = 1 | " | ||
43 | |||
44 | Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required) | ||
45 | let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py' | " fallback, right one should be in the applications path | ||
46 | let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' | ||
47 | let g:ycm_key_select_completion = '<Tab>' | " key completion key | ||
48 | let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar | ||
49 | let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar | ||
50 | let g:ycm_collect_identifiers_from_tags_files = 1 | " | ||
51 | let 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 | |||
54 | let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle | ||
55 | let html_use_css = 1 | " when using :TOhtml no font-tags will be used, but proper css | ||
56 | let g:vim_markdown_folding_disabled=1 | " disable code folding with vimdiff (also see set nofoldenable) | ||
57 | |||
58 | let g:netrw_liststyle=3 | " Explore mode: 3 shows a complete tree instead of the current directory | ||
59 | let g:netrw_list_hide='^\..*' | " Explore mode: hide files starting with dot | ||
60 | |||
61 | |||
62 | " speed up CTRL-P Menu... | ||
63 | let 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 | |||
71 | call vundle#end() | " required by Vundle | ||
72 | filetype plugin indent on | " required by Vundle | ||
73 | "================================================================================ | ||
74 | " custom config | ||
75 | colorscheme mac_classic | ||
76 | " colorscheme coderonline | ||
77 | syntax enable | ||
78 | |||
79 | set noswapfile | " noundofile, nobackup, nowritebackup | ||
80 | set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory | ||
81 | set directory=~/.vim/temp | " | ||
82 | set undodir=~/.vim/temp | " | ||
83 | |||
84 | set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) | ||
85 | set autoindent | " always set autoindenting on | ||
86 | set autochdir | " change to the current files working dir (might break some plugins!) | ||
87 | set copyindent | " copy the previous indentation on autoindenting | ||
88 | set scrolloff=2 | " always keeps at least two lines visible (when seeking) | ||
89 | " set selectmode=mouse | " avoid using select mode (only with mouse) | ||
90 | set mousemodel=popup_setpos | " display a default right click menu for the selection (that is c&p is possible) | ||
91 | set selection=exclusive | " includes last character of the selection into following command (like x or d) | ||
92 | |||
93 | set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap | ||
94 | set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap | ||
95 | set diffopt+=vertical,iwhite,filler | " lets diff ignore white spaces | ||
96 | set spell spelllang=en,de | " enable spell checker | ||
97 | set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore) | ||
98 | set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews | ||
99 | set linebreak | " do not wrap in the middle of words | ||
100 | set display+=lastline | " do not show the @ symbol in the end of a long line | ||
101 | set showcmd | " displays status line messages while selecting (matrix size) | ||
102 | set nofoldenable | " do not fold code automatically | ||
103 | set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include | ||
104 | set wildmenu wildmode=full | " wildmenu code completion | ||
105 | set guifont="Droid Sans Mono for Powerline 10" | ||
106 | |||
107 | " search... | ||
108 | set ignorecase smartcase | " if search pattern contains uppercase then search is case sensitive | ||
109 | set incsearch | " do incremental searching | ||
110 | set showmatch matchtime=4 | " blinks matching braces | ||
111 | |||
112 | set novisualbell | " don't beep | ||
113 | set noerrorbells | " don't beep | ||
114 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | ||
115 | set number | " toggle line numbers | ||
116 | set formatprg=par | " set external formatting program to par, use gwip to format with this | ||
117 | set laststatus=2 | " this is required for airline | ||
118 | set cmdheight=1 | " controls how many lines the command line has | ||
119 | set relativenumber | " displays current lines line no as zero point from where relative numbers are getting counted | ||
120 | set timeoutlen=500 | " time between keys e.g. 80i= | ||
121 | set ttimeoutlen=10 | " set esc key timeout in ms | ||
122 | |||
123 | set splitbelow | " open new windows below the current one (i find that more intuitive) | ||
124 | |||
125 | if 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) | ||
134 | endif | ||
135 | |||
136 | if 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 | ||
166 | endif | ||
167 | |||
168 | "================================================================================ | ||
169 | " gui stuff and appearance | ||
170 | if &t_Co > 2 | ||
171 | set hlsearch | " highlight all search matches | ||
172 | set cursorline | " highlight currently selected line | ||
173 | endif | ||
174 | |||
175 | |||
176 | if 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) | ||
190 | else | ||
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 | ||
202 | endif | ||
203 | |||
204 | |||
205 | "================================================================================ | ||
206 | " custom commands... | ||
207 | " | ||
208 | " assign selection keys (these i missed a lot) | ||
209 | nmap <S-Left> vh| " shift-left selects to the left | ||
210 | xmap <S-Left> h| " ^^ | ||
211 | nmap <S-Right> vl| " shift-right selects to the right | ||
212 | xmap <S-Right> l| " ^^ | ||
213 | nmap <S-Up> vk| " shift-up selects like other text editors | ||
214 | xmap <S-Up> k| " ^^ | ||
215 | nmap <S-Down> vj| " shift down selects like other text editors | ||
216 | xmap <S-Down> j| " ^^ | ||
217 | nmap <Home> ^| " default homing in code editors is the first letter of a line | ||
218 | xmap <Home> 0| " go to the beginning of the line | ||
219 | xmap <S-Home> 0| " ^^ | ||
220 | xmap <Tab> >gv| " indent lines (and retain selection) | ||
221 | xmap <S-Tab> <gv| " unindent lines (and retain selection) | ||
222 | nmap <S-PageUp> VH| " selects predessing paragraph | ||
223 | nmap <S-PageDown> VL| " selects following paragraph | ||
224 | nmap <C-S-PageUp> V{| " selects predessing paragraph | ||
225 | nmap <C-S-PageDown> V}| " selects following paragraph | ||
226 | |||
227 | nmap <C-o> :24vs.<CR>| " means the same as :vsplit. and opens the :Exlore -window with a width of 24 | ||
228 | |||
229 | |||
230 | |||
231 | |||
232 | |||
233 | map <C-h> <C-w>h|map <C-j> <C-w>j| " window navigation shortcuts | ||
234 | map <C-k> <C-w>k|map <C-l> <C-w>l| " window navigation shortcuts | ||
235 | |||
236 | cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user | ||
237 | |||
238 | " custom hotkeys... | ||
239 | nnoremap <C-Tab> :tabnext<CR>| " lets one use CTRL+Tab to switch between tabs | ||
240 | nnoremap <C-S-Tab> :tabprevious<CR>| " use CTRL+Shift+Tab to switch to preview tab | ||
241 | |||
242 | nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines | ||
243 | |||
244 | nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before | ||
245 | nnoremap <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 | |||
255 | nnoremap <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 | ||
265 | map <C-l> :TlistToggle<CR>| " bind TagList to Hotkey Ctrl+L | ||
266 | 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) | ||
267 | |||
268 | |||
269 | set makeprg=make\ test | ||
270 | nnoremap <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 | ||
diff --git a/ycm_extra_conf.py b/ycm_extra_conf.py deleted file mode 100644 index 7a1828f..0000000 --- a/ycm_extra_conf.py +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | def FlagsForFile(filename, **kwargs): | ||
2 | return { | ||
3 | 'flags': [ | ||
4 | '-Wall', | ||
5 | '-Wextra', | ||
6 | '-Werror', | ||
7 | '-Wno-long-long', | ||
8 | '-Wno-variadic-macros', | ||
9 | '-fexceptions', | ||
10 | '-ferror-limit=10000', | ||
11 | '-DNDEBUG', | ||
12 | '-std=c99', | ||
13 | '-x', 'c', | ||
14 | '-D_GNU_SOURCE', | ||
15 | '-I.', | ||
16 | '-I', '/usr/include/' | ||
17 | ], | ||
18 | 'do_cache': True, | ||
19 | } | ||
20 | |||
21 | # vim:set et sw=4 ts=4 tw=120: | ||
diff --git a/ycm_extra_conf.pyc b/ycm_extra_conf.pyc deleted file mode 100644 index b1ae85c..0000000 --- a/ycm_extra_conf.pyc +++ /dev/null | |||
Binary files differ | |||