diff options
Diffstat (limited to 'base/.vimrc')
-rw-r--r-- | base/.vimrc | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/base/.vimrc b/base/.vimrc index fa798ff..b8e83cc 100644 --- a/base/.vimrc +++ b/base/.vimrc @@ -20,13 +20,12 @@ nnoremap ; : syntax on filetype plugin indent on -set t_Co=256 " enable 256-color mode. +set t_Co=256 " force enable 256-color mode. if &t_Co >= 256 || has("gui_running") - "colorscheme mustang - "colorscheme desert " set colorscheme + let base16colorspace=256 + colorscheme base16-default-dark endif if &t_Co > 2 || has("gui_running") - " switch syntax highlighting on, when the terminal has colors syntax on endif @@ -76,7 +75,7 @@ set visualbell " don't beep set noerrorbells " don't beep set list -set listchars=tab:>.,trail:.,extends:#,nbsp:. +set listchars=tab:»\ ,extends:›,precedes:‹,nbsp:·,trail:· "autocmd filetype html,xml set listchars-=tab:>. set wildmenu @@ -85,17 +84,14 @@ set wildignore=*.swp,*.bak,*.pyc,*.class set ttyfast +hi ColorColumn ctermbg=18 hi Folded ctermbg=0 ctermfg=12 " Stop using arrow keys ====---- -nnoremap <up> <nop> -nnoremap <down> <nop> -nnoremap <left> <nop> -nnoremap <right> <nop> -inoremap <up> <nop> -inoremap <down> <nop> -inoremap <left> <nop> -inoremap <right> <nop> +noremap <up> <nop> +noremap <down> <nop> +noremap <left> <nop> +noremap <right> <nop> " nnoremap j gj " nnoremap k gk @@ -128,10 +124,12 @@ set noswapfile " Note: swap helps large files. " Custom mappings ====---- " Quickly edit/reload the vimrc file -nnoremap <silent> <leader>ev :e $MYVIMRC<CR> -nnoremap <silent> <leader>sv :so $MYVIMRC<CR> +nnoremap <silent> <leader>ve :tabe $MYVIMRC<CR> +nnoremap <silent> <leader>vs :so $MYVIMRC<CR> +nnoremap <F2> :set invpaste paste?<CR> set pastetoggle=<F2> +set showmode nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR> nnoremap <leader>ft Vatzf @@ -198,6 +196,22 @@ nnoremap <leader>N :call NumberToggle()<cr> autocmd InsertEnter * :set number autocmd InsertLeave * :set relativenumber +" Custom functions ====---- + +function! SetLocalOptions(fname) + let dirname = fnamemodify(a:fname, ":p:h") + while "/" != dirname + let lvimrc = dirname . "/.vimrc.local" + if filereadable(lvimrc) + execute "source " . lvimrc + break + endif + let dirname = fnamemodify(dirname, ":p:h:h") + endwhile +endfunction + +au BufNewFile,BufRead * call SetLocalOptions(bufname("%")) + " To move elsewhere ====---- au BufNewFile,BufRead *.less set filetype=less |