2018-12-02 21:31:01 +00:00
" ●
2017-09-10 20:22:02 +00:00
2019-02-18 20:52:37 +00:00
if &shell = ~ # 'fish$'
set shell = bash
endif
2018-12-13 17:25:45 +00:00
" #plugins {{{
2019-04-09 21:47:08 +00:00
if has ( 'nvim' )
2019-04-20 10:56:33 +00:00
if empty ( glob ( '~/.config/nvim/autoload/plug.vim' ) ) "{{{
silent ! curl - fLo ~ /.config/ nvim /autoload/ plug .vim - - create - dirs
\ https :// raw .githubusercontent .com /junegunn/ vim - plug /master/ plug .vim
autocmd VimEnter * PlugInstall - - sync | source $MYVIMRC
endif
2018-12-02 21:31:01 +00:00
"}}}
2019-04-20 10:56:33 +00:00
call plug #begin ( '~/.vim/bundle' )
2019-09-12 17:35:01 +00:00
source ~ /.config/ nvim /init .plugins .vim
2019-08-17 13:12:35 +00:00
"
2019-04-20 10:56:33 +00:00
else
if empty ( glob ( '~/.vim/autoload/plug.vim' ) ) "{{{
silent ! curl - fLo ~ /.vim/ autoload /plug .vim - - create - dirs
\ https :// raw .githubusercontent .com /junegunn/ vim - plug /master/ plug .vim
autocmd VimEnter * PlugInstall - - sync | source $MYVIMRC
endif
2018-12-02 21:31:01 +00:00
"}}}
2019-04-20 10:56:33 +00:00
call plug #begin ( '~/.config/nvim/bundle' )
2019-09-12 17:35:01 +00:00
source ~ /.config/ vim /vimrc .plugins .vim
2018-12-12 21:18:10 +00:00
endif
2019-09-12 17:35:01 +00:00
source ~ /.config/ vim /vimrc .plugins .shared
2019-04-09 21:47:08 +00:00
call plug #end ( )
2018-11-04 16:15:18 +00:00
runtime macros /matchit .vim
2019-04-09 21:47:08 +00:00
2018-11-05 20:12:38 +00:00
"----------------------------------------------------------------------------}}}
2018-09-25 13:54:09 +00:00
" #functions {{{
2018-11-01 09:56:40 +00:00
2018-09-25 14:24:27 +00:00
function ! MyFoldText ( ) "{{{
2018-10-04 18:33:32 +00:00
if ! exists ( 'g:foldtext_column' )
let g :foldtext_column = 80 " column to right align foldtext with
endif
if ! exists ( 'b:foldtext_column' )
let b :foldtext_column = g :foldtext_column " column to right align foldtext with
endif
if ! exists ( 'g:foldtext_maxcolumn' )
let g :foldtext_maxcolumn = 120
endif
2018-09-25 13:54:09 +00:00
2018-10-10 08:31:33 +00:00
let l :linecount = v :foldend - v :foldstart
2018-09-25 15:30:12 +00:00
" don't display foldmarker braces
2018-11-04 17:48:13 +00:00
" put one of the braces in brackets so vim doesn't treat
" it as an actual fold marker
let l :line = substitute ( getline ( v :foldstart ) , '"\?{\({\){' , '' , '' )
2018-09-25 15:30:12 +00:00
" don't display vim comment quotation marks
2018-12-03 23:44:36 +00:00
" TODO other comment markers
2018-10-04 18:33:32 +00:00
let l :line = substitute ( l :line , "\^\"\\s\\?" , '' , '' )
2018-09-25 13:54:09 +00:00
2018-11-17 16:44:28 +00:00
" let l:postfix = l:linecount . ' ' . substitute(v:folddashes, '-', '•', 'g')
let l :postfix = l :linecount . ' ' . substitute ( v :folddashes , '-' , '↓' , 'g' )
2018-10-14 12:21:10 +00:00
while strchars ( l :postfix ) < 7
2018-09-25 13:54:09 +00:00
let l :postfix = ' ' . l :postfix
endwhile
2018-11-17 16:44:28 +00:00
" let l:postfix = ' ↓ ' . l:postfix
2018-09-25 13:54:09 +00:00
let l :len_line = len ( l :line )
2018-09-25 15:30:12 +00:00
let l :len_postfix = strchars ( l :postfix )
2018-09-25 13:54:09 +00:00
2018-10-04 18:33:32 +00:00
if l :len_line + l :len_postfix < = b :foldtext_column
let l :padding = ' ' [l :len_line + l :len_postfix + 0 :b :foldtext_column - 1 ]
2018-09-25 13:54:09 +00:00
let l :foldtext = l :line . l :padding . l :postfix
else
2018-10-10 08:59:22 +00:00
let l :sniptext = ' ⋯'
2018-10-04 18:33:32 +00:00
let l :foldtext = l :line [:b :foldtext_column - 1 - strchars ( l :sniptext ) - l :len_postfix ] . l :sniptext . l :postfix
2018-09-25 13:54:09 +00:00
endif
return l :foldtext
2018-11-05 20:12:38 +00:00
endfunction
2018-09-25 13:54:09 +00:00
2018-11-05 20:12:38 +00:00
"}}}
2018-11-23 20:25:08 +00:00
function ! < SID > SynStack ( ) "{{{
if ! exists ( '*synstack' )
return
endif
2018-11-23 21:45:55 +00:00
echo map ( synstack ( line ( '.' ) , col ( '.' ) ) , 'synIDattr(v:val,"name")' ) '-> ' . synIDattr ( synIDtrans ( synID ( line ( '.' ) , col ( '.' ) , 1 ) ) , 'name' )
2018-11-23 20:25:08 +00:00
endfunc
nmap < space > pp :call < SID > SynStack ( ) < CR >
2018-11-05 20:12:38 +00:00
"}}}
2018-09-25 13:54:09 +00:00
2018-10-04 18:33:32 +00:00
function ! s :RunShellCommand ( cmdline ) abort "{{{
2018-09-25 13:54:09 +00:00
" Shell command
" http://vim.wikia.com/wiki/VimTip1599
2018-11-23 11:14:42 +00:00
let l :expanded_cmdline = a :cmdline
2018-09-25 13:54:09 +00:00
for l :part in split ( a :cmdline , ' ' )
if l :part [0 ] = ~ '\v[%#<]'
let l :expanded_part = fnameescape ( expand ( l :part ) )
let l :expanded_cmdline = substitute ( l :expanded_cmdline , l :part , l :expanded_part , '' )
endif
endfor
if g :shell_scratch_buffer_nr > -1
let l :win_nr = bufwinnr ( g :shell_scratch_buffer_nr )
if l :win_nr < 0
execute 'bdelete' g :shell_scratch_buffer_nr
top new
let g :shell_scratch_buffer_nr = bufnr ( '%' )
else
execute l :win_nr . ' wincmd w'
setlocal modifiable
%delete _
endif
else
top new
let g :shell_scratch_buffer_nr = bufnr ( '%' )
endif
setlocal buftype = nofile bufhidden = wipe nobuflisted noswapfile nowrap
2018-11-23 11:14:42 +00:00
nnoremap < buffer > q :bdelete < CR >
2018-09-25 13:54:09 +00:00
augroup ResetShellBufferNr
autocmd ! * < buffer >
autocmd BufUnload < buffer > let g :shell_scratch_buffer_nr = -1
augroup END
" call setline(1, 'You entered: ' . a:cmdline)
" call setline(2, 'Expanded Form: ' .l:expanded_cmdline)
" call setline(3,substitute(getline(2),'.','=','g'))
execute '$read !' . l :expanded_cmdline
1
setlocal nomodifiable
if ! exists ( 'b:shell_line_count' )
let b :shell_line_count = line ( '$' )
if b :shell_line_count > 25
let b :shell_line_count = 20
endif
execute 'resize' b :shell_line_count + 1
endif
wincmd p
endfunction
command ! - complete = shellcmd - nargs = + Shell call s :RunShellCommand ( < q - args > )
let g :shell_scratch_buffer_nr = -1
2018-11-05 20:12:38 +00:00
"}}}
2018-10-04 18:33:32 +00:00
function ! SaveAndExecute ( ex_command ) abort "{{{
2018-09-25 13:54:09 +00:00
" https://stackoverflow.com/a/40195855
" ex_command: command to run to execute file
" SOURCE [reusable window]: https://github.com/fatih/vim-go/blob/master/autoload/go/ui.vim
" save and reload current file
2018-10-04 18:33:32 +00:00
silent execute 'update | edit'
2018-09-25 13:54:09 +00:00
" get file path of current file
2018-10-04 18:33:32 +00:00
let s :current_buffer_file_path = expand ( '%' )
2018-09-25 13:54:09 +00:00
2018-10-04 18:33:32 +00:00
let s :output_buffer_name = 'Output'
let s :output_buffer_filetype = 'output'
2018-09-25 13:54:09 +00:00
" reuse existing buffer window if it exists otherwise create a new one
2018-10-04 18:33:32 +00:00
if ! exists ( 'c:buf_nr' ) | | ! bufexists ( s :buf_nr ) | | bufwinnr ( s :buf_nr ) = = -1
2018-09-25 13:54:09 +00:00
silent execute 'top new ' . s :output_buffer_name
let s :buf_nr = bufnr ( '%' )
elseif bufwinnr ( s :buf_nr ) ! = bufwinnr ( '%' )
silent execute bufwinnr ( s :buf_nr ) . 'wincmd w'
endif
2018-10-04 18:33:32 +00:00
silent execute 'setlocal filetype=' . s :output_buffer_filetype
2018-09-25 13:54:09 +00:00
setlocal bufhidden = delete
setlocal buftype = nofile
setlocal noswapfile
setlocal nobuflisted
setlocal winfixheight
setlocal cursorline " make it easy to distinguish
2019-09-12 17:35:01 +00:00
" setlocal nonumber
" setlocal norelativenumber
2018-09-25 13:54:09 +00:00
setlocal showbreak = ""
nnoremap < silent > < buffer > q :bdelete ! < CR > '.zz
" clear the buffer
setlocal noreadonly
" setlocal modifiable
%delete _
" add the console output
silent execute '.!' . a :ex_command . ' ' . shellescape ( s :current_buffer_file_path , 1 )
" resize window to content length
" Note: This is annoying because if you print a lot of lines then your code buffer is forced to a height of one line every time you run this function.
" However without this line the buffer starts off as a default size and if you resize the buffer then it keeps that custom size after repeated runs of this function.
" But if you close the output buffer then it returns to using the default size when its recreated
"execute 'resize' . line('$')
" make the buffer non modifiable
setlocal readonly
" setlocal nomodifiable
endfunction
2018-10-21 08:25:46 +00:00
2018-11-05 20:12:38 +00:00
"}}}
2018-11-01 09:56:40 +00:00
function ! JsIncludeExpr ( file ) "{{{
2018-10-21 08:25:46 +00:00
" substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
return substitute ( substitute ( a :file , '^[\\~@]\/' , './' , '' ) , '^[\\~@]' , './node_modules/' , '' )
2018-11-05 20:12:38 +00:00
endfunction
2018-11-01 09:56:40 +00:00
2018-11-27 21:57:06 +00:00
"}}}
function ! Redir ( cmd ) "{{{
for win in range ( 1 , winnr ( '$' ) )
if getwinvar ( win , 'scratch' )
execute win . 'windo close'
endif
endfor
if a :cmd = ~ '^!'
let output = system ( matchstr ( a :cmd , '^!\zs.*' ) )
else
redir = > output
execute a :cmd
redir END
endif
vnew
let w :scratch = 1
setlocal buftype = nofile bufhidden = wipe nobuflisted noswapfile
call setline ( 1 , split ( output , "\n" ) )
endfunction
command ! - nargs = 1 - complete = command Redir silent call Redir ( < q - args > )
" Usage:
" :Redir hi ............. show the full output of command ':hi' in a scratch window
" :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window
2018-09-25 13:54:09 +00:00
"}}}
2018-11-05 20:12:38 +00:00
"----------------------------------------------------------------------------}}}
2018-11-17 20:22:58 +00:00
"#commands{{{
2018-11-21 14:28:03 +00:00
" TrimWhitespace{{{
2018-11-17 20:22:58 +00:00
command ! - range = % TrimWhitespace let b :wv = winsaveview ( ) |
\ keeppattern < line1 > , < line2 > s /\s\+$/ / |
\ call winrestview ( b :wv )
2018-11-21 14:28:03 +00:00
"}}}
" Scratch, ScratchVertical{{{
2018-11-21 14:25:30 +00:00
command ! Scratch new | setlocal buftype = nofile | setlocal bufhidden = hide | setlocal noswapfile
command ! ScratchVertical vnew | setlocal buftype = nofile | setlocal bufhidden = hide | setlocal noswapfile
2018-11-21 14:28:03 +00:00
"}}}
2018-11-17 20:22:58 +00:00
"}}}
2018-12-13 17:25:45 +00:00
" #settings {{{
2018-09-25 13:54:09 +00:00
scriptencoding utf -8
syntax on
2019-09-13 14:27:55 +00:00
set fillchars = stl :\ , stlnc :\ , vert :\| , fold :\
2018-09-25 13:54:09 +00:00
set guioptions - = mTrLb
set guioptions + = c
2019-08-08 21:35:45 +00:00
if exists ( '+termguicolors' )
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
2019-08-08 22:04:44 +00:00
colorscheme monotonous - dark
2018-09-25 13:54:09 +00:00
set updatetime = 100
2018-10-17 06:58:24 +00:00
set timeoutlen = 500
2018-11-01 21:53:04 +00:00
set lazyredraw
2018-09-25 13:54:09 +00:00
2018-12-02 21:31:01 +00:00
" the ;/home/ray tells vim to stop searching at /home/ray
set tags + = ./.tags,.tags,./ tags - py , .tags - py ;/home/ ray /
2018-09-25 13:54:09 +00:00
" persisitent undo file
set undofile
2019-08-08 22:42:57 +00:00
set undodir = ~ /.vim/ .vimtmp
set backupdir = ~ /.vim/ .vimtmp
set directory = ~ /.vim/ .vimtmp
2018-09-25 13:54:09 +00:00
2018-10-10 08:31:33 +00:00
set viewoptions - = options
2018-09-25 13:54:09 +00:00
set ignorecase
set smartcase
set wildmenu
set wildmode = longest :full , full
2018-10-08 18:28:02 +00:00
set wildignore + = /node_modules/ , dist /
2018-09-25 13:54:09 +00:00
2018-11-02 20:25:06 +00:00
" Use ag over grep
if executable ( 'ag' )
set grepprg = ag \ - - nogroup \ - - nocolor \ - - ignore \ node_modules
endif
2018-09-25 13:54:09 +00:00
set hidden
set hlsearch
2019-02-09 22:15:36 +00:00
set completeopt = menuone
2018-09-25 13:54:09 +00:00
set nospell
set spelllang = en_gb
2018-11-25 19:32:05 +00:00
set diffopt + = vertical
2019-09-18 13:28:58 +00:00
set rnu nu
2018-09-25 13:54:09 +00:00
set tabstop = 8
set softtabstop = 2
set shiftwidth = 2
set shiftround
set expandtab
set autoindent
2020-02-06 14:54:37 +00:00
set textwidth = 120
2018-09-25 13:54:09 +00:00
set formatoptions = cq
set wrapmargin = 0
2018-11-01 09:56:40 +00:00
set cursorline
set foldcolumn = 2
2018-12-12 09:09:04 +00:00
if has ( 'patch-7-4-2201' )
set signcolumn = yes
endif
2018-10-04 18:33:32 +00:00
set colorcolumn = 80 , 120
2018-09-25 13:54:09 +00:00
set iskeyword + = -
set scrolloff = 10
set showcmd
set incsearch
set laststatus = 2
set shortmess = aoOT
2018-10-04 18:33:32 +00:00
set cmdheight = 3
2018-09-25 13:54:09 +00:00
2019-06-16 10:38:43 +00:00
set foldmethod = indent
set foldnestmax = 3
2020-02-06 14:54:37 +00:00
set foldlevelstart = 2
2018-09-25 13:54:09 +00:00
set showmode
set autoindent
set breakindent
2018-11-23 11:14:42 +00:00
set showbreak = \ \ ↳\
2018-09-25 13:54:09 +00:00
set mouse = a
set listchars = eol :¬, tab :> - , trail :~ , extends :> , precedes :< , space :·
set foldtext = MyFoldText ( )
2019-06-03 20:16:35 +00:00
set conceallevel = 0
2018-11-05 20:12:38 +00:00
"----------------------------------------------------------------------------}}}
2018-09-25 13:54:09 +00:00
" #mappings {{{
let g :mapleader = ' '
2019-02-22 22:07:25 +00:00
" search and replace {{{
nnoremap < space > rr :%s /\<<C-r>=expand('<cword>')<CR>\>/ /g < left > < left >
"}}}
2019-09-18 13:28:58 +00:00
" #syntax
nnoremap < silent > < cr > s :syntax on < cr >
nnoremap < silent > < cr > S :syntax off < cr >
2018-11-19 13:38:12 +00:00
" miscallaneous {{{
2019-08-08 22:30:56 +00:00
nnoremap < cr > l :colorscheme monotonous - light < cr >
nnoremap < cr > d :colorscheme monotonous - dark < cr >
2018-11-15 21:25:44 +00:00
nnoremap 0 ^
2018-11-19 17:02:54 +00:00
nnoremap < silent > < space > cs :let @/= "" < cr >
2019-09-12 17:35:01 +00:00
nnoremap < space > : :setlocal number < CR > :
2018-09-25 13:54:09 +00:00
nnoremap < silent > < space > rc :so $MYVIMRC < CR >
nnoremap < silent > < expr > < space > nh ( &hls && v :hlsearch ? ':nohls' : ':set hls' ) ."\n"
nnoremap < silent > < space > sl :set invlist < CR >
nnoremap < space > aa A < left >
nnoremap < space > a2 A < left > < left >
nnoremap < space > ab A < C - o > B
nnoremap < space > co :! clear ;
2019-03-01 10:32:01 +00:00
nnoremap < space > ;; A ;< esc >
nnoremap < space > ;j jA ;< esc >
nnoremap < space > , , A , < esc >
nnoremap < space > , j jA , < esc >
2018-09-25 13:54:09 +00:00
" Focus on current fold, close the rest
nnoremap < silent > < space > zz zMzvzt
" replace current word with last yanked/deleted text
2019-02-22 22:07:25 +00:00
nnoremap < silent > < space > rw "_diwP
2018-09-25 13:54:09 +00:00
" replace current word with last yanked text
nnoremap < silent > < space > ry diw "0 P
" quick grep of visual selection
vnoremap < space > gr y :grep ! - R < C - r > " .
" open quickfix window of TODOs
2019-09-12 17:35:01 +00:00
" FIXME i want fixme!!!
nnoremap < space > td :grep - RE '(TODO\\|FIXME)' .< CR > :botright cwindow < CR > :echo len ( getqflist ( ) ) 'TODOs' < CR >
2018-09-25 13:54:09 +00:00
" devdocs mapping
nnoremap < space > dd :DD < CR >
" write and delete current buffer
nnoremap < space > bx :w \| bd < cr >
2018-11-19 13:38:12 +00:00
" sync highlighting from start
nnoremap < silent > < space > ss :syntax sync fromstart < CR >
2018-09-25 13:54:09 +00:00
2018-11-12 12:29:32 +00:00
"}}}
2018-11-19 13:38:12 +00:00
" terminal{{{
2018-12-12 09:09:04 +00:00
if has ( 'terminal' )
tnoremap < Esc > < C - \> < C - n >
endif
2018-09-25 13:54:09 +00:00
"}}}
2019-05-26 23:10:32 +00:00
" windows{{{
nnoremap < space > < space > :resize < CR > :vertical resize < CR >
" }}}
2018-11-19 13:38:12 +00:00
" git mappings {{{
2018-11-25 19:32:05 +00:00
" also see vim-fugitive plugin section
2018-09-25 13:54:09 +00:00
nnoremap < space > gD :! clear ; echo 'git diff' ; git diff < CR >
nnoremap < space > ga :! clear ; git add %; git status < CR >
nnoremap < space > gA :! clear ; git add .; git status < CR >
nnoremap < space > gg :! clear ; git add %; git commit - m '' < Left >
2018-11-25 22:00:51 +00:00
nnoremap < space > gP :! clear ; echo 'git push' ; git push < CR >
2018-09-25 13:54:09 +00:00
2018-11-05 20:12:38 +00:00
"}}}
2018-11-27 21:57:06 +00:00
" movement/navigation{{{
2018-09-25 13:54:09 +00:00
nnoremap < Esc > j :resize -5 < CR >
nnoremap < Esc > k :resize + 5 < CR >
nnoremap < Esc > l :vertical resize + 5 < CR >
nnoremap < Esc > h :vertical resize -5 < CR >
2018-11-27 21:57:06 +00:00
" alias for :tjump <cword>
nnoremap < space > tj g < C - ]>
2018-12-02 21:31:01 +00:00
" alias for :ptjump <cword>
2018-11-27 21:57:06 +00:00
nnoremap < space > tp < C - w > g }
2018-09-25 13:54:09 +00:00
"}}}
2018-11-19 13:38:12 +00:00
" location list and quickfix mappings {{{
2018-09-25 13:54:09 +00:00
nnoremap < space > lo :botright lwindow < CR >
nnoremap < up > :lprev < CR > zv
nnoremap < down > :lnext < CR > zv
nnoremap < space > lc :lclose < CR >
nnoremap < space > lh :lhistory < CR >
nnoremap < space > lp :lolder < CR >
nnoremap < space > ln :lnewer < CR >
nnoremap < space > qo :botright cwindow < CR >
nnoremap < left > :cprev < CR > zv
nnoremap < right > :cnext < CR > zv
nnoremap < space > qc :cclose < CR >
nnoremap < space > qh :chistory < CR >
nnoremap < space > qp :colder < CR >
nnoremap < space > qn :cnewer < CR >
2018-11-05 20:12:38 +00:00
"}}}
2018-11-19 13:38:12 +00:00
" insert mode mappings {{{
2018-09-25 13:54:09 +00:00
inoremap jkrg < c - o > :reg < cr >
inoremap :w < cr > :w < cr >
inoremap [:w < cr > :w < cr >
inoremap {:w < cr > :w < cr >
2018-11-25 19:32:05 +00:00
" Chain multiple path completions with / key. Selects the first suggestion if
" no current selection. Use ctrl-y to finish completion as normal.
inoremap < expr > / pumvisible ( )
\ ? len ( v :completed_item ) ? '<C-Y><C-X><C-F>' : '<C-N><C-Y><C-X><C-F>'
\ : '/'
2018-09-25 13:54:09 +00:00
2018-11-15 21:25:44 +00:00
"}}}
2018-11-19 13:38:12 +00:00
" working_with_underscores{{{
2018-11-15 21:25:44 +00:00
nnoremap < space > w f_l
nnoremap < space > b hT_
nnoremap < space > e lt_
onoremap u t_
onoremap U f_
2018-09-25 13:54:09 +00:00
"}}}
2018-11-05 20:12:38 +00:00
"----------------------------------------------------------------------------}}}
2018-09-25 13:54:09 +00:00
" #abbreviations {{{
2018-11-05 20:12:38 +00:00
" spelling"{{{
2018-09-25 13:54:09 +00:00
iabbrev adn and
iabbrev waht what
iabbrev tehn then
2018-09-25 14:28:49 +00:00
iabbrev functin function
iabbrev positin position
2018-10-04 18:33:32 +00:00
2018-11-05 20:12:38 +00:00
"}}}
" css{{{
2018-10-04 18:33:32 +00:00
iabbrev pabs ; position : absolute ;
iabbrev pfix ; position : fixed ;
iabbrev prel ; position : relative ;
2018-10-08 08:55:32 +00:00
iabbrev fdr ; flex - direction : row ;
iabbrev fdc ; flex - direction : column ;
iabbrev jcc ; justify - content : center ;
iabbrev aic ; align - items : center ;
2018-10-04 18:34:44 +00:00
iabbrev t0 ; top : 0 ;
iabbrev b0 ; bottom : 0 ;
iabbrev l0 ; left : 0 ;
iabbrev r0 ; right : 0 ;
2018-10-04 18:33:32 +00:00
iabbrev ct '' content - type : '' ;
2018-09-25 13:54:09 +00:00
"}}}
2018-11-05 20:12:38 +00:00
"----------------------------------------------------------------------------}}}
2018-09-25 13:54:09 +00:00
" #autocommands {{{
2018-12-02 22:33:19 +00:00
" persistent folds {{{
augroup AutoSaveFolds
autocmd !
autocmd BufWrite ?* mkview
autocmd BufRead ?* silent ! loadview
augroup END
2018-09-25 13:54:09 +00:00
2018-12-02 22:33:19 +00:00
" }}}
" Show trailing whitepace and spaces before a tab: {{{
augroup whitespaceerrors
autocmd !
autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin = ALL
augroup END
2018-09-25 13:54:09 +00:00
2018-12-02 22:33:19 +00:00
" }}}
" automatically reload if color scheme file written {{{
" augroup coloreload
" autocmd!
" autocmd BufWritePost customred256.vim so $MYVIMRC
" augroup end
"
" }}}
" line numbering {{{
2019-09-15 20:18:57 +00:00
" if exists('##CmdlineEnter')
" augroup linenumbering
" autocmd!
" autocmd CmdlineEnter * :redraw | :set number
" autocmd CmdlineLeave * :set nonumber
" augroup END
" endif
2018-09-25 13:54:09 +00:00
2018-12-02 22:33:19 +00:00
" }}}
" Automatically reload .vimrc if changed {{{
augroup myvimrc
autocmd !
autocmd BufWritePost .vimrc , _vimrc , vimrc , .gvimrc , _gvimrc , gvimrc so $MYVIMRC | if has ( 'gui_running' ) | so $MYGVIMRC | endif
augroup END
2018-09-25 13:54:09 +00:00
2018-12-02 22:33:19 +00:00
" }}}
" Open quickfix window{{{
augroup QuickFixAutoload
autocmd !
autocmd QuickFixCmdPost [^l ]* nested botright cwindow
autocmd QuickFixCmdPost l * nested botright lwindow
augroup END
2018-11-01 09:56:40 +00:00
2018-12-02 22:33:19 +00:00
" }}}
2018-09-25 13:54:09 +00:00
2018-12-02 22:33:19 +00:00
"----------------------------------------------------------------------------}}}
" #statusline {{{
2018-12-02 23:07:39 +00:00
set statusline = \
set statusline + = [%n ]\ \
2019-09-12 17:35:01 +00:00
set statusline + = %l \ of \ %L \
set statusline + = ( %p %%)
2018-12-02 23:07:39 +00:00
set statusline + = %=
set statusline + = %y \
set statusline + = %r \ %m \ %F
set statusline + = \
2018-09-25 13:54:09 +00:00
2018-11-05 20:12:38 +00:00
"----------------------------------------------------------------------------}}}
2018-12-05 17:26:36 +00:00
runtime vimrc - overrides
2018-12-02 22:33:19 +00:00
2019-09-12 17:35:01 +00:00
2018-03-18 16:56:02 +00:00
2018-11-04 16:15:18 +00:00
" vim: set foldmethod=marker: