-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
122 lines (94 loc) · 4.06 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
set nocompatible " Kill VI compatibility
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'kien/ctrlp.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-markdown'
Plugin 'joonty/vdebug.git'
Plugin 'mustache/vim-mustache-handlebars'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/syntastic'
Plugin 'godlygeek/tabular'
Plugin 'unblevable/quick-scope'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
set number " Show line numbers
set numberwidth=5 " Number of columns to use for the line number
syntax on " Enable syntax highlighting
set background=dark " Enable dark background
colorscheme solarized " Enable the Solarized colorscheme
set cursorline " Highlight the screen line of the cursor
set laststatus=2 " When the last window will use a status line (0: never, 1: at least two windows, 2: always)
set ttyfast " Indicate a fast terminal connection
set backspace=indent,eol,start " Set proper use of <BS> (http://vimdoc.sourceforge.net/htmldoc/options.html#'backspace')
set expandtab " Convert tabs to spaces
set tabstop=4 " Number of spaces a <Tab> counts for
set softtabstop=4 " Number of spaces a <Tab> counts for when editing
set shiftwidth=4 " Number of spaces to use for (auto)indentation
set title " Set window title to filename
set titleold=""
set titlestring=%F
" :E(xplorer) settings
let g:netrw_liststyle=3 " Use the tree listingstyle
let g:netrw_browse_split=4 " Open the file in window
let g:netrw_altv=2 " Split the window to the right i.o. left
let g:netrw_sort_sequence='[\/]$,*'
let g:netrw_banner=0
" Markdown
let g:markdown_fenced_languages = ['php', 'python', 'erlang', 'shell=sh', 'html', 'css', 'javascript', 'js=javascript', 'json=javascript']
" Use the :SW command to write as sudo
command SW w !sudo tee % > /dev/null
" Open NerdTREE if no files specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Open NerdTREE with <ctrl>+<n>
map <C-n> :NERDTreeToggle<CR>
" Close NerdTREE if it's the only buffer left
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" Change size of NERDTree window
let g:NERDTreeWinSize = 45
" Activate CtrlP By pressing <c-p>
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" Ignore certain files
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_working_path_mode = 'ra'
" Load external settings
source ~/.vim/config/statusline.vim
let g:airline_powerline_fonts = 1
" Allow overriding any of these settings
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif
if !empty(glob("~/.vim/bundle/quick-scope"))
function! Quick_scope_selective(movement)
let needs_disabling = 0
if !g:qs_enable
QuickScopeToggle
redraw
let needs_disabling = 1
endif
let letter = nr2char(getchar())
if needs_disabling
QuickScopeToggle
endif
return a:movement . letter
endfunction
let g:qs_enable = 0
nnoremap <expr> <silent> f Quick_scope_selective('f')
nnoremap <expr> <silent> F Quick_scope_selective('F')
nnoremap <expr> <silent> t Quick_scope_selective('t')
nnoremap <expr> <silent> T Quick_scope_selective('T')
vnoremap <expr> <silent> f Quick_scope_selective('f')
vnoremap <expr> <silent> F Quick_scope_selective('F')
vnoremap <expr> <silent> t Quick_scope_selective('t')
vnoremap <expr> <silent> T Quick_scope_selective('T')
endif