nvim-old
This commit is contained in:
parent
dbba54cfd8
commit
6380f390ea
26 changed files with 2704 additions and 0 deletions
50
nvim-old/config/functions.vim
Normal file
50
nvim-old/config/functions.vim
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
"function! TmuxSplitEvenHorizontal()
|
||||
"let filepath = expand('%:p')
|
||||
"if !empty(filepath)
|
||||
"let tmux_command = "tmux split-window -h -c '#{pane_current_path}' 'nvim ".filepath."' && tmux select-layout even-horizontal"
|
||||
"call system(tmux_command)
|
||||
"endif
|
||||
"endfunction
|
||||
|
||||
function! TmuxSplitEvenHorizontal()
|
||||
let filepath = expand('%:p')
|
||||
if !empty(filepath)
|
||||
let tmux_command = "tmux split-window -h -c '".expand('%:p:h')."' && tmux send-keys -t '.tmux.active-pane' 'nvim ".shellescape(filepath)."' Enter && tmux select-layout even-horizontal"
|
||||
call system(tmux_command)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nnoremap <leader>th :call TmuxSplitEvenHorizontal()<CR>
|
||||
|
||||
function! ToggleRelAbsNumbers()
|
||||
set relativenumber
|
||||
set number
|
||||
else
|
||||
set norelativenumber
|
||||
set nonumber
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
" Functions and autocmds to run whenever changing colorschemes
|
||||
function! TransparentBackground()
|
||||
highlight Normal guibg=NONE ctermbg=NONE
|
||||
highlight LineNr guibg=NONE ctermbg=NONE
|
||||
set fillchars+=vert:\│
|
||||
highlight VertSplit gui=NONE guibg=NONE guifg=#444444 cterm=NONE ctermbg=NONE ctermfg=gray
|
||||
endfunction
|
||||
|
||||
autocmd ColorScheme * call TransparentBackground() " uncomment if you are using a translucent terminal and you want nvim to use that
|
||||
|
||||
|
||||
function! ToggleLineNumbers()
|
||||
if &relativenumber
|
||||
set norelativenumber
|
||||
set number
|
||||
else
|
||||
set relativenumber
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nnoremap <leader><leader>n :call ToggleLineNumbers()<CR>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue