-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
81 lines (64 loc) · 2.09 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"Load pathogen plugin manager
execute pathogen#infect()
"Enable displaying of buffers
let g:airline#extensions#tabline#enabled = 1
"Enable powerline fonts for airline
let g:airline_powerline_fonts = 1
"Enable ctrlp plugin
set runtimepath^=~/.vim/bundle/ctrlp.vim
filetype on
syntax enable "Enable syntax processing
colorscheme solarized "Setting colorscheme
set number "Enable line number
let mapleader=" " "Set leader key to space
"Load new vimrc config without quitting vim
map <leader>s :source ~/.vimrc<CR>
"Some performace impromenents
set hidden
set history=100
filetype indent on " Load filetype specifc indent files
set nowrap
set tabstop=4 "number of visual spaces per TAB
set softtabstop=4 "number of spaces in tab when editing
set shiftwidth=2
set expandtab "tabs are spaces
set smartindent
set autoindent
set showcmd "show command in bottom bar
set cursorline "highlight current line
"Remove whitespace while saving
autocmd BufWritePre * :%s/\s\+$//e
"Highlight words while searching
set hlsearch
set showmatch "show matching parenthesis
set wildmenu "visual autocomplete for command menu
set lazyredraw " redraw only when we need to
set incsearch " search as characters are entered
" Move beginning and end of line
nnoremap B ^
nnoremap E $
" $/^ doesn't do anything
nnoremap $ <nop>
nnoremap ^ <nop>
"Open visual mode
nmap <Leader><Leader> V
"cut copy paste
vmap <Leader>y "+y
nmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>p "+p
nmap <Leader>P "+P
vmap <Leader>p "+p
" Correct indentation
vmap <Leader>i =
"next buffer
nmap <Leader>m :bn<CR>
"
""previous buffer
nmap <Leader>n :bp<CR>
"close buffer
nmap <Leader>d :bd<CR>
"Map ctrlp plugin
nnoremap <Leader>o :CtrlP<CR>
"open nerd tree
nmap <Leader>j :NERDTreeToggle<CR>