Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " prevents vim from emulating the original vi's bugs and limitations
- set nocompatible " enabled when (g)vimrc is found
- set backspace=start,indent,eol " make backspace work like 'normal' text editors
- set number " show line numbers
- set showcmd " show the command being typed
- set ruler " always show current position
- set tabstop=4 " width of a tab character in spaces
- set softtabstop=4 " defines number of spaces for when adding/remving tabs
- set shiftwidth=4 " number of spaces to use for autoindent
- set expandtab " use spaces instead of tab characters
- set autoindent
- set smartindent
- set hidden " allow buffer to be changed without writing to disk
- set showmode " If in Insert, Replace or Visual mode put a message on the last line
- set wildmenu " better command autocompletion
- set laststatus=2 " always show statusline
- " searching related
- set incsearch
- set hlsearch
- set smartcase
- syntax enable " enable syntax highlighting
- set t_Co=256 " use 256 colours in terminal vim
- filetype plugin indent on " let vim detect filetype and load appropriate scripts
- " When editing a file, always jump to the last cursor position
- if has("autocmd")
- autocmd BufReadPost *
- \ if line("'\"") > 0 && line ("'\"") <= line("$") |
- \ exe "normal! g'\"" |
- \ endif
- endif
- " Useful default mappings
- "Change directory to the dir of the current buffer
- noremap \cd :cd %:p:h<CR>
- " clear highlighting on <esc> press
- nnoremap <esc> :noh<return><esc>
- " Window switching
- noremap <c-h> <c-w>h
- noremap <c-j> <c-w>j
- noremap <c-k> <c-w>k
- noremap <c-l> <c-w>l
- " Make C-BS and C-Del work like they do in most text editors for the sake of muscle memory
- imap <C-BS> <C-W>
- imap <C-Del> <esc>Ea<C-W>
- " Windows-like copy/cut/paste mappings
- " CTRL-V is Paste in insert mode
- imap <C-V> "+gpa
- " CTRL-C is Copy, CTRL-X is Cut, in visual mode
- vmap <C-C> "+y
- vmap <C-x> "+d
- " Use CTRL-Q to do what CTRL-V used to do
- noremap <C-Q> <C-V>
- " best mapping ever - swap ; and :
- noremap ; :
- noremap : ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement