-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_vimrc
149 lines (129 loc) · 3.65 KB
/
dot_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
138
139
140
141
142
143
144
145
146
147
148
149
if empty(glob('~/.vim/autoload/plug.vim'))
silent execute '!curl -fLo '~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source ~/.vimrc
endif
call plug#begin('~/.vim/plugs')
Plug 'airblade/vim-gitgutter'
Plug 'altercation/vim-colors-solarized'
Plug 'editorconfig/editorconfig-vim'
Plug 'godlygeek/tabular'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'tpope/vim-sensible'
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-airline/vim-airline'
call plug#end()
set nocompatible
filetype off
syntax enable
set backupdir=~/.vim/backups
set directory=~/.vim/swaps
set undodir=~/.vim/undos
set autoindent
set backspace=indent,eol,start
set cpoptions+=$
set cursorline
set enc=utf-8
set encoding=utf-8 nobomb
set expandtab
set hidden
set history=1000
set ignorecase
set incsearch
set laststatus=2
set listchars+=eol:↴
set listchars+=nbsp:_
set listchars+=trail:·
set listchars=tab:▸\
set magic
set matchtime=2
set mousehide
set noerrorbells
set nohlsearch
set nojoinspaces
set nostartofline
set nowrap
set number
set numberwidth=3
set report=0
set ruler
set scrolloff=5
set shiftwidth=4
set shortmess=aAItW
set showcmd
set showmatch
set showmode
set smartcase
set softtabstop=4
set spelllang=en_us
set synmaxcol=2500
set t_Co=256
set tabstop=4
set ttyfast
set undofile
set updatetime=250
set visualbell
set wildignore+=*.o,*.obj,*.pyc,.git,*.bak,.svn
set wildmenu
set wildmode=list:longest,full
set winminheight=0
if &term =~ '^xterm'
let &t_SI .= "\<Esc>[3 q"
endif
set background=dark
let g:airline_powerline_fonts = 1
let g:solarized_visibility = "low"
silent! colorscheme solarized
nnoremap ; :
let mapleader=","
imap jj <ESC> " [jj] Quick ESC from insert mode
nmap <leader>w :w!<cr> " [,w] Fast saves
map <leader>cs <Esc>:noh<CR> " [,cs] Clear search.
nmap <leader>ll :set list!<CR> " Rapidly toggle 'set list'
nmap <leader>pp :set paste!<CR> " [,pp ] Key for paste mode
nmap <leader>nn :set nonumber!<CR> " [,nn ] Toggle line numbers
nmap <Space> <PageDown> " Page down with <Space>
" source .vimrc changes
nnoremap gsv :so $MYVIMRC<CR>
" Changes up/down to move by line in editor
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
" Switch windows with Ctrl + a movement key
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Enable filetype detection
syntax on
if has("autocmd")
filetype plugin indent on
syntax on
endif
" Prevent colorschemes from changing background color of screen, line
" numbers or current line
autocmd ColorScheme * hi Normal ctermbg=NONE guibg=NONE
autocmd ColorScheme * hi CursorLine cterm=None ctermbg=Black ctermfg=None
autocmd ColorScheme * hi CursorLineNr ctermbg=Black ctermfg=None
autocmd ColorScheme * hi LineNr cterm=None ctermbg=None ctermfg=DarkGray
" Markdown
if has("autocmd")
autocmd FileType markdown set wrap
autocmd FileType markdown set linebreak
endif
" Editing
if has("autocmd")
" Strip trailing white space on specific files
autocmd BufWritePre *.php,*.phtml,*.htm,*.html,*.css,*.py,*.js :%s/\s\+$//ge
" Go back to the position the cursor was on the last time this file was edited
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")|execute("normal `\"")|endif
endif
" PHP
if has("autocmd")
" Highlight interpolated variables in SQL strings & SQL-syntax highlighting
autocmd FileType php let php_sql_query=1
" Highlight HTML inside of PHP strings
autocmd FileType php let php_htmlInStrings=1
" Discourages use of short tags.
autocmd FileType php let php_noShortTags=1
endif