diff options
Diffstat (limited to 'base/.vimrc')
-rw-r--r-- | base/.vimrc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/base/.vimrc b/base/.vimrc index 4e3858a..627d7b0 100644 --- a/base/.vimrc +++ b/base/.vimrc @@ -1,11 +1,9 @@ set nocompatible +set encoding=utf-8 set modelines=0 " for security -set encoding=utf-8 - set mouse="" - set backspace=indent,eol,start au FocusLost * :wa @@ -37,6 +35,9 @@ set shiftround " use multiple of shiftwidth with '<' and '>' set autoindent set copyindent " copy the previous line's indentation +xnoremap < <gv +xnoremap > >gv + " Search ====---- set incsearch set hlsearch @@ -137,6 +138,9 @@ nnoremap <leader>S ?{<CR>jV/^\s*\}?$<CR>k:sort<CR>:noh<CR> 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 [<space> :<c-u>put! =repeat(nr2char(10), v:count1)<cr>'[ +nnoremap ]<space> :<c-u>put =repeat(nr2char(10), v:count1)<cr> noremap <silent> + :s/^\s*/&\/\//<CR>:noh<CR> noremap <silent> - :s/^\(\s*\)\/\//\1/<CR>:noh<CR> @@ -189,18 +193,22 @@ nnoremap <leader>h :Hexmode<CR> function! NumberToggle() if(&relativenumber == 1) - set number + set norelativenumber else set relativenumber endif endfunc nnoremap <leader>N :call NumberToggle()<cr> -autocmd InsertEnter * :set number -autocmd InsertLeave * :set relativenumber +"autocmd InsertEnter * :set norelativenumber +"autocmd InsertLeave * :set relativenumber " Custom functions ====---- +if filereadable(expand("~/.vimrc.local")) + source ~/.vimrc.local +endif + function! SetLocalOptions(fname) let dirname = fnamemodify(a:fname, ":p:h") while "/" != dirname @@ -218,3 +226,10 @@ 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 |