-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
210 lines (161 loc) · 5.46 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
set nocompatible
filetype off
"set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
"####################### start Vundles ##########################
" required
Plugin 'gmarik/Vundle.vim'
" interact with git from vim
Plugin 'tpope/vim-fugitive'
" C-p to navigate easily via search
Plugin 'kien/ctrlp.vim'
" Python Autocompletion
Plugin 'davidhalter/jedi-vim'
" Nerdsssss
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/nerdtree'
" ctag based tags (F5 to browse file structure)
Plugin 'majutsushi/tagbar'
" syntax stuff
Bundle 'plasticboy/vim-markdown'
Bundle 'scrooloose/syntastic'
" color stuff
Bundle 'altercation/vim-colors-solarized'
" Go lang
Plugin 'fatih/vim-go'
"####################### end Vundles ##########################
" close vundling
call vundle#end() " required
filetype plugin indent on " required
" required for NerdCommenter
filetype plugin on
" ################ Begin actual configuration ################
"now we start
syntax enable " syntax highlighting
syntax on
" persistent undo
"set undofile
"set undodir=~/.vim-tmp
" persistent paste
"set paste
"history stuff
set history =700 " setting history length to 700
"encoding stuff
set encoding=utf-8
set autoread " detect changes in outside apps
set ruler " show cursor position
set number " line numbers
set ignorecase " case insensitive searching...
set smartcase " ...unless query is capitalized
set hlsearch " highlight matches...
set magic " pattern match with special characters
set showmatch " show matching braces/paren
set showcmd " display incomplete commands.
set showmode " display the mode you're in.
set gfn=Menlo:h18 " gVim font
set shell=/bin/bash " for running things
set backspace=indent,eol,start " Intuitive backspacing.
set hidden " Handle multiple buffers better.
set wildmenu " Enhanced command line completion.
set wildmode=list:longest " Complete files like a shell.
"set wrap " Turn on line wrapping.
set nowrap
set scrolloff=3 " Show 3 lines of context around the cursor.
set title " Set the terminal's title
set visualbell " No beeping.
set nobackup " Don't make a backup before overwriting a file.
set nowritebackup " And again.
set noswapfile " no swap files
"set directory=$HOME/.vim/tmp/ " Keep swap/backup files in one location
set expandtab " spaces instead of tabs
set shiftwidth=4 " shift width
set tabstop=4 " tab width
set smarttab
set laststatus=2 " Show the status line all the time
" sexy status line
" set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{fugitive#statusline()}%{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
"set lbr " smart word breaking
"set tw=80 " line width
"set si " smart indenting
set wrap
set list
"display some chars with some other magicchars
set listchars=tab:▸\ ,eol:¬,trail:·,extends:>,precedes:<
set showbreak=↪
"clipboarding
set clipboard=unnamed
"set clipboard+=unnamed
"colorscheme
"colorscheme elflord
" set iterm2 solarized to xterm-256color
set background=dark
let g:solarized_termcolors=256
let g:solarized_contrast="high"
let g:solarized_visibility="high"
colorscheme solarized
" folding
" set foldmethod=indent
" Enable mouse support
set mouse=a
""""""""""""""""""""""""""""""""
" custom keys
" custom keys
" custom keys
""""""""""""""""""""""""""""""""
nnoremap <Space> za
vnoremap <Space> zf
"remap movement keys
"down, up, left, right
"j k l ;
noremap l <left>
noremap <C-w>l <C-w><left>
noremap ; <right>
noremap <C-w>; <C-w><right>
noremap <C-x> :x<CR>
let mapleader = ","
""""""""""""""""""""""""""""""""
"for switching tabs/windows
"CTRL for tabs, ALT for windows
map <C-left> <C-w><left>
map <C-right> <C-w><right>
map <C-up> <C-w><up>
map <C-down> <C-w><down>
" complement <C-w>n :new<CR>
map <C-w>m :vnew<CR>
"just use gt and gT
map <A-left> :tabnext<CR>
map <A-right> :tabprevious<CR>
map <A-up> :tabs<CR>
map <A-down> :tabe<CR>
"map <A-c> :tabeclose<CR>
"For NERDTree
map <F4> :NERDTreeToggle<CR>
let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$', '\.swp$']
let NERDTreeWinSize=30
"For TagBar
map <F5> :TagbarToggle<CR>
"For CtrlP
map <C-p> :CtrlP<CR>
" don't mind me just ignoring things
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.tar,*.tar.*
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
"For autocmd
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"For vimshell
map <C-w>s :source ~/.vim/bundle/vimsh/vimsh.vim<CR>
" Code Nav
nnoremap <C-f> :noautocmd :execute "vimgrep /" . expand("<cword>") . "/j **" <Bar> cw<CR>
nnoremap <Leader>k :cn<CR>
nnoremap <Leader>j :cp<CR>
" Go Settings
let g:go_bin_path = "/home/fatih/.mypath"
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
" Paste Toggle
set pastetoggle=<F2>
highlight Normal ctermbg=black