diff options
| author | Aaron LI <aly@aaronly.me> | 2018-11-11 00:52:12 +0800 | 
|---|---|---|
| committer | Aaron LI <aly@aaronly.me> | 2018-11-11 00:52:12 +0800 | 
| commit | 69e4261cb33c74b81cbfc2d7320c8c276cf7cb8d (patch) | |
| tree | e8338fb52061eb5cbb2dbc06828f58b84d01fb91 /_vimrc | |
| parent | 5f102ae7873112f3abc8070382ef95058035f025 (diff) | |
| download | dotfiles-69e4261cb33c74b81cbfc2d7320c8c276cf7cb8d.tar.bz2 | |
vim: More tweaks
* Improve statusline:
  - Add virtual column number
  - Reorder file type and encoding
  - Shorten the paste mode indicator
* Highlight current line
* Disable cursor blinking
* No need to set ruler
* Tweak formatoptions and textwidth
Diffstat (limited to '_vimrc')
| -rw-r--r-- | _vimrc | 36 | 
1 files changed, 18 insertions, 18 deletions
@@ -48,9 +48,6 @@ set wildmenu  set wildignore=*.o,*~,*.pyc  set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store -"Always show current position -set ruler -  " Height of the command bar  set cmdheight=1 @@ -86,6 +83,9 @@ endif  " Add a bit extra margin to the left  set foldcolumn=1 +" Highlight the current line +set cursorline +  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  " => Colors and Fonts @@ -114,6 +114,7 @@ if has("gui_running")      set guioptions-=R  " No right scrollbar      set guifont=IBM\ Plex\ Mono\ Medium\ 11      set guitablabel=%M\ %t +    set guicursor+=a:blinkoff0  " Disable cursor blinking  endif @@ -137,14 +138,14 @@ set smarttab  set tabstop=8  set shiftwidth=4 -" Linebreak on 500 characters -set linebreak -set textwidth=500 -  set autoindent  set smartindent  set wrap +set linebreak +set textwidth=75 +set formatoptions+=m  " Break at multi-byte characters (e.g., CJK) +  """"""""""""""""""""""""""""""  " => Visual mode related @@ -158,7 +159,6 @@ vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  " => Moving around, tabs, windows and buffers  """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Map <Space> to / (search) and Ctrl-<Space> to ? (backwards search)  map <space> /  map <c-space> ? @@ -213,9 +213,17 @@ autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "norm  " Always show the status line  set laststatus=2 +" Returns true if paste mode is enabled +function! HasPaste() +    if &paste +        return '[PASTE] ' +    endif +    return '' +endfunction +  " Format the status line -set statusline=\ %{HasPaste()}%f%m%r%h\ %w -set statusline+=\ %=%y\ %{&fileencoding?&fileencoding:&encoding}\ %l:%c\ %P +set statusline=\ %{HasPaste()}%f%m%r%h\ %w\ %= +set statusline+=%{&fileencoding?&fileencoding:&encoding}\ %y\ %l,%c%V\ %P  set statusline+=\  " blank space @@ -285,14 +293,6 @@ imap <F1> <Esc>  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  " => Helper functions  """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Returns true if paste mode is enabled -function! HasPaste() -    if &paste -        return 'PASTE MODE  ' -    endif -    return '' -endfunction -  " Don't close window, when deleting a buffer  command! Bclose call <SID>BufcloseCloseIt()  function! <SID>BufcloseCloseIt()  | 
