-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
148 lines (109 loc) · 3.79 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
" This must be first, because it changes other options as a side effect.
set nocompatible " We want the latest Vim settings/options.
so ~/.vim/plugins.vim
syntax enable
set background=dark
set backspace=indent,eol,start " allow backspacing over everything in insert mode
let mapleader = ',' " The default leader is \, but a comma is much better
set enc=utf8 " 文件編碼加入utf8
"set number
set tabstop=2
set shiftwidth=2
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
"-----------Visauls-------------"
colorscheme torte
set t_Co=256 "Use 256 colors. This is useful for Terminal Vim.
set guifont=Fira_code:h15 "Set the default font family and size.
set guioptions-=e "We don't want Gui tabs.
set linespace=10 "Macvim-specific line-height.
set guioptions-=l "Disables Gui scrollbars.
set guioptions-=L
set guioptions-=r
set guioptions-=R
"We'll fake a custom left padding for each window.
"make line_number_bar (sidebar) 's color equal to bg
hi LineNr guibg=bg
set foldcolumn=0
hi foldcolumn guibg = bg
"Get rid of ugly split borders.
hi vertsplit guifg=bg guibg=bg
"------------Search-------------"
set hlsearch " Highlight all matched terms.
set incsearch " do incremental searching.
"-----------Split Management----------"
set splitbelow
set splitright
nmap <C-J> <C-W><C-J>
nmap <C-K> <C-W><C-K>
nmap <C-H> <C-W><C-H>
nmap <C-L> <C-W><C-L>
"------------Mappings------------"
"Make it easy to edit the Vimrc file."
"<cr> is for return enter"
nmap <Leader>ev :tabedit $MYVIMRC<cr>
"Make it easy to edit the Vimrc file."
nmap <Leader>ez :tabedit $MYZSHRC<cr>
"Add simple highlight removal
nmap <Leader><space> :nohlsearch<cr>
"ctag find
nmap <Leader>f :tag<space>
"--- --- --- --- -Plugins- --- --- --- ---"
"/
"/ CtrlP
"/
let g:ctrlp_custom_ignore = 'node_modules\DS_Store\|git'
let g:ctrlp_match_window = 'top,order:ttb,min:1,max:30,results:30'
nmap <c-p> :CtrlP<cr>
nmap <c-r> :CtrlPBufTag<cr>
nmap <c-e> :CtrlPMRUFiles<cr>
"/
"/ NERDTree
"/
let NERDTreeHijackNetrw = 0
nmap <c-1> :NERDTreeToggle<cr>
"/
"/ Greplace.vim
"/
"/set grepprg=ack "We want to use Ack for the search.
"/let g:grep_cmd_opts = '--noheading'
set grepprg=ag
let g:grep_cmd_opts = '--line-numbers --noheading'
"/
"/ Ack.vim -> make Ack.vim use like Ag.vim
"/
let g:ackprg = 'ag --vimgrep --smart-case'
cnoreabbrev ag Ack
cnoreabbrev aG Ack
cnoreabbrev Ag Ack
cnoreabbrev AG Ack
"----------Auto-Commands---------"
"Automactically source the Vimrc file on save.
"autocmd! means clear out the group and start from scratch
augroup autosourcing
autocmd!
autocmd BufWritePost .vimrc :silent !python3 copy_2.py
autocmd BufWritePost .vimrc source %
augroup END
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
" Notes and Tips
" " - Press 'zz' to instantly center the line where the cursor is located.
set backupdir=~/vimtmp,.
set directory=~/vimtmp,.
autocmd BufRead,BufNewFile *.launch setfiletype roslaunch