-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy path.vimrc
129 lines (99 loc) · 2.15 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
" Vundle
filetype off
let g:vundle_default_git_proto = 'git'
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Bundles
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'bling/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'TomNomNom/xoria256.vim'
Plugin 'fatih/vim-go'
call vundle#end()
filetype plugin on
" Highlighting
syntax on
set encoding=utf-8
" Airline config
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='powerlineish'
" History
set history=50
" Display
set ls=2
set showmode
set showcmd
set modeline
set ruler
set title
set nu
" Line wrapping
set nowrap
set linebreak
set showbreak=▹
" Auto indent what you can
set autoindent
" Searching
set ignorecase
set smartcase
set gdefault
set hlsearch
set showmatch
" Enable jumping into files in a search buffer
set hidden
" Make backspace a bit nicer
set backspace=eol,start,indent
" Indentation
set shiftwidth=4
set tabstop=4
set softtabstop=4
set shiftround
set expandtab
" Disable mouse
set mouse=
" Colorscheme
if &t_Co == 256
try
color xoria256
catch /^Vim\%((\a\+)\)\=:E185/
" Oh well
endtry
endif
" Switch tabs
map 8 <Esc>:tabe
map 9 gT
map 0 gt
" Direction keys for wrapped lines
nnoremap <silent> k gk
nnoremap <silent> j gj
nnoremap <silent> <Up> gk
nnoremap <silent> <Down> gj
inoremap <silent> <Up> <Esc>gka
inoremap <silent> <Down> <Esc>gja
" Bash / emacs keys for command line
cnoremap <C-a> <Home>
cnoremap <C-e> <End>
" Base64 decode word under cursor
nmap <Leader>b :!echo <C-R><C-W> \| base64 -d<CR>
" grep recursively for word under cursor
nmap <Leader>g :tabnew\|read !grep -Hnr '<C-R><C-W>'<CR>
" sort the buffer removing duplicates
nmap <Leader>s :%!sort -u --version-sort<CR>
" Visual prompt for command completion
set wildmenu
" I type these wrong often
command! W w
command! -bang Qall qall
" folding
set nofoldenable
" a mode for quickly looking at lots of files
if $VIMENV == 'prev'
noremap <Space> :n<CR>
noremap <Backspace> :N<CR>
noremap <C-D> :call delete(expand('%')) <bar> argdelete % <bar> bdelete<CR>
set noswapfile
endif
set noesckeys
set nocompatible