aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2017-06-11 01:45:25 +0200
committerMax Christian Pohle2017-06-11 01:45:25 +0200
commit0dd996f2c3151c5915b6b1f127f0655c2f83d9d4 (patch)
tree421a1011c20ec74442b1d16e9b47d2765cfa2bc4
parent44dcf9e53ee0e2f3700ecb326716c2b795593629 (diff)
downloadvim-karlmarks-0dd996f2c3151c5915b6b1f127f0655c2f83d9d4.tar.bz2
vim-karlmarks-0dd996f2c3151c5915b6b1f127f0655c2f83d9d4.zip
Bugfixes, switched from airline to lightline
-rw-r--r--compton.conf2
-rw-r--r--doc/shortcuts.txt1
-rw-r--r--vimrc-full94
-rw-r--r--ycm_extra_conf.py158
4 files changed, 65 insertions, 190 deletions
diff --git a/compton.conf b/compton.conf
index 79a3606..f83ce40 100644
--- a/compton.conf
+++ b/compton.conf
@@ -61,4 +61,4 @@ wintypes:
61#opacity-rule = ["90:class_g = 'URxvt'", "90:class_g = ''" ]; 61#opacity-rule = ["90:class_g = 'URxvt'", "90:class_g = ''" ];
62 62
63 63
64opacity-rule = ["90:class_g = 'xfce4-terminal'", "90:class_g = 'Xfce4-terminal'", "90:class_g = 'termite'", "90:class_g = 'i3bar'", "90:class_g = 'i3-frame'" ]; 64opacity-rule = ["90:class_g = 'xfce4-terminal'", "90: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/doc/shortcuts.txt b/doc/shortcuts.txt
index 8c0d773..a01c7a1 100644
--- a/doc/shortcuts.txt
+++ b/doc/shortcuts.txt
@@ -79,6 +79,7 @@ ma = set marker a-z (a in this case)
79<C-W>s = splits buffer horizontally (same as screen) 79<C-W>s = splits buffer horizontally (same as screen)
80<C-W>w = moves the cursor to the next window and back 80<C-W>w = moves the cursor to the next window and back
81<C-W>[dir] = moves the cursor in that direction (use hjkl or arrow keys) 81<C-W>[dir] = moves the cursor in that direction (use hjkl or arrow keys)
82<C-W>[HK] = make a vertical split horizontal and vice versa
82 83
83 84
84[vimdiff] 85[vimdiff]
diff --git a/vimrc-full b/vimrc-full
index e605d38..fac043b 100644
--- a/vimrc-full
+++ b/vimrc-full
@@ -166,49 +166,51 @@ nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to Hotkey Ct
166set laststatus=2 | " required by AirLine, without status line does not appear until a window split 166set laststatus=2 | " required by AirLine, without status line does not appear until a window split
167set background=light | 167set background=light |
168 168
169Plug 'vim-airline/vim-airline' | " beautification of the mode line 169Plug 'itchyny/lightline.vim'
170let g:airline_section_c = "%F" | " was: %F 170
171let g:airline_detect_modified = 1 | 171" Plug 'vim-airline/vim-airline' | " beautification of the mode line
172let g:airline_detect_paste = 0 | 172" let g:airline_section_c = "%F" | " was: %F
173let g:airline_exclude_preview = 0 | 173" let g:airline_detect_modified = 1 |
174let g:airline_inactive_collapse = 1 | 174" let g:airline_detect_paste = 0 |
175let g:airline_powerline_fonts = 1 | 175" let g:airline_exclude_preview = 0 |
176let g:airline_skip_empty_sections = 1 | 176" let g:airline_inactive_collapse = 1 |
177" let g:airline_extensions = [] | 177" let g:airline_powerline_fonts = 1 |
178 178" let g:airline_skip_empty_sections = 1 |
179let g:airline#extensions#tabline#enabled = 1 | 179" let g:airline_extensions = [] |
180let g:airline#extensions#tabline#left_alt_sep = '' | 180"
181let g:airline#extensions#tabline#left_sep = '' | 181" let g:airline#extensions#tabline#enabled = 1 |
182let g:airline#extensions#tabline#right_alt_sep = '' | 182" let g:airline#extensions#tabline#left_alt_sep = '' |
183let g:airline#extensions#tabline#right_sep = '' | 183" let g:airline#extensions#tabline#left_sep = '' |
184let g:airline#extensions#tabline#fnamemod = ':t' | " let airline just show the filename without its path 184" let g:airline#extensions#tabline#right_alt_sep = '' |
185let g:airline#extensions#tabline#disable_refresh = 0 | 185" let g:airline#extensions#tabline#right_sep = '' |
186let g:airline#extensions#tabline#enabled = 1 | 186" let g:airline#extensions#tabline#fnamemod = ':t' | " let airline just show the filename without its path
187let g:airline#extensions#tabline#show_buffers = 1 | 187" let g:airline#extensions#tabline#disable_refresh = 1 | " refresh airline on bufadd ?
188let g:airline#extensions#tabline#show_tabs = 0 | 188" let g:airline#extensions#tabline#enabled = 1 |
189let g:airline#extensions#tabline#ignore_bufadd_pat = '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree|preview|^$' 189" let g:airline#extensions#tabline#show_buffers = 1 |
190 190" let g:airline#extensions#tabline#show_tabs = 0 |
191let g:airline_extensions#branch#enabled = 1 | 191" let g:airline#extensions#tabline#ignore_bufadd_pat = '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree|preview|^$'
192let g:airline_extensions#whitespace#enabled = 1 | 192"
193let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] 193" let g:airline_extensions#branch#enabled = 1 |
194 194" let g:airline_extensions#whitespace#enabled = 0 | " airlines whitespace check is slow :/
195if has('python') 195" let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file']
196 let g:airline_extensions#syntastic#enabled = 1 | 196"
197 let g:airline_extensions#ycm#enabled = 1 | 197" if has('python')
198endif 198" let g:airline_extensions#syntastic#enabled = 1 |
199 199" let g:airline_extensions#ycm#enabled = 1 |
200let g:airline#extensions#tagbar#flags = 'f' | " even though the airline extension is off this controls :h tagbar-extend 200" endif
201let g:airline#extensions#tagbar#enabled = 0 | 201"
202 202" let g:airline#extensions#tagbar#flags = 'f' | " even though the airline extension is off this controls :h tagbar-extend
203" AIRLINE_Theme: 203" let g:airline#extensions#tagbar#enabled = 0 |
204Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme 204"
205let base16colorspace=256 | 205" " AIRLINE_Theme:
206let g:airline_theme='base16' | " specifies which colorscheme should airline uses 206" Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme
207let g:airline#themes#base16#constant = 0 | 207" let base16colorspace=256 |
208" let g:solarized_base16 = 1 208" let g:airline_theme='base16' | " specifies which colorscheme should airline uses
209" let g:airline_base16_improved_contrast = 1 209" let g:airline#themes#base16#constant = 0 |
210" let g:airline_theme='badcat' | " specifies which colorscheme should airline uses 210" " let g:solarized_base16 = 1
211" let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses 211" " let g:airline_base16_improved_contrast = 1
212" " let g:airline_theme='badcat' | " specifies which colorscheme should airline uses
213" " let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses
212 214
213" Autocompleter: ===================================== 215" Autocompleter: =====================================
214if has("python") 216if has("python")
@@ -593,7 +595,7 @@ if has("autocmd")
593 " autocmd BufEnter * @f 595 " autocmd BufEnter * @f
594 augroup END 596 augroup END
595 597
596 autocmd VimEnter * set nobuflisted 598 " autocmd VimEnter * set nobuflisted
597endif 599endif
598 600
599 601
@@ -659,6 +661,7 @@ let g:netrw_winsize = 20 | " window size in percent
659 661
660 662
661highlight WordBold cterm=bold gui=bold 663highlight WordBold cterm=bold gui=bold
664let w:m1 = 0
662function! HighlightWordUnderCursor() 665function! HighlightWordUnderCursor()
663 if(exists('w:m1') && w:m1 > 0) 666 if(exists('w:m1') && w:m1 > 0)
664 call matchdelete(w:m1) 667 call matchdelete(w:m1)
@@ -670,6 +673,9 @@ function! HighlightWordUnderCursor()
670 endif 673 endif
671endfunction 674endfunction
672autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor() 675autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor()
676if version >= 702 " clean up (see: http://vim.wikia.com/wiki/VimTip396)
677 autocmd BufWinLeave * call clearmatches()
678endif
673 679
674" au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main 680" au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main
675" Enable omni completion. 681" Enable omni completion.
diff --git a/ycm_extra_conf.py b/ycm_extra_conf.py
index c4cc609..092887d 100644
--- a/ycm_extra_conf.py
+++ b/ycm_extra_conf.py
@@ -1,145 +1,13 @@
1# Generated by YCM Generator at 2015-09-05 13:02:32.549813 1def FlagsForFile(filename, **kwargs):
2 2 return {
3# This file is NOT licensed under the GPLv3, which is the license for the rest 3 'flags': [
4# of YouCompleteMe. 4 '-x',
5# 5 'c',
6# Here's the license text for this file: 6 '-isystem',
7# 7 '/usr/include',
8# This is free and unencumbered software released into the public domain. 8 '-isystem',
9# 9 '-isystem',
10# Anyone is free to copy, modify, publish, use, compile, sell, or 10 '-I',
11# distribute this software, either in source code form or as a compiled 11 '.',
12# binary, for any purpose, commercial or non-commercial, and by any 12 ],
13# means. 13 }
14#
15# In jurisdictions that recognize copyright laws, the author or authors
16# of this software dedicate any and all copyright interest in the
17# software to the public domain. We make this dedication for the benefit
18# of the public at large and to the detriment of our heirs and
19# successors. We intend this dedication to be an overt act of
20# relinquishment in perpetuity of all present and future rights to this
21# software under copyright law.
22#
23# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29# OTHER DEALINGS IN THE SOFTWARE.
30#
31# For more information, please refer to <http://unlicense.org/>
32
33import os
34import ycm_core
35
36flags = [
37 '-x',
38 'c',
39 '-D_GNU_SOURCE',
40 '-I./',
41 '-I/usr/include',
42 '-I/usr/local/include',
43 '-Wall',
44 '-I', '../submodules/',
45 '-I', 'lib/',
46 '-I', 'submodules/qdecoder/src/',
47]
48
49
50# Set this to the absolute path to the folder (NOT the file!) containing the
51# compile_commands.json file to use that instead of 'flags'. See here for
52# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
53#
54# You can get CMake to generate this file for you by adding:
55# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
56# to your CMakeLists.txt file.
57#
58# Most projects will NOT need to set this to anything; you can just change the
59# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
60compilation_database_folder = ''
61
62if os.path.exists( compilation_database_folder ):
63 database = ycm_core.CompilationDatabase( compilation_database_folder )
64else:
65 database = None
66
67SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
68
69def DirectoryOfThisScript():
70 return os.path.dirname( os.path.abspath( __file__ ) )
71
72
73def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
74 if not working_directory:
75 return list( flags )
76 new_flags = []
77 make_next_absolute = False
78 path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
79 for flag in flags:
80 new_flag = flag
81
82 if make_next_absolute:
83 make_next_absolute = False
84 if not flag.startswith( '/' ):
85 new_flag = os.path.join( working_directory, flag )
86
87 for path_flag in path_flags:
88 if flag == path_flag:
89 make_next_absolute = True
90 break
91
92 if flag.startswith( path_flag ):
93 path = flag[ len( path_flag ): ]
94 new_flag = path_flag + os.path.join( working_directory, path )
95 break
96
97 if new_flag:
98 new_flags.append( new_flag )
99 return new_flags
100
101
102def IsHeaderFile( filename ):
103 extension = os.path.splitext( filename )[ 1 ]
104 return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
105
106
107def GetCompilationInfoForFile( filename ):
108 # The compilation_commands.json file generated by CMake does not have entries
109 # for header files. So we do our best by asking the db for flags for a
110 # corresponding source file, if any. If one exists, the flags for that file
111 # should be good enough.
112 if IsHeaderFile( filename ):
113 basename = os.path.splitext( filename )[ 0 ]
114 for extension in SOURCE_EXTENSIONS:
115 replacement_file = basename + extension
116 if os.path.exists( replacement_file ):
117 compilation_info = database.GetCompilationInfoForFile(
118 replacement_file )
119 if compilation_info.compiler_flags_:
120 return compilation_info
121 return None
122 return database.GetCompilationInfoForFile( filename )
123
124
125def FlagsForFile( filename, **kwargs ):
126 if database:
127 # Bear in mind that compilation_info.compiler_flags_ does NOT return a
128 # python list, but a "list-like" StringVec object
129 compilation_info = GetCompilationInfoForFile( filename )
130 if not compilation_info:
131 return None
132
133 final_flags = MakeRelativePathsInFlagsAbsolute(
134 compilation_info.compiler_flags_,
135 compilation_info.compiler_working_dir_ )
136
137 else:
138 relative_to = DirectoryOfThisScript()
139 final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
140
141 return {
142 'flags': final_flags,
143 'do_cache': True
144 }
145
..