-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
84 lines (68 loc) · 2.22 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
" Enable non-vi compatible features
set nocompatible
" Automatic reloading on write
autocmd! bufwritepost ~/.vimrc source %
" Use Vundle to manage plugins
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'moll/vim-bbye'
Plugin 'fatih/vim-go'
call vundle#end()
" Enable loading of plugins and indent format depending on filetype
filetype plugin indent on
syntax on
" Airline
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
" Enable code completition
set omnifunc=syntaxcomplete#Complete
" Flags
set number " show line numbers
set relativenumber " show line numbers relative to cursor
set hlsearch " search highlighting
set incsearch " incremental search
set showcmd " show the command as it's being entered
set ignorecase " ignore case when searching
set smartcase " unless the pattern contains an uppercase char
set clipboard=unnamedplus " use + register for yanks
set matchpairs+=<:> " match also < and >
set scrolloff=5 " always show 5 lines of context when scrolling
set listchars=tab:>·,trail:~,extends:>,precedes:<
autocmd FileType go setlocal listchars=tab:\ \ ,trail:~,extends:>,precedes:<
set list " show unprintable characters with the listchar format
set splitbelow " open new splits in best direction
set splitright " "
set colorcolumn=80 " show column at 80 characters
highlight ColorColumn ctermbg=8 " and set it's color
" Mappings
" set different escape sequence for insert
inoremap jk <Esc>
" go to column 80
nnoremap ge :cal cursor(0, 80)<CR>
" Move trough windows using Ctrl-{h,j,k,l}
inoremap <C-h> <C-\><C-N><C-w>h
inoremap <C-j> <C-\><C-N><C-w>j
inoremap <C-k> <C-\><C-N><C-w>k
inoremap <C-l> <C-\><C-N><C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Exchange : and ;
nnoremap ; :
nnoremap : ;
vnoremap ; :
vnoremap : ;
" Write as sudo with :w!!
cmap w!! w !sudo tee > /dev/null %
" Make deleting buffers not suck
cnoremap bd Bdelete
" Move lines with Ctrl-Alt-{j,k,l,;}
source ~/.vim/move_lines.vim
" Toggle between line number mode
source ~/.vim/line_number_toggle.vim
" Autocomplete paired characters
source ~/.vim/autoclose_brackets.vim