From: Jannik ZANDER Date: Wed, 11 Jul 2018 22:44:30 +0000 (+0200) Subject: Map ; to : in vim X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=01b94c8bf429f547cd3db7eb6565cc197b9f95e2;p=dotfiles.git Map ; to : in vim --- diff --git a/.vim/vimrc b/.vim/vimrc index 3fe8706..018978b 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -1,99 +1,111 @@ set nocompatible filetype plugin indent on -syntax enable +syntax on " Use :help 'option' to see the documentation for the given option. -set shell=/bin/bash -if has("win32") - set shell=cmd - set shellcmdflag=/c -endif -set path=.,,** -set sessionoptions-=options - -" keyboard -set backspace=indent,eol,start -let mapleader = "," -set ttimeoutlen=10 -set winaltkeys=no -set mouse=a -set mousemodel=extend -set noerrorbells -set visualbell - -" colors and fonts -set t_Co=256 -set background=dark -highlight LineNr ctermfg=grey -let &t_ti.="\e[1 q" -let &t_SI.="\e[5 q" -let &t_EI.="\e[1 q" -let &t_te.="\e[0 q" - -" files -set fileformats=unix,dos,mac -set fileignorecase -setglobal tags-=./tags tags-=./tags; tags^=./tags; - -" copy and paste -set virtualedit=block -set clipboard=unnamed - -" format -set formatoptions+=j -set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ -" buffers -silent !mkdir -p ~/.vim/undo -set undofile -set undodir=~/.vim/undo -set viminfo+=n~/.vim/viminfo -set nohidden -set nobackup -set noswapfile -set autoread -set autowrite -set autowriteall - -" indent +" indenting set autoindent +set copyindent set smarttab +set nolinebreak +set breakindent set breakindent showbreak=\ + -set linebreak set shiftround +set formatoptions+=j +set wrap -" search +" searching set incsearch set hlsearch set ignorecase set smartcase set showmatch +set wrapscan set complete-=i +set virtualedit=block +set clipboard=unnamed -" scroll +" display set scrolloff=1 set sidescrolloff=5 set display+=lastline set lazyredraw set number set relativenumber +set titlestring=vim:\ %f -" fold +" folding set foldmethod=syntax +set foldopen+=jump,search set foldlevel=1 set foldclose=all -set foldopen+=jump,search -" command line -set wildmenu -set wildmode=longest:full,full -set wildignore+=tags,*.pyc,*.jpg,*.png,*.gif +" keyboard and mouse +set backspace=indent,eol,start +set ttimeoutlen=10 +set winaltkeys=no +set mouse=a +set mousemodel=popup +set noerrorbells +set visualbell +let mapleader = "," +set pastetoggle=p + +" command/status line +set showmode set showcmd set ruler set laststatus=2 set cmdheight=2 -set shortmess=aoOtI +set shortmess=aoOTI +set wildmenu +set wildmode=longest:full,full +set wildignore+=tags,*.pyc,*.jpg,*.png,*.gif,*.zip +set wildoptions=tagfile + +" buffers +set hidden +set autoread +set noautowrite +set noautowriteall + +" temporary files +silent !mkdir -p ~/.vim/undo +set nobackup +set noswapfile +set undofile +set undodir=~/.vim/undo +set viminfo+=n~/.vim/viminfo +set sessionoptions-=options set history=1000 +setglobal tags-=./tags tags-=./tags; tags^=./tags; + +" system +set path=.,,** +set shell=/bin/bash +if has("win32") + set shell=cmd + set shellcmdflag=/c +endif +set fileformats=unix,dos,mac +set fileignorecase + +" colors and fonts +set t_Co=256 +set background=dark +highlight LineNr ctermfg=grey +set list +if has('multi_byte') && &encoding ==# 'utf-8' + let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' +else + let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' +endif +set cursorline +let &t_ti.="\e[1 q" +let &t_SI.="\e[5 q" +let &t_EI.="\e[1 q" +let &t_te.="\e[0 q" " grep set grepprg=ag\ --vimgrep\ --skip-vcs-ignores\ --path-to-ignore\ ~/.ignore\ --cpp\ --cc @@ -140,6 +152,7 @@ let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] let g:editorconfig_verbose = 1 let g:editorconfig_core_mode = "python_builtin" + " CtrlP packadd ctrlp.vim let g:ctrlp_map = 'p' @@ -154,6 +167,8 @@ nnoremap m :CtrlPMRU packadd matchit " Normal mode Mappings +nnoremap ; : +nnoremap : ; nnoremap nnoremap nnoremap @@ -173,31 +188,33 @@ inoremap u cnoreabbrev w!! w !sudo tee "%" " Autocommands -augroup filetype - au! - au bufnewfile,buffilepre,bufread *.md set filetype=markdown - au bufnewfile,buffilepre,bufread *.gradle set filetype=groovy - au bufnewfile,buffilepre,bufread *.json set filetype=json - au bufnewfile,buffilepre,bufread *.yml set filetype=yaml -augroup END - -augroup saveall - au! - au focuslost * wall -augroup END - -augroup numbertoggle - au! - au bufenter,focusgained,insertleave * set relativenumber - au bufleave,focuslost,insertenter * set norelativenumber -augroup END - -augroup vimrc - au! - au bufwritepost ~/.vim/gvimrc source % - au bufwritepost ~/.vim/vimrc source % - au bufwritepost ~/.vim/vimrc.local source % -augroup END +if has('autocmd') + augroup filetype + au! + au bufnewfile,buffilepre,bufread *.md set filetype=markdown + au bufnewfile,buffilepre,bufread *.gradle set filetype=groovy + au bufnewfile,buffilepre,bufread *.json set filetype=json + au bufnewfile,buffilepre,bufread *.yml set filetype=yaml + augroup END + + augroup saveall + au! + au focuslost * wall + augroup END + + augroup numbertoggle + au! + au bufenter,focusgained,insertleave * set relativenumber + au bufleave,focuslost,insertenter * set norelativenumber + augroup END + + augroup vimrc + au! + au bufwritepost ~/.vim/gvimrc source % + au bufwritepost ~/.vim/vimrc source % + au bufwritepost ~/.vim/vimrc.local source % + augroup END +endif " local settings if filereadable(expand('~/.vim/vimrc.local'))