forked from eraserewind/dotvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
125 lines (100 loc) · 4.84 KB
/
vimrc
File metadata and controls
125 lines (100 loc) · 4.84 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
" Inspiration from janus' vimrc & holman/dotfiles
" Infect with pathogen
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
call pathogen#infect()
" Base
set nocompatible
filetype plugin indent on
set encoding=utf-8
" Ignores
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
set wildignore+=*node_modules/* " ignore node_modules
" ----------------------------------------------------------------------------
" Text Formatting
" ----------------------------------------------------------------------------
set autoindent " automatic indent new lines
set smartindent " be smart about it
inoremap # X<BS>#
set nowrap " do not wrap lines
set softtabstop=2 " yep, two
set shiftwidth=2 " ..
set tabstop=4
set expandtab " expand tabs to spaces
set nosmarttab " fuck tabs
set formatoptions+=n " support for numbered/bullet lists
set textwidth=80 " wrap at 80 chars by default
set virtualedit=block " allow virtual edit in visual block ..
" ----------------------------------------------------------------------------
" Remapping
" ----------------------------------------------------------------------------
" lead with &
let mapleader = "&"
" ----------------------------------------------------------------------------
" UI
" ----------------------------------------------------------------------------
set ruler " show the cursor position all the time
set noshowcmd " don't display incomplete commands
set nolazyredraw " turn off lazy redraw
set number " line numbers
set wildmenu " turn on wild menu
set wildmode=list:longest,full
set ch=2 " command line height
set backspace=2 " allow backspacing over everything in insert mode
set whichwrap+=<,>,h,l,[,] " backspace and cursor keys wrap to
set shortmess=filtIoOA " shorten messages
set report=0 " tell us about changes
set nostartofline " don't jump to the start of line when scrolling
set noshowmode " disable showmode (powerline shows it)
syntax enable " enable syntax
set background=dark " use solarized dark
colorscheme solarized " use solarized colorscheme
set foldmethod=marker " code folding with markers
" ----------------------------------------------------------------------------
" Powerline
" ----------------------------------------------------------------------------
let g:Powerline_symbols = 'fancy'
"let g:Powerline_theme = 'skwp' " solarized
let g:Powerline_colorscheme = 'skwp' " solarized
"call Pl#Theme#InsertSegment('ws_marker', 'after', 'lineinfo') " white spaces
" ----------------------------------------------------------------------------
" The NerdTree
" ----------------------------------------------------------------------------
" Open the tree if no files specified
autocmd vimenter * if !argc() | NERDTree | endif
" Close vim if the tree is last buffer
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" Ignores
let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$', '\node_modules/', 'tmp/']
" Map <Leader>n to toggle the tree
map <Leader>n :NERDTreeToggle<CR>
" ----------------------------------------------------------------------------
" CoffeeScript
" ----------------------------------------------------------------------------
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable " Fold on indent (hit zi)
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab " default indent
"au BufWritePost *.coffee silent CoffeeMake! " recompile file when written
"au BufWritePost *.coffee silent CoffeeMake! -b | cwindow | redraw! " recompiles silentely
" ----------------------------------------------------------------------------
" .swp files
" ----------------------------------------------------------------------------
set backupdir=~/.vim/backup
set directory=~/.vim/backup
" ----------------------------------------------------------------------------
" Visual Cues
" ----------------------------------------------------------------------------
set showmatch " brackets/braces that is
set mat=5 " duration to show matching brace (1/10 sec)
set incsearch " do incremental searching
set laststatus=2 " always show the status line
set ignorecase " ignore case when searching
set smartcase " smart case
set hlsearch " highlight searches
set visualbell " shut the fuck up
" ---------------------------------------------------------------------------
" Strip all trailing whitespace in file
" ---------------------------------------------------------------------------
function! StripWhitespace ()
exec ':%s/ \+$//gc'
endfunction
map ,s :call StripWhitespace ()<CR>