diff options
Diffstat (limited to 'vim/.vim/config')
-rw-r--r-- | vim/.vim/config/airline.vim | 4 | ||||
-rw-r--r-- | vim/.vim/config/molokai.vim | 1 | ||||
-rw-r--r-- | vim/.vim/config/rainbow.vim | 19 | ||||
-rw-r--r-- | vim/.vim/config/syntastic.vim | 35 | ||||
-rw-r--r-- | vim/.vim/config/ycm.vim | 20 | ||||
-rw-r--r-- | vim/.vim/config/ycm_extra_conf.py | 76 |
6 files changed, 155 insertions, 0 deletions
diff --git a/vim/.vim/config/airline.vim b/vim/.vim/config/airline.vim new file mode 100644 index 0000000..99fc4f0 --- /dev/null +++ b/vim/.vim/config/airline.vim | |||
@@ -0,0 +1,4 @@ | |||
1 | set laststatus=2 | ||
2 | let g:airline#extensions#tabline#enabled = 1 | ||
3 | let g:airline_powerline_fonts = 1 | ||
4 | let g:airline_theme = "molokai" | ||
diff --git a/vim/.vim/config/molokai.vim b/vim/.vim/config/molokai.vim new file mode 100644 index 0000000..848845c --- /dev/null +++ b/vim/.vim/config/molokai.vim | |||
@@ -0,0 +1 @@ | |||
let g:rehash256 = 1 \ No newline at end of file | |||
diff --git a/vim/.vim/config/rainbow.vim b/vim/.vim/config/rainbow.vim new file mode 100644 index 0000000..7870030 --- /dev/null +++ b/vim/.vim/config/rainbow.vim | |||
@@ -0,0 +1,19 @@ | |||
1 | let g:rbpt_colorpairs = [ | ||
2 | \ [158, '#00ceb3'], | ||
3 | \ [081, '#00a3ff'], | ||
4 | \ [214, '#ff8d00'], | ||
5 | \ [123, '#3fffc9'], | ||
6 | \ [045, '#29b9ec'], | ||
7 | \ [190, '#bfec29'], | ||
8 | \ [208, '#ffad00'], | ||
9 | \ [117, '#48bde0'], | ||
10 | \ ] | ||
11 | |||
12 | let g:rbpt_max = 8 | ||
13 | let g:rbpt_loadcmd_toggle = 0 | ||
14 | |||
15 | au VimEnter * RainbowParenthesesToggle | ||
16 | au Syntax * RainbowParenthesesLoadRound | ||
17 | au Syntax * RainbowParenthesesLoadSquare | ||
18 | au Syntax * RainbowParenthesesLoadBraces | ||
19 | |||
diff --git a/vim/.vim/config/syntastic.vim b/vim/.vim/config/syntastic.vim new file mode 100644 index 0000000..04babc7 --- /dev/null +++ b/vim/.vim/config/syntastic.vim | |||
@@ -0,0 +1,35 @@ | |||
1 | if has('nvim') | ||
2 | autocmd BufReadPost * Neomake | ||
3 | autocmd BufWritePost * Neomake | ||
4 | map <leader>sc :Neomake!<CR> | ||
5 | let g:neomake_python_enabled_makers = ['flake8'] | ||
6 | |||
7 | else | ||
8 | set statusline+=%#warningmsg# | ||
9 | set statusline+=%{SyntasticStatuslineFlag()} | ||
10 | set statusline+=%* | ||
11 | |||
12 | let g:syntastic_always_populate_loc_list = 1 | ||
13 | let g:syntastic_auto_loc_list = 1 | ||
14 | |||
15 | let g:syntastic_quiet_messages = {'level': 'warnings'} | ||
16 | let g:syntastic_check_on_open=1 | ||
17 | let g:syntastic_check_on_wq = 1 | ||
18 | let g:syntastic_enable_signs=1 | ||
19 | |||
20 | let g:syntastic_error_symbol='✗' | ||
21 | let g:syntastic_warning_symbol='⚠' | ||
22 | |||
23 | let g:syntastic_html_tidy_exec = 'tidy' | ||
24 | |||
25 | let g:syntastic_python_python_exec = '/usr/bin/python3' | ||
26 | let g:syntastic_mode_map = { 'mode': 'passive', | ||
27 | \ 'active_filetypes': ['python', 'javascript'], | ||
28 | \ 'passive_filetypes': ['scala', 'tex', 'java', 'go'] } | ||
29 | |||
30 | let g:syntastic_python_checkers = ['pep8'] | ||
31 | let g:syntastic_python_flake8_post_args = "--ignore=E501,E226,E225,E227" | ||
32 | let g:syntastic_c_compiler = 'clang' | ||
33 | |||
34 | map <leader>sc :SyntasticCheck<CR> | ||
35 | endif | ||
diff --git a/vim/.vim/config/ycm.vim b/vim/.vim/config/ycm.vim new file mode 100644 index 0000000..ec11cbd --- /dev/null +++ b/vim/.vim/config/ycm.vim | |||
@@ -0,0 +1,20 @@ | |||
1 | let g:ycm_global_ycm_extra_conf = '/home/clarkzjw/.vim/config/ycm_extra_conf.py' | ||
2 | let g:ycm_collect_identifiers_from_tags_files = 1 | ||
3 | let g:ycm_seed_identifiers_with_syntax = 1 | ||
4 | let g:ycm_confirm_extra_conf = 0 | ||
5 | let g:ycm_min_num_of_chars_for_completion = 2 | ||
6 | let g:ycm_auto_trigger = 1 | ||
7 | let g:ycm_path_to_python_interpreter = '/usr/bin/python3' | ||
8 | let g:ycm_show_diagnostics_ui = 0 | ||
9 | let g:ycm_key_list_select_completion = ['<TAB>', '<C-n>', '<Down>'] | ||
10 | let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] | ||
11 | "let g:ycm_filetype_whitelist = { | ||
12 | " \ 'c': 1 , | ||
13 | " \ 'cpp': 1, | ||
14 | " \ 'python': 1 | ||
15 | " \} | ||
16 | nnoremap <leader>jd :YcmCompleter GoTo<CR> | ||
17 | |||
18 | let g:ycm_add_preview_to_completeopt = 0 | ||
19 | let g:ycm_autoclose_preview_window_after_completion = 1 | ||
20 | let g:ycm_autoclose_preview_window_after_insertion = 0 | ||
diff --git a/vim/.vim/config/ycm_extra_conf.py b/vim/.vim/config/ycm_extra_conf.py new file mode 100644 index 0000000..3a827dd --- /dev/null +++ b/vim/.vim/config/ycm_extra_conf.py | |||
@@ -0,0 +1,76 @@ | |||
1 | import os | ||
2 | import ycm_core | ||
3 | from clang_helpers import PrepareClangFlags | ||
4 | |||
5 | compilation_database_folder = '' | ||
6 | |||
7 | if compilation_database_folder: | ||
8 | database = ycm_core.CompilationDatabase(compilation_database_folder) | ||
9 | else: | ||
10 | database = None | ||
11 | |||
12 | flags = [ | ||
13 | '-Wall', | ||
14 | '-std=c++11', | ||
15 | '-stdlib=libc++', | ||
16 | '-x', | ||
17 | 'c++', | ||
18 | '-I/usr/local/include', | ||
19 | '-I/usr/include', | ||
20 | '-I/home/clarkzjw/Code/clang3.9.0/include/c++/v1', | ||
21 | '.', | ||
22 | ] | ||
23 | |||
24 | |||
25 | def DirectoryOfThisScript(): | ||
26 | return os.path.dirname(os.path.abspath(__file__)) | ||
27 | |||
28 | |||
29 | def MakeRelativePathsInFlagsAbsolute(flags, working_directory): | ||
30 | if not working_directory: | ||
31 | return flags | ||
32 | new_flags = [] | ||
33 | make_next_absolute = False | ||
34 | path_flags = ['-isystem', '-I', '-iquote', '--sysroot='] | ||
35 | for flag in flags: | ||
36 | new_flag = flag | ||
37 | |||
38 | if make_next_absolute: | ||
39 | make_next_absolute = False | ||
40 | if not flag.startswith('/'): | ||
41 | new_flag = os.path.join(working_directory, flag) | ||
42 | |||
43 | for path_flag in path_flags: | ||
44 | if flag == path_flag: | ||
45 | make_next_absolute = True | ||
46 | break | ||
47 | |||
48 | if flag.startswith(path_flag): | ||
49 | path = flag[len(path_flag):] | ||
50 | new_flag = path_flag + os.path.join(working_directory, path) | ||
51 | break | ||
52 | |||
53 | if new_flag: | ||
54 | new_flags.append(new_flag) | ||
55 | return new_flags | ||
56 | |||
57 | |||
58 | def FlagsForFile(filename): | ||
59 | if database: | ||
60 | # Bear in mind that compilation_info.compiler_flags_ does NOT return a | ||
61 | # python list, but a "list-like" StringVec object | ||
62 | compilation_info = database.GetCompilationInfoForFile(filename) | ||
63 | final_flags = PrepareClangFlags( | ||
64 | MakeRelativePathsInFlagsAbsolute( | ||
65 | compilation_info.compiler_flags_, | ||
66 | compilation_info.compiler_working_dir_), | ||
67 | filename) | ||
68 | |||
69 | else: | ||
70 | relative_to = DirectoryOfThisScript() | ||
71 | final_flags = MakeRelativePathsInFlagsAbsolute(flags, relative_to) | ||
72 | |||
73 | return { | ||
74 | 'flags': final_flags, | ||
75 | 'do_cache': True | ||
76 | } | ||