-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
102 lines (80 loc) · 2.93 KB
/
vimrc
File metadata and controls
102 lines (80 loc) · 2.93 KB
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
" .vimrc
" Tom Hartnell <github.com/gwithian>
" v 0.1
" rev. 2012-07-29
" initial settings thanks to http://mislav.uniqpath.com/2011/12/vim-revisited/
" Pathogen plugin management
call pathogen#infect()
call pathogen#helptags()
set nocompatible " choose no compatibility with legacy vi
syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
set modelines=0 " avoid security exploits
" Remap leader key from '\' to ','
let mapleader = ","
" test remap jj as escape
inoremap jj <ESC>
" open and switch to new vertical split
nnoremap <leader>w <C-w>v<C-w>l
" better navigation in split views
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"" Whitespace
set wrap " wrap lines
set linebreak
set tabstop=4 shiftwidth=4 softtabstop=4 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optional)
set backspace=indent,eol,start " backspace through everything in insert mode
set textwidth=80
set formatoptions=qrn1
set colorcolumn=80 " highlight the 80th column
set showbreak=… " show symbol for soft broken lines
" Shortcut to rapidly toggle `set list` - <vimcasts.org>
nmap <leader>l :set list!<CR>
" Use the same symbols as TextMate for tabstops and EOLs - <vimcasts.org>
set listchars=tab:▸\ ,eol:¬
"" Searching/moving - thanks to <http://stevelosh.com/blog/2010/09/coming-home-to-vim/>
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
set gdefault " Substitute globally on lines
" fix Vim’s horribly broken default regex “handling” by automatically inserting a \v before any string you search for
nnoremap / /\v
vnoremap / /\v
" clear dynamic search highlights with leader-space
noremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
"switch between recent buffers
nnoremap <leader><leader> <c-^>
" Set autocomplete for JS files
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
" Auto set Vim working path to current files dir
autocmd BufEnter * silent! lcd %:p:h
" Text bubbling- thanks to Drew Neil <vimcasts.org>
" requires vim-unimpared plugin <github.com/tpope/vim-unimpaired>
" single lines
nmap <C-Up> [e
nmap <C-Down> ]e
" multiline
vmap <C-Up> [egv
vmap <C-Down> ]egv
" Powerline settings
set laststatus=2
let g:Powerline_symbols = 'fancy'
" Steve Losh's temp settings for the Vim trainee, what, no arrow keys?
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk