Skip to content

Latest commit

 

History

History
106 lines (82 loc) · 2.93 KB

1.1.2 vimrc.md

File metadata and controls

106 lines (82 loc) · 2.93 KB

Переместить нижестоящий код: vim ~/.vimrc

" Comments in Vimscript start with a `"`.

" Now the backlight always works
" filetype plugin indent on

" Turn on syntax highlighting.
syntax on

" Disable the default Vim startup message.
set shortmess+=I

" Show line numbers.
set number

" The backspace key has slightly unintuitive behavior by default. For example,
" by default, you can't backspace before the insertion point set with 'i'.
" This configuration makes backspace behave more reasonably, in that you can
" backspace over anything.
set backspace=indent,eol,start

" By default, Vim doesn't let you hide a buffer (i.e. have a buffer that isn't
" shown in any window) that has unsaved changes. This is to prevent you from "
" forgetting about unsaved changes and then quitting e.g. via `:qa!`. We find
" hidden buffers helpful enough to disable this protection. See `:help hidden`
" for more information on this.
set hidden

" This setting makes search case-insensitive when all characters in the string
" being searched are lowercase. However, the search becomes case-sensitive if
" it contains any capital letters. This makes searching more convenient.
set ignorecase
set smartcase

" Enable searching as you type, rather than waiting till you press enter.
set incsearch

" Unbind some useless/annoying default key bindings.
" 'Q' in normal mode enters Ex mode. You almost never want this.
nmap Q <Nop> 

" Disable audible bell because it's annoying.
set noerrorbells visualbell t_vb=

" Enable mouse support. You should avoid relying on this too much, but it can
" sometimes be convenient.
set mouse+=a

" Line after n characters
highlight ColorColumn ctermbg=gray
set colorcolumn=110

" When writing code, auto indent works
set autoindent

" set tab to 4 spaces
set ts=4

" highlight the line the cursor is on
set cursorline

" Bottom right shows useful information
set ruler

" Ability to undo the last actions on Ctrl-Z
nnoremap <c-z> :u<CR>
vnoremap <c-z> :u<CR> 
inoremap <c-z> <c-o>:u<CR>
vnoremap <c-z> <c-o>:u<CR>

" Implement Ctrl-C Ctrl-V
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"i+p
imap <C-v> <C-r><C-o>+

:" Map Ctrl-A -> Start of line, Ctrl-E -> End of line
nnoremap <C-a> <Home>
inoremap <C-a> <Home>
nnoremap <C-e> <End><Right>
inoremap <C-e> <End><Right>

" Select with shift + arrows
inoremap <S-Left>    <Left><C-o>v
inoremap <S-Right>   <C-o>v
inoremap <S-Up>      <Left><C-o>v<Up><Right>
inoremap <S-Down>    <C-o>v<Down><Left>
imap     <C-S-Left>  <S-Left><C-Left>
imap     <C-S-Right> <S-Right><C-Right>
vnoremap <S-Left>    <Left>
vnoremap <S-Right>   <Right>
vnoremap <S-Up>      <Up>
vnoremap <S-Down>    <Down>

" equivalence :Wq and :wq
command! Wq wq
command! W w
command! Q q

" ability to set mouse coursor to the end of line
set ve=onemore

1.1.1 All Configs Theme | Back To iOSWiki Contents | 1.1.3 Git Config Theme