forked from carlosperez/vim-settings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
138 lines (102 loc) · 3 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
129
130
131
132
133
134
135
136
137
" Enable Pathogen
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
syntax enable
filetype plugin indent on
set laststatus=2
" JSX highlighting in JS files
let g:jsx_ext_required = 0
" Change tab size
set tabstop=2 shiftwidth=2 expandtab
autocmd FileType scss setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
" Auto add ending brace and quotes
inoremap { {}<Left>
inoremap {<CR> {<CR>}<Esc>O
inoremap {{ {
inoremap {} {}
" Allow switching buffers without having to save
set hidden
" Turn on CSS autocomplete
nnoremap <Leader>m :w <BAR> !lessc % > %:t:r.css<CR><space>
" Colors
colorscheme Monokai-Refined
" Map show/hide of NerdTree
nnoremap <silent> <C-k><C-b> :NERDTreeToggle<CR>
" Allow backspacing over everything in insert mode
set backspace=indent,eol,start
" Disable folding.
set nofoldenable
" Show line numbers
set number
" Don't wrap
set nowrap
" Set xterm title.
set title
" Configure CTRL-P some
set wildignore+=*/node_modules/*,*/bower_components/*,*/public/*
" Fast saving (\w)
nmap <leader>w :w!<cr>
" Mouse mode
set ttyfast
set mouse=a
set ttymouse=xterm2
" md is for Markdown
au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.md setf markdown
" Disable automatic newline at eof
set fileformats+=dos
" Cycle through buffers
nnoremap <S-l> :bnext<CR>
nnoremap <S-h> :bprevious<CR>
" Airline config
set noshowmode "stop showing default mode indicator
let g:airline_powerline_fonts = 1 "fonts for powerline
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
" Set keystrokes for pane navigation
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" CTRL-P buffer mode
map <leader>p :CtrlPBuffer<CR>
" Close all buffers but current
map <leader>x :BufOnly<CR>
" Search stuff
set ignorecase
set smartcase
set hlsearch
map <space> /
map <silent> <leader><space> :noh<cr>
" map esc to jj
imap jj <Esc>
" Enable spellchecking for Markdown
autocmd FileType markdown setlocal spell
" Automatically wrap at 80 characters for Markdown
au BufRead,BufNewFile *.md setlocal textwidth=80
" Automatically wrap at 72 characters and spell check
" git commit messages
autocmd FileType gitcommit setlocal textwidth=72
autocmd FileType gitcommit setlocal spell
" Stop using swap files!
set noswapfile
" Syntastic settings
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" Setup bbye for closing a single buffer without messing up
" the rest of the window layout
:nnoremap <leader>q :Bdelete<CR>
" Copy line on OS X
" Mapped to ALT-C
:xnoremap ç :w !pbcopy<CR><CR>
" Copy entire written file contents on OS X
" Mapped to ALT-F
:nnoremap ƒ <Esc>:!pbcopy < %<CR><CR>
" Paste friendlier on OS X
" Mapped to ALT-V
:nnoremap √ <Esc>:set paste<CR>:r !pbpaste<CR>:set nopaste<CR>