aboutsummaryrefslogtreecommitdiff
path: root/base/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'base/vimrc')
-rw-r--r--base/vimrc49
1 files changed, 38 insertions, 11 deletions
diff --git a/base/vimrc b/base/vimrc
index befd96e..0d3871c 100644
--- a/base/vimrc
+++ b/base/vimrc
@@ -61,14 +61,10 @@ set wrap
"set textwidth=79
"set formatoptions=tqrn1
set colorcolumn=85
-set ruler
set number
set relativenumber
-set laststatus=2
-set shortmess=aoOstTWAI
set cursorline
-"set showmode
-set showcmd
+set shortmess=aoOstTWAI
set title " change the terminal's title
set scrolloff=3
@@ -88,6 +84,38 @@ set ttyfast
hi ColorColumn ctermbg=18
hi Folded ctermbg=0 ctermfg=12
+" Statusline ====----
+function! StatusGitInfo()
+ let git = gitbranch#name()
+ if git != ''
+ return ' '.git.' '
+ else
+ return ''
+endfunction
+
+"set ruler
+set showmode
+set showcmd
+set laststatus=2
+set statusline=
+"set statusline+=\ S%{strftime('%R',\ getftime(expand('%')))} " Time when last saved
+set statusline+=%1*\ %2*%<\ " Cut at start
+set statusline+=%3*%f " Path
+set statusline+=%{&modified?'\ +':''} " Modified
+set statusline+=%{&ro?'\ ':''} " Read only
+set statusline+=%{&paste?'\ P':''} " Paste mode
+"set statusline+=[%n%H%M%R%W]\ " flags and buf no
+set statusline+=%4*%=%3*\ " Section break
+set statusline+=%{&ff=='unix'?'':&ff\ } " Line ending
+set statusline+=%l\ %c\ %P\ " Line column percent
+set statusline+=%2*%1*%{StatusGitInfo()}\ " Git branch
+" ^Vue0b0
+
+hi User1 ctermfg=020 ctermbg=019
+hi User2 ctermfg=019 ctermbg=018
+hi User3 ctermfg=020 ctermbg=018
+hi User4 ctermfg=018 ctermbg=000
+
" Stop using arrow keys ====----
" noremap <up> <nop>
" noremap <down> <nop>
@@ -138,13 +166,13 @@ nnoremap <leader>q gqip
nnoremap <leader>vp `[V`]
nnoremap <leader>h :syntax sync fromstart<CR>
nnoremap <leader>l :nohlsearch<cr>:diffupdate<cr>:syntax sync fromstart<cr><c-l>
-nnoremap <leader>l :nohlsearch<cr>:diffupdate<cr>:syntax sync fromstart<cr><c-l>
nnoremap [<space> :<c-u>put! =repeat(nr2char(10), v:count1)<cr>'[
nnoremap ]<space> :<c-u>put =repeat(nr2char(10), v:count1)<cr>
noremap <leader>y "+y
noremap <leader>yy "+Y
noremap <leader>p :set paste<CR>:put +<CR>:set nopaste<CR>
+vnoremap p "_dP
noremap <silent> + :s/^\s*/&\/\//<CR>:noh<CR>
noremap <silent> - :s/^\(\s*\)\/\//\1/<CR>:noh<CR>
@@ -152,7 +180,9 @@ noremap <silent> - :s/^\(\s*\)\/\//\1/<CR>:noh<CR>
vnoremap Q gq
nnoremap Q gqap
-cnoremap w!! w !sudo tee % >/dev/null
+cnoremap w!! %!sudo tee % >/dev/null
+cnoremap <c-n> <down>
+cnoremap <c-p> <up>
" helper function to toggle hex mode
function! ToggleHex()
@@ -231,9 +261,6 @@ au BufNewFile,BufRead * call SetLocalOptions(bufname("%"))
" To move elsewhere ====----
au BufNewFile,BufRead *.less set filetype=less
autocmd! BufWritePost $MYVIMRC source $MYVIMRC
-packadd! matchit
-cnoremap <c-n> <down>
-cnoremap <c-p> <up>
autocmd! BufRead,BufNewFile *.md set filetype=markdown
autocmd! BufRead,BufNewFile *.md set spell
-vnoremap p "_dP
+packadd! matchit