-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
149 lines (123 loc) · 4.77 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
138
139
140
141
142
143
144
145
146
147
148
149
set encoding=utf-8 nobomb
runtime! autoload/pathogen.vim
silent! call pathogen#helptags()
silent! call pathogen#runtime_append_all_bundles()
execute pathogen#infect()
syntax on " syntax highlighting
set background=dark
let g:solarized_termcolors=256
let g:solarized_visibility = "high"
let g:solarized_contrast = "high"
let g:solarized_termtrans = 1
colorscheme solarized " jellybeans
set nocompatible
set number " line numbers on
set nowrap " wrap long lines
set tabstop=4 " an isndentation every four columns
set softtabstop=4 " let backspace delete indent
set shiftwidth=4 " use indents of 4 spaces
set expandtab " tabs are spaces, not tabstopset
set pastetoggle=<F2> " allows text to be pasted with original alignment
set autoindent " indets each line the same as the previous one
set smartindent " automatically inserts one extra level on indentation
set shortmess=atI " short messages and dont show intro
" set virtualedit=onemore " allow for cursor beyond last character
filetype indent on
filetype plugin indent on
" Making it so ; works like : for commands. Saves typing and eliminates :W style typos due to lazy holding shift.
nore ; :
nore , ;
"set backup " backups are nice ...
"set undofile " so is persistent undo ...
"set undolevels=1000 "maximum number of changes that can be undone
"set undoreload=10000 "maximum number lines to save for undo on a buffer reload
set showcmd " shows nomral mode key presses at the bottom
set history=2000 " Store a ton of history (default is 20)
" set spell " spell checking on
set mouse=a " automatically enable mouse usage
set confirm " dialog asking to confirm things instead of error
set ruler " show current position at bottm
set showmatch " show matching brackets/parenthesis
set incsearch " find as you type search
set hlsearch " highlight search terms
set ignorecase " case insensitive search
" set wildmenu " Enhance command-line completion
set whichwrap=b,s,h,l,<,>,[,] " backspace and cursor keys wrap to
set scrolljump=5 " lines to scroll when cursor leaves screen
set scrolloff=3 " minimum lines to keep above and below cursor
set foldenable " auto fold code"
" set tabpagemax=15 " only show 15 tabs
set showmode " display the current mode
"set linespace=0 " No extra spaces between rows
set cursorline " highlight current line
" hi CursorLine cterm=None ctermbg=235
" hi CursorColumn guibg=#333333
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
set clipboard=unnamed
" Allow cursor keys in insert mode
set esckeys
" Allow backspace in insert mode
set backspace=indent,eol,start
" Optimize for fast terminal connections
set ttyfast
" Add the g flag to search/replace by default
set gdefault
" Dont add empty newlines at the end of files
set binary
set noeol
" Show the filename in the window titlebar
set title
" Enable per-directory .vimrc files and disable unsafe commands in them
set exrc
set secure
" Respect modeline in files
set modeline
set modelines=4
" make cursor move as expected with wrapped lines
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
"use Enter to insert new lines
map <CR> o<Esc>k
" use Space to add spaces in cmd mode
map <Space> i<Space><Esc>
au FileType xhtml,xml so ~/.vim/bundle/HTML-AutoCloseTag/ftplugin/html_autoclosetag.vim
au! BufRead,BufNewFile *.json set filetype=json
" Strip trailing whitespace (,ss)
function! StripWhitespace()
let save_cursor = getpos(".")
let old_query = getreg('/')
:%s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfunction
" Automatic commands
if has("autocmd")
" Enable file type detection
filetype on
" Treat .json files as .js
autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
endif
imap jj <Esc>
cmap W w
cmap WQ wq
cmap wQ wq
cmap Wq wq
cmap Q q
cmap Tabe tabe
cmap cwd lcd %:p:h
cmap cd. lcd %:p:h
cmap w!! w !sudo tee >/dev/null %"
" set t_Co=256
" set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim
set rtp+=/Users/galchook26/Library/Python/2.7/lib/python/site-packages/powerline/bindings/vim
let g:Powerline_symbols = 'fancy'
"
" Always show status line
set laststatus=2
" Don’t reset cursor to start of line when moving around.
set nostartofline
set tabstop=4 " an isndentation every four columns
set softtabstop=4 " let backspace delete indent
set shiftwidth=4 " use indents of 4 spaces
set expandtab " tabs are spaces, not tabstopset
let g:used_javascript_libs = 'underscore,backbone,jquery,prelude,angularjs,requirejs'