2014-04-09 08:07:12 -04:00
|
|
|
"============================================================"
|
|
|
|
" "
|
|
|
|
" Darkcloud Vim Config: plugin settings "
|
|
|
|
" "
|
2014-06-17 01:49:46 -04:00
|
|
|
" By: Kevin MacMartin (prurigro@gmail.com) "
|
2014-04-09 08:07:12 -04:00
|
|
|
" Website: https://github.com/prurigro/darkcloud-vimconfig "
|
|
|
|
" "
|
|
|
|
" License: MIT "
|
|
|
|
" "
|
|
|
|
"============================================================"
|
2014-10-22 03:41:50 -04:00
|
|
|
"
|
|
|
|
" Acknowledgements:
|
|
|
|
"
|
|
|
|
" The Tabular TableFormat() function is taken from the
|
|
|
|
" vim-markdown project by plasticboy, which can be found
|
|
|
|
" at https://github.com/plasticboy/vim-markdown and is
|
|
|
|
" licensed with the MIT license.
|
|
|
|
"
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-12-01 00:31:28 -05:00
|
|
|
"use utf-8 encoding to load the script as it contains utf-8 characters
|
|
|
|
scriptencoding utf-8
|
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"INITIALIZE PLUGINS: {{{
|
2014-08-25 00:43:41 -04:00
|
|
|
"create missing plugin config files and directories
|
2014-08-29 05:37:36 -04:00
|
|
|
if exists('*mkdir')|if !isdirectory(glob("~/.vim/tags_by_filetype"))|call mkdir(glob("~/.vim/tags_by_filetype"),'p')|endif|endif
|
2014-07-21 02:36:50 -04:00
|
|
|
if !filereadable(glob("~/.vim/tags"))|new|silent e ~/.vim/tags|silent w|q|endif
|
|
|
|
if !filereadable(glob("~/.vim/snippets.json"))|new|silent e ~/.vim/snippets.json|silent w|q|endif
|
|
|
|
if !filereadable(glob("~/.vim/filetypes.vim"))|new|silent e ~/.vim/filetypes.vim|silent w|q|endif
|
|
|
|
|
|
|
|
"load plugins in vim/bundle/ and vim/bundle.user/
|
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
|
|
|
execute pathogen#infect('bundle/{}', 'bundle.user/{}')
|
2014-08-21 02:27:36 -04:00
|
|
|
|
|
|
|
"set the locations for easytags, tagbar and other plugins to look for tag files
|
|
|
|
set tags=./.tags;,~/.vim/tags
|
2014-02-20 23:24:20 -05:00
|
|
|
"}}}
|
|
|
|
|
2015-01-05 20:53:42 -05:00
|
|
|
"AUTOFORMAT: {{{
|
|
|
|
"use tidy for html instead of html-beautify
|
|
|
|
let g:formatprg_html = "tidy"
|
|
|
|
let g:formatprg_args_expr_html = '"-q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -ashtml -wrap ".&textwidth'
|
|
|
|
"}}
|
|
|
|
|
2014-10-28 15:33:37 -04:00
|
|
|
"BOOKMARKS: {{{
|
|
|
|
let g:bookmark_sign = '★'
|
|
|
|
let g:bookmark_annotation_sign = '📌'
|
|
|
|
"}}}
|
|
|
|
|
2014-07-14 09:24:38 -04:00
|
|
|
"EASYTAGS: {{{
|
2014-08-21 02:27:36 -04:00
|
|
|
let g:easytags_suppress_ctags_warning=1
|
2014-08-29 05:37:36 -04:00
|
|
|
if !filereadable(glob("~/.vim/tags"))|let g:easytags_file='~/.vim/tags'|endif
|
|
|
|
if !isdirectory(glob("~/.vim/tags_by_filetype"))|let g:easytags_by_filetype='~/.vim/tags_by_filetype'|endif
|
2014-07-14 10:30:02 -04:00
|
|
|
|
|
|
|
"prevent automatically generating the tagfile and syntax highlighting tags (default: 0)
|
|
|
|
if !exists("g:disableautotags")
|
2014-08-25 00:43:41 -04:00
|
|
|
let g:disableautotags=0
|
2014-07-14 10:30:02 -04:00
|
|
|
endif
|
|
|
|
if (g:disableautotags == 1)
|
|
|
|
let g:easytags_auto_update=0
|
|
|
|
let g:easytags_auto_highlight=0
|
|
|
|
else
|
|
|
|
let g:easytags_auto_update=1
|
|
|
|
let g:easytags_auto_highlight=1
|
|
|
|
endif
|
2014-07-14 09:24:38 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-04-07 12:05:52 -04:00
|
|
|
"EMMET: {{{
|
2014-04-02 11:17:12 -04:00
|
|
|
let g:user_emmet_install_global=0
|
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
|
|
|
let g:use_emmet_complete_tag=1
|
|
|
|
let g:user_emmet_mode='a'
|
|
|
|
|
2015-10-25 14:52:35 -04:00
|
|
|
autocmd FileType aspnet,blade,html,xhtml,php,css,javascript,json EmmetInstall
|
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
|
|
|
|
|
|
|
if filereadable("~/.vim/snippets.json")
|
|
|
|
let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.vim/snippets.json')), "\n"))
|
|
|
|
endif
|
2014-03-11 03:05:09 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-05-05 04:26:11 -04:00
|
|
|
"GOYO: {{{
|
|
|
|
autocmd VimEnter,Filetype *
|
2014-12-01 00:31:28 -05:00
|
|
|
\ let g:goyo_width = &textwidth |
|
|
|
|
\ if (g:goyo_width == 0) |
|
|
|
|
\ let g:goyo_width = max(map(getline(1,'$'), 'len(v:val)')) |
|
|
|
|
\ if (g:goyo_width < 80) |
|
|
|
|
\ let g:goyo_width = 80 |
|
|
|
|
\ endif |
|
|
|
|
\ endif
|
2014-05-05 04:26:11 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-04-08 03:39:10 -04:00
|
|
|
"GUNDO: {{{
|
2014-12-01 08:46:34 -05:00
|
|
|
let g:gundo_right=0
|
2014-04-08 03:39:10 -04:00
|
|
|
let g:gundo_width=35
|
|
|
|
let g:gundo_preview_height=10
|
|
|
|
|
|
|
|
autocmd FileType gundo setlocal nocursorcolumn
|
|
|
|
"}}}
|
|
|
|
|
2014-10-19 13:12:27 -04:00
|
|
|
"INCSEARCH: {{{
|
|
|
|
"use incsearch in place of the default search
|
|
|
|
map / <Plug>(incsearch-forward)
|
|
|
|
map ? <Plug>(incsearch-backward)
|
|
|
|
map g/ <Plug>(incsearch-stay)
|
|
|
|
|
|
|
|
"n and N behavioru is consistant
|
2014-12-01 08:46:34 -05:00
|
|
|
let g:incsearch#consistent_n_direction=1
|
2014-10-19 13:12:27 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-08-25 01:37:45 -04:00
|
|
|
"JSON: {{{
|
|
|
|
let g:vim_json_warnings=0
|
|
|
|
let g:vim_json_syntax_conceal=0
|
|
|
|
"}}}
|
|
|
|
|
2014-07-12 17:40:02 -04:00
|
|
|
"MATCHTAGALWAYS: {{{
|
2014-07-14 10:30:02 -04:00
|
|
|
let g:mta_filetypes = {'aspnet':1, 'html':1, 'xhtml':1, 'php':1, 'xml':1, 'jinja':1}
|
2014-07-12 17:40:02 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-04-08 03:39:10 -04:00
|
|
|
"NEOCOMPLCACHE AUTOCOMPLETION PLUGIN: {{{
|
|
|
|
let g:neocomplcache_enable_at_startup=1
|
|
|
|
let g:neocomplcache_enable_smart_case=1
|
|
|
|
let g:neocomplcache_min_syntax_length=3
|
2014-07-26 05:09:52 -04:00
|
|
|
let g:neocomplcache_enable_insert_char_pre=0
|
2014-04-08 03:39:10 -04:00
|
|
|
let g:neocomplcache_enable_underbar_completion=1
|
|
|
|
let g:neocomplcache_wildcard_characters={'_': '-'}
|
|
|
|
|
|
|
|
if !exists('g:neocomplcache_omni_patterns')
|
|
|
|
let g:neocomplcache_omni_patterns = {}
|
|
|
|
endif
|
|
|
|
if !exists('g:neocomplcache_force_omni_patterns')
|
|
|
|
let g:neocomplcache_force_omni_patterns = {}
|
|
|
|
endif
|
|
|
|
|
|
|
|
let g:neocomplcache_omni_patterns.c='[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?'
|
|
|
|
let g:neocomplcache_omni_patterns.cpp='[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
|
|
|
|
let g:neocomplcache_omni_patterns.xml='<[^>]*'
|
|
|
|
let g:neocomplcache_omni_patterns.html='<[^>]*'
|
|
|
|
let g:neocomplcache_omni_patterns.xhtml='<[^>]*'
|
|
|
|
let g:neocomplcache_omni_patterns.markdown='<[^>]*'
|
|
|
|
let g:neocomplcache_omni_patterns.css='^\s\+\w+\|\w+[):;]?\s\+\|[@!]'
|
|
|
|
let g:neocomplcache_omni_patterns.less='^\s\+\w+\|\w+[):;]?\s\+\|[@!]'
|
|
|
|
let g:neocomplcache_omni_patterns.javascript='[^. \t]\.\%(\h\w*\)\?'
|
2014-07-14 10:30:02 -04:00
|
|
|
let g:neocomplcache_omni_patterns.json='[^. \t]\.\%(\h\w*\)\?'
|
2014-04-08 03:39:10 -04:00
|
|
|
let g:neocomplcache_omni_patterns.python='[^. *\t]\.\h\w*\|\h\w*::'
|
|
|
|
let g:neocomplcache_omni_patterns.ruby='[^. *\t]\.\w*\|\h\w*::'
|
|
|
|
let g:neocomplcache_omni_patterns.php='[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
|
|
|
|
let g:neocomplcache_omni_patterns.actionscript='[^. \t][.:]\h\w*'
|
|
|
|
let g:neocomplcache_omni_patterns.python3='[^. *\t]\.\h\w*\|\h\w*::'
|
|
|
|
let g:neocomplcache_omni_patterns.go='\h\w*\%.'
|
|
|
|
let g:neocomplcache_omni_patterns.perl='\h\w*->\h\w*\|\h\w*::'
|
|
|
|
let g:neocomplcache_omni_patterns.java='\%(\h\w*\|)\)\.'
|
|
|
|
let g:neocomplcache_omni_patterns.objc='\h\w\+\|\h\w*\%(\.\|->\)\h\w*'
|
|
|
|
let g:neocomplcache_omni_patterns.objj='[\[ \.]\w\+$\|:\w*$'
|
|
|
|
"}}}
|
|
|
|
|
2014-04-07 12:05:52 -04:00
|
|
|
"SIGNIFY: {{{
|
2014-07-20 23:55:42 -04:00
|
|
|
let g:signify_sign_add='+'
|
|
|
|
let g:signify_sign_change='!'
|
|
|
|
let g:signify_sign_delete='-'
|
|
|
|
let g:signify_sign_delete_first_line='~'
|
2014-04-07 10:04:48 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-04-08 03:39:10 -04:00
|
|
|
"SYNTASTIC: {{{
|
2014-04-18 05:12:35 -04:00
|
|
|
"autostart syntax checking when vim opens to a compatible filetype (default: 0)
|
2014-04-08 03:39:10 -04:00
|
|
|
if !exists("g:autostartchecker")
|
2014-04-18 05:12:35 -04:00
|
|
|
let g:autostartchecker=0
|
2014-04-08 03:39:10 -04:00
|
|
|
endif
|
2014-04-17 12:18:26 -04:00
|
|
|
|
|
|
|
if &diff
|
|
|
|
let g:autostartchecker=0
|
2014-04-08 03:39:10 -04:00
|
|
|
else
|
2014-04-17 12:18:26 -04:00
|
|
|
if (g:autostartchecker == 1)
|
2015-02-27 11:21:28 -05:00
|
|
|
let g:syntastic_mode_map={
|
|
|
|
\ 'mode':'active',
|
|
|
|
\ 'active_filetypes':[],
|
|
|
|
\ 'passive_filetypes':[]
|
|
|
|
\ }
|
2014-04-17 12:18:26 -04:00
|
|
|
let g:syntastic_check_on_open=1
|
|
|
|
else
|
2015-02-27 11:21:28 -05:00
|
|
|
let g:syntastic_mode_map={
|
|
|
|
\ 'mode':'passive',
|
|
|
|
\ 'active_filetypes':[],
|
|
|
|
\ 'passive_filetypes':[]
|
|
|
|
\ }
|
2014-04-17 12:18:26 -04:00
|
|
|
let g:syntastic_check_on_open=0
|
|
|
|
endif
|
|
|
|
|
2015-03-02 18:17:03 -05:00
|
|
|
"configure warnings/errors that should be silenced by module
|
2015-03-23 16:38:55 -04:00
|
|
|
let g:syntastic_less_lessc_quiet_messages={
|
2014-10-11 06:32:58 -04:00
|
|
|
\ 'regex':[
|
2015-07-12 16:49:15 -04:00
|
|
|
\ 'NameError:.* is undefined',
|
|
|
|
\ 'FileError:.*'
|
2015-02-27 11:21:28 -05:00
|
|
|
\ ]}
|
|
|
|
let g:syntastic_java_javac_quiet_messages={
|
|
|
|
\ 'regex':[
|
|
|
|
\ 'cannot find symbol.*',
|
|
|
|
\ 'method does not override or implement a method from a supertype.*',
|
|
|
|
\ 'package [^\ ]* does not exist.*'
|
|
|
|
\ ]}
|
2015-03-23 17:12:09 -04:00
|
|
|
let g:syntastic_javascript_eslint_quiet_messages={
|
|
|
|
\ 'regex':[
|
|
|
|
\ '.* is defined but never used',
|
|
|
|
\ "'[^']*' is not defined",
|
2015-03-23 17:40:48 -04:00
|
|
|
\ 'Missing "use strict" statement',
|
|
|
|
\ 'Unexpected [^ ]* statement.*'
|
2015-03-23 17:12:09 -04:00
|
|
|
\ ]}
|
2015-11-09 14:40:31 -05:00
|
|
|
let g:syntastic_javascript_jshint_quiet_messages={
|
|
|
|
\ 'regex':[
|
|
|
|
\ 'Expected an assignment or function call and instead saw an expression.'
|
|
|
|
\ ]}
|
2015-03-23 17:12:09 -04:00
|
|
|
let g:syntastic_javascript_standard_quiet_messages={
|
|
|
|
\ 'regex':[
|
|
|
|
\ '.* is defined but never used',
|
|
|
|
\ "'[^']*' is not defined"
|
|
|
|
\ ]}
|
2015-08-29 03:01:21 -04:00
|
|
|
let g:syntastic_markdown_mdl_quiet_messages={
|
|
|
|
\ 'regex':[
|
2015-10-09 23:55:15 -04:00
|
|
|
\ '.*MD013.*',
|
|
|
|
\ '.*MD002.*'
|
2015-08-29 03:01:21 -04:00
|
|
|
\ ]}
|
2015-02-27 11:21:28 -05:00
|
|
|
let g:syntastic_python_flake8_quiet_messages={
|
|
|
|
\ 'regex':[
|
2015-03-02 18:17:03 -05:00
|
|
|
\ '.*\[W293\]',
|
|
|
|
\ '.*\[E501\]'
|
2014-10-11 06:32:58 -04:00
|
|
|
\ ]}
|
2015-10-29 17:49:23 -04:00
|
|
|
let g:syntastic_php_phpmd_quiet_messages={
|
|
|
|
\ 'regex':[
|
2015-10-29 18:22:12 -04:00
|
|
|
\ 'Avoid using short method names like.*',
|
2015-11-04 16:53:45 -05:00
|
|
|
\ 'Avoid variables with short names like.*',
|
2015-11-11 11:53:52 -05:00
|
|
|
\ 'The method.*has [0-9][0-9]* lines of code.*',
|
2015-11-11 12:00:09 -05:00
|
|
|
\ 'The method.*has a Cyclomatic Complexity.*',
|
2015-11-04 16:53:45 -05:00
|
|
|
\ 'The method.*has an NPath complexity.*',
|
2015-11-11 12:00:09 -05:00
|
|
|
\ 'The function.*has a Cyclomatic Complexity.*',
|
2016-01-27 13:57:09 -05:00
|
|
|
\ 'The function.*has an NPath complexity.*',
|
|
|
|
\ 'The function.*Avoid really long methods\.'
|
2015-10-29 17:49:23 -04:00
|
|
|
\ ]}
|
2015-03-23 16:38:55 -04:00
|
|
|
let g:syntastic_sh_bashate_quiet_messages={
|
|
|
|
\ 'regex':[
|
|
|
|
\ 'Indent not multiple of 4'
|
|
|
|
\ ]}
|
|
|
|
let g:syntastic_sh_shellcheck_quiet_messages={
|
|
|
|
\ 'regex':[
|
|
|
|
\ '.*\[SC1001\]',
|
|
|
|
\ '.*\[SC2016\]',
|
|
|
|
\ '.*\[SC2029\]',
|
2015-05-28 19:20:46 -04:00
|
|
|
\ '.*\[SC2034\]',
|
|
|
|
\ '.*\[SC2148\]'
|
2015-03-23 16:38:55 -04:00
|
|
|
\ ]}
|
2015-02-27 11:21:28 -05:00
|
|
|
autocmd BufNewFile,BufRead PKGBUILD,bash.bashrc,.bashrc let g:syntastic_quiet_messages={"level":"warnings"}
|
2014-08-25 23:56:55 -04:00
|
|
|
|
2014-08-25 23:39:44 -04:00
|
|
|
let g:syntastic_check_on_wq=0
|
2014-04-17 12:18:26 -04:00
|
|
|
let g:syntastic_always_populate_loc_list=1
|
|
|
|
let g:syntastic_auto_loc_list=1
|
|
|
|
let g:syntastic_loc_list_height=5
|
2014-04-08 03:39:10 -04:00
|
|
|
endif
|
2014-11-18 11:23:34 -05:00
|
|
|
|
|
|
|
"function to enable syntastic and set check_on_open on
|
|
|
|
function s:SyntasticToggleOn()
|
|
|
|
let g:syntastic_check_on_open=1
|
|
|
|
if (g:syntastic_mode_map.mode == "passive")
|
|
|
|
SyntasticToggleMode
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
command! -buffer SyntasticToggleOn call s:SyntasticToggleOn()
|
|
|
|
|
|
|
|
"function to disable syntastic and set check_on_open off
|
|
|
|
function s:SyntasticToggleOff()
|
|
|
|
let g:syntastic_check_on_open=0
|
|
|
|
if (g:syntastic_mode_map.mode == "active")
|
|
|
|
SyntasticToggleMode
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
command! -buffer SyntasticToggleOff call s:SyntasticToggleOff()
|
|
|
|
|
|
|
|
"function to toggle syntastic and check_on_open on and off together
|
|
|
|
function s:SyntasticToggleAll()
|
|
|
|
if (g:syntastic_check_on_open == 1)
|
|
|
|
call s:SyntasticToggleOff()
|
|
|
|
else
|
|
|
|
call s:SyntasticToggleOn()
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
command! -buffer SyntasticToggleAll call s:SyntasticToggleAll()
|
2014-04-08 03:39:10 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-10-28 15:33:37 -04:00
|
|
|
"TABULAR: {{{
|
|
|
|
"format markdown tables
|
2014-10-22 03:41:50 -04:00
|
|
|
function! s:TableFormat()
|
2014-10-28 15:33:37 -04:00
|
|
|
let l:pos = getpos('.')
|
|
|
|
normal! {
|
|
|
|
call search('|')
|
|
|
|
normal! j
|
|
|
|
s/[^|]//g
|
|
|
|
Tabularize /|
|
|
|
|
s/ /-/g
|
|
|
|
call setpos('.', l:pos)
|
2014-10-22 03:41:50 -04:00
|
|
|
endfunction
|
|
|
|
command! -buffer TableFormat call s:TableFormat()
|
|
|
|
"}}}
|
|
|
|
|
2014-04-08 03:39:10 -04:00
|
|
|
"TAGBAR: {{{
|
2014-04-09 08:07:12 -04:00
|
|
|
"autostart tagbar when vim opens to a compatible filetype (default: 0)
|
2014-04-08 03:39:10 -04:00
|
|
|
if !exists("g:autostarttagbar")
|
2014-04-08 05:23:42 -04:00
|
|
|
let g:autostarttagbar=0
|
2014-04-08 03:39:10 -04:00
|
|
|
endif
|
2014-04-17 12:35:49 -04:00
|
|
|
if !&diff
|
|
|
|
if (g:autostarttagbar == 1)
|
|
|
|
autocmd VimEnter * nested :call tagbar#autoopen(1)
|
|
|
|
endif
|
2014-04-08 03:39:10 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
let g:tagbar_sort=0
|
2014-04-09 15:39:22 -04:00
|
|
|
let g:tagbar_compact=1
|
2014-04-08 03:39:10 -04:00
|
|
|
let g:tagbar_singleclick=1
|
2014-04-09 15:39:22 -04:00
|
|
|
let g:tagbar_width=35
|
2014-08-26 12:21:04 -04:00
|
|
|
let g:tagbar_autofocus=1
|
2015-03-10 07:27:53 -04:00
|
|
|
|
|
|
|
autocmd FileType tagbar setlocal nocursorcolumn
|
2014-04-08 03:39:10 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-07-22 22:56:22 -04:00
|
|
|
"TCOMMAND: {{{
|
|
|
|
let g:tcommand#include_history=0
|
|
|
|
"}}}
|
|
|
|
|
2014-10-26 21:45:38 -04:00
|
|
|
"TCOMMENT: {{{
|
|
|
|
let g:tcomment#rstrip_on_uncomment=2 "remove right-hand whitespace from all lines on uncomment
|
|
|
|
"}}}
|
|
|
|
|
2014-04-08 03:39:10 -04:00
|
|
|
"VIM FILER: {{{
|
2014-04-09 08:07:12 -04:00
|
|
|
"autostart filer when vim opens to an empty buffer (default: 1)
|
2014-06-04 03:18:29 -04:00
|
|
|
if !exists("g:autostartfiler")|let g:autostartfiler=1|endif
|
2014-04-09 08:07:12 -04:00
|
|
|
if (g:autostartfiler == 1)
|
|
|
|
autocmd VimEnter * if !argc() | VimFiler -quit -project | endif
|
|
|
|
endif
|
|
|
|
|
2014-04-08 03:39:10 -04:00
|
|
|
let g:vimfiler_as_default_explorer=1
|
|
|
|
let g:vimfiler_safe_mode_by_default=0
|
|
|
|
let g:vimfiler_enable_auto_cd=1
|
|
|
|
|
|
|
|
let g:vimfiler_tree_indentation=2
|
|
|
|
let g:vimfiler_explorer_columns='type:time'
|
|
|
|
let g:vimfiler_tree_closed_icon='▸' "['▶', '▼'], ['▸', '▾'], ['▷', '◢']
|
|
|
|
let g:vimfiler_tree_opened_icon='▾'
|
|
|
|
let g:vimfiler_file_icon='-'
|
|
|
|
let g:vimfiler_marked_file_icon='+'
|
|
|
|
|
|
|
|
"edit files by double clicking them, and justify the cursor on the left
|
|
|
|
autocmd FileType vimfiler setlocal nonumber nocursorcolumn
|
|
|
|
|
|
|
|
"load the list of file extensions and handlers if it exists
|
|
|
|
if filereadable(glob("~/.vim/filetypes.vim"))
|
|
|
|
source ~/.vim/filetypes.vim
|
|
|
|
endif
|
2014-04-02 11:17:12 -04:00
|
|
|
"}}}
|
|
|
|
|
2014-04-07 10:04:48 -04:00
|
|
|
"LIGHTLINE: {{{
|
2014-04-02 11:17:12 -04:00
|
|
|
let g:unite_force_overwrite_statusline = 0
|
|
|
|
let g:vimfiler_force_overwrite_statusline = 0
|
|
|
|
|
|
|
|
function! LLModified()
|
2014-12-01 01:55:15 -05:00
|
|
|
return &ft =~ 'help' ? '' : &modified ? '💾 ' : &modifiable ? '' : '-'
|
2014-04-02 11:17:12 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LLReadonly()
|
2014-12-01 00:31:28 -05:00
|
|
|
return &ft !~? 'help' && &readonly ? '🔒' : ''
|
2014-04-02 11:17:12 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LLFilename()
|
|
|
|
let fname = expand('%:t')
|
|
|
|
return
|
|
|
|
\ fname == '__Tagbar__' ? g:lightline.fname :
|
|
|
|
\ fname =~ '__Gundo' ? '' :
|
|
|
|
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
|
|
|
|
\ &ft == 'unite' ? unite#get_status_string() :
|
2014-04-09 14:58:38 -04:00
|
|
|
\ &ft == 'qf' ? '[Error/Location List]' :
|
|
|
|
\ &ft == 'extradite' ? '[Commit History]' :
|
2014-04-02 11:17:12 -04:00
|
|
|
\ ('' != LLReadonly() ? LLReadonly() . ' ' : '') .
|
2014-12-05 10:27:50 -05:00
|
|
|
\ ('' != fname ? fname : '📄') .
|
2014-04-02 11:17:12 -04:00
|
|
|
\ ('' != LLModified() ? ' ' . LLModified() : '')
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LLFugitive()
|
|
|
|
try
|
|
|
|
if expand('%:t') !~? 'Tagbar\|Gundo' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
|
|
|
let mark = '' " edit here for cool mark
|
|
|
|
let _ = fugitive#head()
|
|
|
|
return strlen(_) ? mark._ : ''
|
|
|
|
endif
|
|
|
|
catch
|
|
|
|
endtry
|
|
|
|
return ''
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LLFileformat()
|
|
|
|
return winwidth(0) > 70 ? &fileformat : ''
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LLFiletype()
|
2014-12-01 00:31:28 -05:00
|
|
|
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'none') : ''
|
2014-04-02 11:17:12 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LLFileencoding()
|
|
|
|
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LLMode()
|
|
|
|
let fname = expand('%:t')
|
|
|
|
return fname == '__Tagbar__' ? 'Tagbar' :
|
|
|
|
\ fname == '__Gundo__' ? 'Gundo' :
|
|
|
|
\ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
|
|
|
|
\ &ft == 'unite' ? 'Unite' :
|
|
|
|
\ &ft == 'vimfiler' ? 'VimFiler' :
|
|
|
|
\ winwidth(0) > 60 ? lightline#mode() : ''
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
let g:tagbar_status_func = 'TagbarStatusFunc'
|
|
|
|
function! TagbarStatusFunc(current, sort, fname, ...) abort
|
2014-04-09 15:39:22 -04:00
|
|
|
let g:lightline.fname = 'tags' "a:fname
|
2014-04-02 11:17:12 -04:00
|
|
|
return lightline#statusline(0)
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
augroup AutoSyntastic
|
|
|
|
autocmd!
|
|
|
|
autocmd BufWritePost * call s:syntastic()
|
|
|
|
augroup END
|
|
|
|
|
|
|
|
function! s:syntastic()
|
|
|
|
SyntasticCheck
|
|
|
|
call lightline#update()
|
|
|
|
endfunction
|
|
|
|
|
2014-04-09 08:07:12 -04:00
|
|
|
"status bar config with and without powerline fonts (default: 0)
|
2014-04-05 03:20:53 -04:00
|
|
|
if !exists("g:powerlinefonts")
|
|
|
|
let g:powerlinefonts=0
|
|
|
|
endif
|
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
|
|
|
if (g:powerlinefonts == 1)
|
2014-04-02 11:17:12 -04:00
|
|
|
let g:lightline = {
|
|
|
|
\ 'colorscheme': 'darkcloud',
|
|
|
|
\ 'active': {
|
2014-04-08 03:39:10 -04:00
|
|
|
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['tagbar'] ],
|
2014-04-02 11:17:12 -04:00
|
|
|
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
|
|
|
\ },
|
|
|
|
\ 'component_function': {
|
|
|
|
\ 'fugitive': 'LLFugitive',
|
|
|
|
\ 'filename': 'LLFilename',
|
|
|
|
\ 'fileformat': 'LLFileformat',
|
|
|
|
\ 'filetype': 'LLFiletype',
|
|
|
|
\ 'fileencoding': 'LLFileencoding',
|
|
|
|
\ 'mode': 'LLMode',
|
|
|
|
\ },
|
|
|
|
\ 'component_expand': {
|
|
|
|
\ 'syntastic': 'SyntasticStatuslineFlag',
|
|
|
|
\ },
|
|
|
|
\ 'component_type': {
|
|
|
|
\ 'syntastic': 'error',
|
|
|
|
\ },
|
|
|
|
\ 'separator': {'left': '', 'right': ''},
|
2014-04-08 03:39:10 -04:00
|
|
|
\ 'subseparator': {'left': '', 'right': ''},
|
|
|
|
\ 'component': {
|
|
|
|
\ 'tagbar': '%{tagbar#currenttag("[%s]", "", "f")}',
|
|
|
|
\ },
|
2014-04-02 11:17:12 -04:00
|
|
|
\ }
|
|
|
|
else
|
|
|
|
let g:lightline = {
|
|
|
|
\ 'colorscheme': 'darkcloud',
|
|
|
|
\ 'active': {
|
2014-04-08 03:39:10 -04:00
|
|
|
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['tagbar'] ],
|
2014-04-02 11:17:12 -04:00
|
|
|
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
|
|
|
\ },
|
|
|
|
\ 'component_function': {
|
|
|
|
\ 'fugitive': 'LLFugitive',
|
|
|
|
\ 'filename': 'LLFilename',
|
|
|
|
\ 'fileformat': 'LLFileformat',
|
|
|
|
\ 'filetype': 'LLFiletype',
|
|
|
|
\ 'fileencoding': 'LLFileencoding',
|
|
|
|
\ 'mode': 'LLMode',
|
|
|
|
\ },
|
|
|
|
\ 'component_expand': {
|
|
|
|
\ 'syntastic': 'SyntasticStatuslineFlag',
|
|
|
|
\ },
|
|
|
|
\ 'component_type': {
|
|
|
|
\ 'syntastic': 'error',
|
|
|
|
\ },
|
|
|
|
\ 'separator': {'left': '', 'right': ''},
|
2014-04-08 06:20:29 -04:00
|
|
|
\ 'subseparator': {'left': '|', 'right': '|'},
|
2014-04-08 03:39:10 -04:00
|
|
|
\ 'component': {
|
|
|
|
\ 'tagbar': '%{tagbar#currenttag("[%s]", "", "f")}',
|
2014-12-01 08:46:34 -05:00
|
|
|
\ }
|
2014-04-02 11:17:12 -04:00
|
|
|
\ }
|
|
|
|
endif
|
2014-07-25 10:18:03 -04:00
|
|
|
|
|
|
|
"ligtline theme {{{
|
2014-12-01 00:31:28 -05:00
|
|
|
let s:base0 = '#262626'
|
|
|
|
let s:base1 = '#303030'
|
|
|
|
let s:base2 = '#767676'
|
|
|
|
let s:base3 = '#949494'
|
|
|
|
let s:base4 = '#b2b2b2'
|
|
|
|
let s:base5 = '#c6c6c6'
|
|
|
|
let s:base6 = '#eaeaea'
|
|
|
|
|
|
|
|
let s:rcol = '#d75f5f'
|
|
|
|
let s:ycol = '#ffd787'
|
|
|
|
let s:bcol = '#87d7ff'
|
|
|
|
|
|
|
|
let s:p = {'normal':{},'inactive':{},'insert':{},'replace':{},'visual':{},'tabline':{}}
|
|
|
|
|
|
|
|
let s:p.normal.left = [[ s:bcol,s:base1 ],[ s:base6,s:base0 ]]
|
2014-12-05 10:27:50 -05:00
|
|
|
let s:p.normal.right = [[ s:base4,s:base1 ],[ s:base6,s:base0 ]]
|
2014-12-01 00:31:28 -05:00
|
|
|
let s:p.inactive.left = [[ s:base6,s:base0 ],[ s:base4,s:base1 ]]
|
2014-12-05 10:27:50 -05:00
|
|
|
let s:p.inactive.right = [[ s:base4,s:base1 ],[ s:base6,s:base0 ]]
|
2014-12-01 00:31:28 -05:00
|
|
|
let s:p.insert.left = [[ s:rcol,s:base1 ],[ s:base6,s:base0 ]]
|
|
|
|
let s:p.replace.left = [[ s:base1,s:rcol ],[ s:base6,s:base0 ]]
|
|
|
|
let s:p.visual.left = [[ s:ycol,s:base1 ],[ s:base6,s:base0 ]]
|
|
|
|
|
|
|
|
let s:p.normal.middle = [[ s:base4,s:base1 ]]
|
|
|
|
let s:p.inactive.abmiddle = [[ s:base3,s:base1 ]]
|
|
|
|
let s:p.tabline.left = [[ s:base5,s:base0 ]]
|
|
|
|
let s:p.tabline.tabsel = [[ s:base5,s:base1 ]]
|
|
|
|
let s:p.tabline.middle = [[ s:base0,s:base4 ]]
|
2014-07-25 10:18:03 -04:00
|
|
|
let s:p.tabline.right = copy(s:p.normal.right)
|
2014-12-01 00:31:28 -05:00
|
|
|
let s:p.normal.error = [[ s:rcol,s:base1 ]]
|
|
|
|
let s:p.normal.warning = [[ s:ycol,s:base1 ]]
|
|
|
|
|
2014-07-25 10:18:03 -04:00
|
|
|
let g:lightline#colorscheme#darkcloud#palette = lightline#colorscheme#fill(s:p)
|
|
|
|
"}}}
|
2014-04-02 11:17:12 -04:00
|
|
|
"}}}
|