-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
150 lines (125 loc) · 3.85 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
" ======================================================
" Maintainer: Derrick J Wippler <[email protected]>
" ======================================================
set ch=1 " Make command line 1 line high
set mousehide " Hide the mouse when typing text
set dir=~/.vimswap " Don't litter the filesystem with swapfiles
set expandtab
set shiftwidth=4
set tabstop=4
set nowrap
set background=dark
set guioptions-=T
set mousemodel=popup
set hlsearch
set autoindent
set tags=./tags;/ " Loads any files named 'tags' in the directory tree
set nocompatible
set ruler
set backspace=indent,eol,start
let python_highlight_all = 1
syntax on
" Show matching braces when cursor is over a brace
set showmatch
" Smart Indent
set si
" Set Font Size, Because I'm old and blind now
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 12
elseif has("gui_macvim")
set guifont=Menlo\ Regular:h14
elseif has("gui_win32")
set guifont=Consolas:h11:cANSI
elseif has("gui_vimr")
set guifont=Menlo\ Regular:h14
endif
endif
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" My personal Keybindings for Navigating Tabs
nmap <C-S-h> :tabprevious<cr>
nmap <C-S-l> :tabnext<cr>
map <C-S-h> :tabprevious<cr>
map <C-S-l> :tabnext<cr>
imap <C-S-h> <ESC>:tabprevious<cr>i
imap <C-S-l> <ESC>:tabnext<cr>i
nmap <C-S-N> :tabnew<cr>
imap <C-t> <ESC>:tabnew<cr>
" Support virtualenv if it exists
"if has('python')
"py << EOF
"import os.path
"import sys
"import vim
"if 'VIRTUAL_ENV' in os.environ:
"project_base_dir = os.environ['VIRTUAL_ENV']
"sys.path.insert(0, project_base_dir)
"activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
"execfile(activate_this, dict(__file__=activate_this))
"EOF
"endif
" Put the basename on the GUI Tabs instead of the full path
function GuiTabLabel()
let label = ''
let bufnrlist = tabpagebuflist(v:lnum)
" Add '+' if one of the buffers in the tab page is modified
for bufnr in bufnrlist
if getbufvar(bufnr, "&modified")
let label = '+'
break
endif
endfor
" Append the number of windows in the tab page if more than one
let wincount = tabpagewinnr(v:lnum, '$')
if wincount > 1
let label .= wincount
endif
if label != ''
let label .= ' '
endif
" Append the buffer name
return label . simplify(bufname(bufnrlist[tabpagewinnr(v:lnum) - 1]))
endfunction
"set guitablabel=%{GuiTabLabel()}
set guitablabel=%t
" Include go syntax highlighting
set rtp+=$GOROOT/misc/vim
" Required for vundle
filetype off
filetype plugin indent on
" Fuzzy Finder file ignores
set wildignore+=*.pyc,*.so,*.swp,
" Required for vim-python-pep8-indent
let g:pymode_indent = 0
" Vundle
"set rtp+=~/.vim/bundle/Vundle.vim/
"call vundle#rc()
" GeekNote Plugin Settings
noremap <F9> :Geeknote<CR>
let g:GeeknoteFormat="markdown"
nmap <F8> :TagbarToggle<CR>
"nmap <C-j> :YcmCompleter GoToDefinition<CR>
nmap <C-j> :YcmCompleter GoToDefinitionElseDeclaration<CR>
nmap <C-p> :CtrlP<CR>
" Mark line longer than 79 characters in RED
highlight ColorColumn ctermbg=red
au BufWinEnter *.py let w:m1=matchadd('ColorColumn', '\%81v', 100)
" Make TABS and trailling spaces visible
"set listchars=tab:>~,nbsp:_,trail:.
set listchars=tab:>-,nbsp:_,trail:.
set list
set laststatus=2
" Enable Syntax highlighting
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
au FileType *.go set tabstop=4 shiftwidth=4 noexpandtab nolist
au BufEnter *.go set ai sw=4 ts=4 noet nolist
au BufWinEnter *.go set ai sw=4 ts=4 noet nolist
au FileType *.sls set autoindent tabstop=2 shiftwidth=2 expandtab list
au BufEnter *.sls set ai sw=2 ts=2 et list
" Yaml files
au FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
au BufEnter yaml setlocal ts=2 sts=2 sw=2 expandtab