1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:50:04 +08:00
SpaceVim/config/neovim.vim

68 lines
2.1 KiB
VimL
Raw Normal View History

2016-12-26 21:11:19 +08:00
function! s:GetVisual()
let [lnum1, col1] = getpos("'<")[1:2]
let [lnum2, col2] = getpos("'>")[1:2]
let lines = getline(lnum1, lnum2)
let lines[-1] = lines[-1][:col2 - 2]
let lines[0] = lines[0][col1 - 1:]
return lines
endfunction
function! REPLSend(lines)
call jobsend(g:last_terminal_job_id, add(a:lines, ''))
endfunction
" }}}
" Commands {{{
" REPL integration {{{
command! -range=% REPLSendSelection call REPLSend(s:GetVisual())
command! REPLSendLine call REPLSend([getline('.')])
" }}}
2017-03-26 16:37:49 +08:00
let $NVIM_TUI_ENABLE_CURSOR_SHAPE = g:spacevim_terminal_cursor_shape
2016-12-26 21:11:19 +08:00
"silent! let &t_SI = "\<Esc>]50;CursorShape=1\x7"
"silent! let &t_SR = "\<Esc>]50;CursorShape=2\x7"
"silent! let &t_EI = "\<Esc>]50;CursorShape=0\x7"
" dark0 + gray
2017-02-27 23:40:55 +08:00
let g:terminal_color_0 = '#282828'
let g:terminal_color_8 = '#928374'
2016-12-26 21:11:19 +08:00
" neurtral_red + bright_red
2017-02-27 23:40:55 +08:00
let g:terminal_color_1 = '#cc241d'
let g:terminal_color_9 = '#fb4934'
2016-12-26 21:11:19 +08:00
" neutral_green + bright_green
2017-02-27 23:40:55 +08:00
let g:terminal_color_2 = '#98971a'
let g:terminal_color_10 = '#b8bb26'
2016-12-26 21:11:19 +08:00
" neutral_yellow + bright_yellow
2017-02-27 23:40:55 +08:00
let g:terminal_color_3 = '#d79921'
let g:terminal_color_11 = '#fabd2f'
2016-12-26 21:11:19 +08:00
" neutral_blue + bright_blue
2017-02-27 23:40:55 +08:00
let g:terminal_color_4 = '#458588'
let g:terminal_color_12 = '#83a598'
2016-12-26 21:11:19 +08:00
" neutral_purple + bright_purple
2017-02-27 23:40:55 +08:00
let g:terminal_color_5 = '#b16286'
let g:terminal_color_13 = '#d3869b'
2016-12-26 21:11:19 +08:00
" neutral_aqua + faded_aqua
2017-02-27 23:40:55 +08:00
let g:terminal_color_6 = '#689d6a'
let g:terminal_color_14 = '#8ec07c'
2016-12-26 21:11:19 +08:00
" light4 + light1
2017-02-27 23:40:55 +08:00
let g:terminal_color_7 = '#a89984'
let g:terminal_color_15 = '#ebdbb2'
2016-12-26 21:11:19 +08:00
augroup Terminal
au!
au TermOpen * let g:last_terminal_job_id = b:terminal_job_id | IndentLinesDisable
au BufWinEnter term://* startinsert | IndentLinesDisable
2017-04-11 22:47:49 +08:00
if has('timers')
au TermClose * let g:_spacevim_termclose_abuf = expand('<abuf>') | call timer_start(5, 'SpaceVim#mapping#close_term_buffer')
else
au TermClose * let g:_spacevim_termclose_abuf = expand('<abuf>') | call SpaceVim#mapping#close_term_buffer()
endif
2016-12-26 21:11:19 +08:00
augroup END
augroup nvimrc_aucmd
autocmd!
autocmd CursorHold,FocusGained,FocusLost * rshada|wshada
augroup END