-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
99 lines (71 loc) · 2.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
" AUTHOR: Brian Z.
" define colorscheme
let theme="solarized"
" expected delete key behavior
set backspace=indent,eol,start
" smartindent with pound
"set smartindent
"inoremap # X<BS>#
" cindent with pound
set cindent
set cinkeys-=0#
" use Mac system clipboard
set clipboard=unnamed
" highlight the screen line of the cursor
set cursorline
set hlsearch
" show invisibles
set list
set listchars=tab:»-,eol:¬,trail:·
" show the line and column number of the cursor position
set ruler
"set rulerformat=%15(%c%V\ %p%%%)
" minimal number of screen lines to keep above and below the cursor
set scrolloff=2
" only if there are at least two tab pages
set showtabline=1
" enable 2^8 colors
set t_Co=256
" use visual bell instead of beeping
set visualbell
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on " syntax highlighting most useful in a modeline
set background=dark " what the background color looks like
" jump to the last position when reopening a file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" load indentation rules and plugins according to the detected filetype
filetype plugin indent on
set showcmd " show (partial) command in status line
set showmatch " show matching brackets
set ignorecase " do case insensitive matching
set smartcase " do smart case matching
set incsearch " incremental search
set autowrite " autosave before commands like :next and :make
set hidden " hide buffers when they are abandoned
set mouse=a " enable mouse usage (all modes)
" source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
set laststatus=2 " status line always
set number " print the line number in front of each line
set expandtab " use the appropriate number of spaces to insert a tab
set shiftwidth=4 " number of spaces to use for each step of (auto)indent
set smarttab " <Tab> inserts blanks according to 'shiftwidth'
"set softtabstop=2 " number of spaces <Tab> counts for while editing
set wildmenu " command-line completion operates in an enhanced mode
set wim=longest,full " completion mode that is used for 'wildchar'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" load colorscheme
if filereadable($HOME."/.vim/colors/".theme.".vim")
execute "colorscheme ".theme
endif
" scroll wheel move one line in Normal mode
map <ScrollWheelUp> <C-Y>
map <S-ScrollWheelUp> <C-U>
map <ScrollWheelDown> <C-E>
map <S-ScrollWheelDown> <C-D>
" identify syntax highlight group
map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
" quick switch buffer
map <Tab><Tab> :b#<CR>