You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
6.9 KiB
VimL
186 lines
6.9 KiB
VimL
set t_ut=''
|
|
let s:is_color = &t_Co >= 256
|
|
set hidden
|
|
set splitbelow
|
|
set splitright
|
|
set nowrap
|
|
set backspace=indent,eol,start
|
|
let s:is_nerd_font = $VIM_GLYPHS ==? 'nerd-font'
|
|
let &listchars = s:is_nerd_font ? "tab: ,precedes:\uf63c,extends:\uf63d" :
|
|
\ "tab: ,precedes:\u00ab,extends:\u00bb"
|
|
set list
|
|
let &fillchars = "vert:\u2502,fold: ,diff:\u00b7"
|
|
let &colorcolumn = join(range(80, 99), ',')
|
|
if s:is_color
|
|
autocmd ColorScheme * highlight ColorColumn ctermbg=black
|
|
autocmd ColorScheme * highlight error cterm=none ctermbg=darkred
|
|
\ ctermfg=black
|
|
autocmd ColorScheme * highlight InvalidWhitespace ctermbg=black
|
|
autocmd ColorScheme * highlight LineNr ctermfg=darkgray
|
|
autocmd ColorScheme * highlight Pmenu ctermbg=darkblue ctermfg=black
|
|
autocmd ColorScheme * highlight PmenuSel ctermbg=lightgray ctermfg=black
|
|
autocmd ColorScheme * highlight Search ctermbg=darkblue ctermfg=black
|
|
autocmd ColorScheme * highlight SignColumn ctermbg=none ctermfg=darkblue
|
|
autocmd ColorScheme * highlight SpellBad ctermbg=darkmagenta
|
|
\ ctermfg=black
|
|
autocmd ColorScheme * highlight SpellCap ctermbg=darkmagenta
|
|
\ ctermfg=black
|
|
autocmd ColorScheme * highlight StatusLine cterm=bold ctermbg=black
|
|
\ ctermfg=lightgray
|
|
autocmd ColorScheme * highlight StatusLineNC cterm=none ctermbg=black
|
|
\ ctermfg=none
|
|
autocmd ColorScheme * highlight SyntasticError ctermbg=darkred
|
|
\ ctermfg=black
|
|
autocmd ColorScheme * highlight SyntasticErrorSign ctermfg=darkred
|
|
autocmd ColorScheme * highlight SyntasticWarning ctermbg=darkyellow
|
|
\ ctermfg=black
|
|
autocmd ColorScheme * highlight SyntasticWarningSign ctermfg=darkyellow
|
|
autocmd ColorScheme * highlight todo ctermbg=none ctermfg=darkyellow
|
|
autocmd ColorScheme * highlight VertSplit cterm=none ctermfg=black
|
|
autocmd ColorScheme * highlight Visual cterm=none ctermbg=darkgray
|
|
colorscheme peachpuff
|
|
else
|
|
autocmd ColorScheme * highlight VertSplit term=none
|
|
colorscheme default
|
|
endif
|
|
|
|
function s:DefaultMatches()
|
|
call clearmatches()
|
|
if s:is_color && !&previewwindow && index(['netrw', 'qf'], &filetype) < 0
|
|
if &expandtab
|
|
call matchadd('InvalidWhitespace', '\t')
|
|
else
|
|
call matchadd('InvalidWhitespace', '^ \+')
|
|
endif
|
|
call matchadd('InvalidWhitespace', '\s\+$')
|
|
endif
|
|
endfunction
|
|
|
|
autocmd ColorScheme,BufWinEnter,FileType,TabEnter,WinEnter * call s:DefaultMatches()
|
|
autocmd BufWinLeave,TabLeave * call clearmatches()
|
|
|
|
function s:TabIndent(...)
|
|
set noexpandtab
|
|
let space_count = a:0 >= 1 ? a:1 : 8
|
|
let &tabstop = space_count
|
|
let &shiftwidth = space_count
|
|
set softtabstop=0
|
|
call s:DefaultMatches()
|
|
endfunction
|
|
|
|
function s:SpacesIndent(...)
|
|
set expandtab
|
|
let space_count = a:0 >= 1 ? a:1 : 4
|
|
let &tabstop = space_count
|
|
let &shiftwidth = space_count
|
|
let &softtabstop = space_count
|
|
call s:DefaultMatches()
|
|
endfunction
|
|
|
|
command -nargs=? TabIndent :call s:TabIndent(<f-args>)
|
|
command -nargs=? SpacesIndent :call s:SpacesIndent(<f-args>)
|
|
call s:SpacesIndent()
|
|
if s:is_color
|
|
syntax on
|
|
endif
|
|
|
|
let airline_theme = s:is_color ? 'powerlineish' : 'monochrome'
|
|
let airline_detect_spelllang = 0
|
|
let airline#extensions#tabline#enabled = 1
|
|
let airline_symbols = {}
|
|
if s:is_nerd_font
|
|
if s:is_color
|
|
let airline_powerline_fonts = 1
|
|
else
|
|
let airline_left_alt_sep = "\ue0b1"
|
|
let airline_right_alt_sep = "\ue0b3"
|
|
let airline#extensions#tabline#left_alt_sep = "\ue0b1"
|
|
let airline#extensions#tabline#right_alt_sep = "\ue0b3"
|
|
endif
|
|
let airline_section_z = "\uf13a %l/%L \uf138 %c"
|
|
let airline_symbols.crypt = "\uf805 "
|
|
let airline_symbols.paste = "\uf691"
|
|
let airline_symbols.spell = "A\uf62b"
|
|
let airline_symbols.branch = "\uf418"
|
|
let airline_symbols.readonly = "\uf023 "
|
|
let airline_symbols.whitespace = "\uf038"
|
|
let syntastic_error_symbol = "\ue231 "
|
|
let syntastic_warning_symbol = "\uf071 "
|
|
let syntastic_style_error_symbol = "\ue245 "
|
|
let syntastic_style_warning_symbol = "\ue245 "
|
|
else
|
|
let airline_left_alt_sep = "\u2502"
|
|
let airline_right_alt_sep = "\u2502"
|
|
let airline#extensions#tabline#left_alt_sep = "\u2502"
|
|
let airline#extensions#tabline#right_alt_sep = "\u2502"
|
|
let airline_section_z = "\u2193%l/%L \u2192%c"
|
|
let airline_symbols.crypt = 'CRYPT'
|
|
let airline_symbols.spell = "A\u221a"
|
|
let airline_symbols.branch = ''
|
|
let airline_symbols.readonly = 'ro'
|
|
let airline_symbols.whitespace = ''
|
|
let syntastic_error_symbol = "!\u2192"
|
|
let syntastic_warning_symbol = "!\u2192"
|
|
let syntastic_style_error_symbol = " \u2192"
|
|
let syntastic_style_warning_symbol = " \u2192"
|
|
endif
|
|
let airline_symbols.modified = "\u2022"
|
|
let airline_symbols.notexists = "\u2022"
|
|
let airline_symbols.linenr = ''
|
|
let airline_symbols.maxlinenr = ''
|
|
let airline#extensions#tabline#show_tabs = 0
|
|
let airline#extensions#tabline#show_tab_type = 0
|
|
let airline#extensions#tabline#buffer_nr_show = 1
|
|
let airline#extensions#tabline#buffer_nr_format = "%u "
|
|
let airline#extensions#tabline#formatter = 'unique_tail_improved'
|
|
let airline#extensions#tabline#overflow_marker = "\u2026"
|
|
let airline#extensions#tabline#tab_nr_type = 1
|
|
let airline#extensions#tabline#show_close_button = 0
|
|
let airline#extensions#wordcount#enabled = 0
|
|
let localvimrc_persistent = 2
|
|
let localvimrc_persistence_file = $HOME . '/.local-vimrc'
|
|
let localvimrc_sandbox = 0
|
|
let netrw_banner = 0
|
|
let ycm_autoclose_preview_window_after_insertion = 1
|
|
let ycm_auto_hover = ''
|
|
|
|
set timeoutlen=2000
|
|
autocmd InsertEnter * set timeoutlen=500
|
|
autocmd InsertLeave * set timeoutlen=2000
|
|
inoremap jj <Esc>
|
|
|
|
function s:SockHop(...)
|
|
let args = ''
|
|
if a:0
|
|
let args = ' ' . join(a:000)
|
|
endif
|
|
call system('sockhop' . args)
|
|
endfunction
|
|
|
|
function s:SockHopMake(...)
|
|
let cmd = 'make "$@"'
|
|
if a:0
|
|
let cmd = cmd . ' ' . join(a:000)
|
|
endif
|
|
call system("sockhop .make.sock '" . cmd . "'")
|
|
endfunction
|
|
|
|
command -nargs=? SockHop :call s:SockHop(<f-args>)
|
|
command -nargs=? SockHopMake :call s:SockHopMake(<f-args>)
|
|
|
|
nnoremap <silent> <Leader>aa :Ack! -Qw <cword><CR>
|
|
nnoremap <silent> <Leader>ac :Ack! -Qw -t cc <cword><CR>
|
|
nnoremap <silent> <Leader>cc :YcmCompleter GoTo<CR>
|
|
nnoremap <silent> <Leader>cd :YcmDiags<CR>
|
|
nnoremap <silent> <Leader>cf :YcmCompleter FixIt<CR>
|
|
nnoremap <silent> <Leader>ch :YcmCompleter GetDoc<CR>
|
|
nnoremap <silent> <Leader>cr :YcmForceCompileAndDiagnostics<CR>
|
|
nnoremap <silent> <Leader>cs :YcmShowDetailedDiagnostic<CR>
|
|
nnoremap <silent> <Leader>ct :YcmCompleter GetType<CR>
|
|
nnoremap <silent> <Leader>mc :SockHopMake clean<CR>
|
|
nnoremap <silent> <Leader>mm :SockHopMake develop<CR>
|
|
nnoremap <silent> <Leader>mr :SockHopMake run<CR>
|
|
nnoremap <silent> <Leader>r :SockHop .run.sock '"$@"'<CR>
|
|
nnoremap <silent> <Leader>u :SockHop .arduino.sock 'arduino-cli upload'<CR>
|
|
nnoremap <silent> <Leader>v :SockHop .arduino.sock 'arduino-cli compile'<CR>
|