Merge remote-tracking branch 'Jidbo/master'

This commit is contained in:
saibotk 2019-04-03 16:44:32 +02:00
commit 746c93f4f3
2 changed files with 99 additions and 17 deletions

View file

@ -3,6 +3,6 @@ setlocal colorcolumn=0
setlocal linebreak
setlocal number
setlocal shiftwidth=4
setlocal spell
setlocal tabstop=4
setlocal wrap
setlocal nospell

114
.vimrc
View file

@ -57,9 +57,6 @@ Plugin 'sheerun/vim-polyglot'
" latex
Plugin 'lervag/vimtex'
" promela syntax highlighting
Plugin 'vim-scripts/promela.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
@ -80,6 +77,7 @@ set scrolloff=1
set wildmenu
set term=screen-256color
set autoread
set lazyredraw
" tabs and line wrap
set tabstop=4
@ -105,12 +103,6 @@ set nowritebackup
set splitbelow
set splitright
"split navigations
nnoremap <leader>j <C-W><C-J>
nnoremap <leader>k <C-W><C-K>
nnoremap <leader>l <C-W><C-L>
nnoremap <leader>h <C-W><C-H>
" tabs
nnoremap <leader>t :tabnew<CR>
nnoremap <C-n> gT
@ -123,15 +115,22 @@ set foldlevel=99
" remap code folding
nnoremap <leader>g za
" auto reload .vimrc on write
autocmd BufWritePost .vimrc source %
" toggle hybrid number mode
nnoremap <leader>h :set rnu!<CR>
:augroup numbertoggle
: autocmd!
: autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
: autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
:augroup END
" disable arrow keys
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>
" html css js indents
au BufNewFile,BufRead *.js, *.html, *.css
@ -139,6 +138,79 @@ au BufNewFile,BufRead *.js, *.html, *.css
\ set softtabstop=4 |
\ set shiftwidth=4
" Delete buffer while keeping window layout (don't close buffer's windows).
" Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165
if v:version < 700 || exists('loaded_bclose') || &cp
finish
endif
let loaded_bclose = 1
if !exists('bclose_multiple')
let bclose_multiple = 1
endif
" Display an error message.
function! s:Warn(msg)
echohl ErrorMsg
echomsg a:msg
echohl NONE
endfunction
" Command ':Bclose' executes ':bd' to delete buffer in current window.
" The window will show the alternate buffer (Ctrl-^) if it exists,
" or the previous buffer (:bp), or a blank buffer if no previous.
" Command ':Bclose!' is the same, but executes ':bd!' (discard changes).
" An optional argument can specify which buffer to close (name or number).
function! s:Bclose(bang, buffer)
if empty(a:buffer)
let btarget = bufnr('%')
elseif a:buffer =~ '^\d\+$'
let btarget = bufnr(str2nr(a:buffer))
else
let btarget = bufnr(a:buffer)
endif
if btarget < 0
call s:Warn('No matching buffer for '.a:buffer)
return
endif
if empty(a:bang) && getbufvar(btarget, '&modified')
call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)')
return
endif
" Numbers of windows that view target buffer which we will delete.
let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget')
if !g:bclose_multiple && len(wnums) > 1
call s:Warn('Buffer is in multiple windows (use ":let bclose_multiple=1")')
return
endif
let wcurrent = winnr()
for w in wnums
execute w.'wincmd w'
let prevbuf = bufnr('#')
if prevbuf > 0 && buflisted(prevbuf) && prevbuf != btarget
buffer #
else
bprevious
endif
if btarget == bufnr('%')
" Numbers of listed buffers which are not the target to be deleted.
let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget')
" Listed, not target, and not displayed.
let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
" Take the first buffer, if any (could be more intelligent).
let bjump = (bhidden + blisted + [-1])[0]
if bjump > 0
execute 'buffer '.bjump
else
execute 'enew'.a:bang
endif
endif
endfor
execute 'bdelete'.a:bang.' '.btarget
execute wcurrent.'wincmd w'
endfunction
command! -bang -complete=buffer -nargs=? Bclose call <SID>Bclose(<q-bang>, <q-args>)
nnoremap <silent> <Leader>bd :Bclose<CR>
" PLUGIN SETTINGS
" polyglot setup
let g:polyglot_disabled = ["latex"]
@ -146,12 +218,21 @@ let g:polyglot_disabled = ["latex"]
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
map <leader>e :NERDTreeToggle<CR>
" airline setup
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
" AIRLINE SETUP
" sections
let g:airline_section_y = ""
let g:airline_section_z = "%l/%L:%c"
let g:airline_section_b = "%{airline#util#wrap(airline#extensions#branch#get_head(),0)}"
" other stuff
let g:airline_theme='solarized'
let g:airline_solarized_bg='dark'
let g:airline_powerline_fonts = 1
let g:airline_inactive_collapse=1
let g:airline_skip_empty_sections = 1
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#wordcount#enabled = 0
let g:airline#extensions#keymap#enabled = 0
set ttimeoutlen=50
" gitgutter setup
let g:gitgutter_sign_added = '∙'
@ -182,3 +263,4 @@ nmap <Leader>r :ALEFindReferences<CR>
nmap <Leader>b :ALEFix<CR>
nnoremap <space>l :lnext<CR>
nnoremap <space>p :lprevious<CR>