-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
150 lines (133 loc) · 4.9 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
" Vundle
set nocompatible " Be iMproved, required
filetype off " Required
" Set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" Let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" Plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" Plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" Git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
"Plugin 'ascenator/L9', {'name': 'newL9'}
Plugin 'scrooloose/nerdtree'
Plugin 'xuyuanp/nerdtree-git-plugin'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-surround'
Plugin 'kien/ctrlp.vim'
if has('python') || has('python3')
Plugin 'valloric/youcompleteme', {'do': 'git submodule update --init --recursive'}
endif
Plugin 'rizzatti/dash.vim'
Plugin 'universal-ctags/ctags'
Plugin 'taglist.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" See :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" Plugin
autocmd StdinReadPre * let s:std_in=1
"NERDTree {
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
map <C-n> :NERDTreeToggle<CR>
"}
"taglist {
set tags=tags;
set autochdir
let Tlist_Show_One_File = 1 " Only show current file's taglist, default is all
let Tlist_Exit_OnlyWindow = 1 " Exit vim when only taglist window
let Tlist_Use_Right_Window = 0 " Show taglist window on right side
let Tlist_GainFocus_On_ToggleOpen = 1 " Let gain focus on taglist window
"let Tlist_Ctags_Cmd = '/usr/local/bin/ctags' " Set ctags command location
nnoremap <leader>tl :Tlist<CR> " Set shortcut of Tlit
"}
" System
set clipboard=unnamed
" Colors
colorscheme desert
syntax enable " Enable syntax processing
" Spaces & Tabs
set tabstop=4 " Number of visual spaces per TAB
set softtabstop=4 " Number of spaces in tab when editing
set expandtab " Tabs are spaces
set shiftwidth=4 " Size of 'Indent'
" UI Config
set number " Show line numbers
set showcmd " Show command in bottom bar
set cursorline " Highlight current line
set guifont=Ubuntu\ Mono:h16
filetype indent on " Load filetype-specific indent files
set wildmenu " Visual autocomplete for command menu
set lazyredraw " Redraw only when we need to
set showmatch " Highlight matching [{()}]
set fileencoding=utf-8
set fileencodings=utf-8,ucs-bom,gb18030,gb2312,gbk,big5,cp936,latin1
set encoding=utf-8
"set termencoding=utf-8
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
" Searching
set incsearch " Search as characters are entered
set hlsearch " Highlight matches
" Folding
set foldenable " Enable folding
set foldlevelstart=10 " Open most folds by default
set foldnestmax=10 " 10 nested fold max
set foldmethod=indent " Fold based on indent level
" WhiteSpace
set listchars=tab:→\ ,trail:>,eol:↲,nbsp:␣,trail:·,extends:›,precedes:‹
set showbreak=↩
set list
" Space open/closes folds
nnoremap <space> za
" Movement
" Move vertically by visual line
"nnoremap j gj
"nnoremap k gk
" Move to beginning/end of line
nnoremap B ^
nnoremap E $
" $/^ doesn't do anything
"nnoremap $ <nop>
"nnoremap ^ <nop>
" Highlight last inserted text
nnoremap gV `[v`]
" Leader Shortcuts
let mapleader="," " leader is comma
" Toggle gundo
nnoremap <leader>u :GundoToggle<CR>
" Edit/load vimrc and load vimrc bindings
nnoremap <leader>ev :vsp $MYVIMRC<CR>
nnoremap <leader>sv :source $MYVIMRC<CR>
" Save session
nnoremap <leader>s :mksession<CR>
" Turn off search highlight
nnoremap <leader><space> :nohlsearch<CR>
" Auto copy backup to origin file
au FileType crontab setlocal bkc=yes