This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
142 lines (128 loc) · 3.41 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
set nocompatible
""" Vundle Plugin Manager {{{
""" Set up Vundle if first run {{{
let has_vundle=1
if !filereadable($HOME."/.vim/bundle/Vundle.vim/README.md")
echo "Installing Vundle..."
echo ""
silent !mkdir -p $HOME/.vim/bundle
silent !git clone https://github.com/VundleVim/Vundle.vim $HOME/.vim/bundle/Vundle.vim
let has_vundle=0
endif
""" }}}
""" Initialize Vundle {{{
filetype off
set rtp+=$HOME/.vim/bundle/Vundle.vim
call vundle#begin()
""" }}}
""" Plugins {{{
Plugin 'VundleVim/Vundle.vim'
Plugin 'chrisbra/SudoEdit.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'vim-syntastic/syntastic'
Plugin 'Shougo/neco-vim'
Plugin 'Shougo/neocomplete.vim'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'morhetz/gruvbox'
Plugin 'majutsushi/tagbar'
Plugin 'itchyny/lightline.vim'
Plugin 'baskerville/vim-sxhkdrc'
Plugin 'PotatoesMaster/i3-vim-syntax'
""" }}}
""" Finish Vundle {{{
call vundle#end()
filetype plugin indent on
""" }}}
""" Init plugins if first run {{{
if has_vundle == 0
:silent! VundleInstall
:qa
endif
""" }}}
""" }}}
""" User Interface {{{
""" Visual {{{
syntax on
set number
set noshowmode
set linebreak
set showbreak=+++
set showmatch
set visualbell
set ruler
set showtabline=2
set laststatus=2
set cmdheight=1
colorscheme gruvbox
""" }}}
""" Search {{{
set hlsearch
set smartcase
set ignorecase
set incsearch
""" }}}
""" Tabs {{{
filetype indent on
set nowrap
set autoindent
set expandtab
set shiftwidth=4
set smartindent
set smarttab
set softtabstop=4
set backspace=indent,eol,start
""" }}}
""" Folding {{{
set foldcolumn=0
set foldmethod=indent
set foldnestmax=10
set foldlevelstart=99
""" }}}
set formatoptions+=j
""" }}}
""" Keybindings {{{
let mapleader=","
" Remove annoying bindings
inoremap <F1> <Nop>
nnoremap <F1> <Nop>
vnoremap <F1> <Nop>
map Q <Nop>
" Toggle pastemode
set pastetoggle=<F3>
" Toggle folding
nnoremap <silent> <Space> @=(foldlevel('.') ? 'za' : "\<Space>")<CR>
" Tagbar
map <F1> :TagbarToggle<CR>
" Window navigation
map <silent> Oa :wincmd k<CR>
map <silent> Ob :wincmd j<CR>
map <silent> Od :wincmd h<CR>
map <silent> Oc :wincmd l<CR>
""" Toggle realtive numbers {{{
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
else
set relativenumber
endif
endfunction
nnoremap <Leader>r :call NumberToggle()<CR>
""" }}}
""" }}}
""" Syntastic {{{
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
""" }}}
""" Neocomplete {{{
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#enable_auto_close_preview = 1
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
""" }}}